From d8707de48f45730b62b0028f09ed59536a693049 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:25:24 +0200 Subject: [PATCH 01/13] deps: update go-sequence and add aws deps for SES & secretsmanager --- go.mod | 20 +- go.sum | 32 +- .../0xsequence/ethkit/ethrpc/ethrpc.go | 20 + .../0xsequence/ethkit/ethrpc/interface.go | 6 + .../go-sequence/intents/intent.gen.go | 59 +- .../go-sequence/intents/intent.gen.ts | 53 +- .../go-sequence/intents/intent.ridl | 62 +- .../go-sequence/intents/intent_data_ext.go | 3 - .../intents/intent_response_typed.go | 4 + .../go-sequence/intents/intent_typed.go | 4 + .../aws-sdk-go-v2/aws/go_module_metadata.go | 2 +- .../aws/middleware/private/metrics/metrics.go | 5 +- .../aws-sdk-go-v2/aws/signer/v4/middleware.go | 29 - .../aws/aws-sdk-go-v2/aws/signer/v4/v4.go | 55 +- .../internal/configsources/CHANGELOG.md | 8 + .../configsources/go_module_metadata.go | 2 +- .../internal/endpoints/v2/CHANGELOG.md | 8 + .../endpoints/v2/go_module_metadata.go | 2 +- .../service/secretsmanager/CHANGELOG.md | 510 + .../service/secretsmanager/LICENSE.txt | 202 + .../service/secretsmanager/api_client.go | 553 + .../api_op_BatchGetSecretValue.go | 276 + .../api_op_CancelRotateSecret.go | 173 + .../secretsmanager/api_op_CreateSecret.go | 356 + .../api_op_DeleteResourcePolicy.go | 155 + .../secretsmanager/api_op_DeleteSecret.go | 212 + .../secretsmanager/api_op_DescribeSecret.go | 266 + .../api_op_GetRandomPassword.go | 172 + .../api_op_GetResourcePolicy.go | 164 + .../secretsmanager/api_op_GetSecretValue.go | 216 + .../api_op_ListSecretVersionIds.go | 281 + .../secretsmanager/api_op_ListSecrets.go | 273 + .../api_op_PutResourcePolicy.go | 188 + .../secretsmanager/api_op_PutSecretValue.go | 288 + .../api_op_RemoveRegionsFromReplication.go | 156 + .../api_op_ReplicateSecretToRegions.go | 163 + .../secretsmanager/api_op_RestoreSecret.go | 155 + .../secretsmanager/api_op_RotateSecret.go | 257 + .../api_op_StopReplicationToReplica.go | 151 + .../secretsmanager/api_op_TagResource.go | 172 + .../secretsmanager/api_op_UntagResource.go | 169 + .../secretsmanager/api_op_UpdateSecret.go | 290 + .../api_op_UpdateSecretVersionStage.go | 193 + .../api_op_ValidateResourcePolicy.go | 169 + .../service/secretsmanager/auth.go | 284 + .../service/secretsmanager/deserializers.go | 6001 ++++++ .../service/secretsmanager/doc.go | 45 + .../service/secretsmanager/endpoints.go | 611 + .../service/secretsmanager/generated.json | 55 + .../secretsmanager/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 650 + .../service/secretsmanager/options.go | 228 + .../service/secretsmanager/serializers.go | 2012 ++ .../service/secretsmanager/types/enums.go | 72 + .../service/secretsmanager/types/errors.go | 339 + .../service/secretsmanager/types/types.go | 321 + .../service/secretsmanager/validators.go | 808 + .../aws-sdk-go-v2/service/ses/CHANGELOG.md | 408 + .../aws/aws-sdk-go-v2/service/ses/LICENSE.txt | 202 + .../aws-sdk-go-v2/service/ses/api_client.go | 538 + .../service/ses/api_op_CloneReceiptRuleSet.go | 158 + .../ses/api_op_CreateConfigurationSet.go | 145 + ..._CreateConfigurationSetEventDestination.go | 159 + ...p_CreateConfigurationSetTrackingOptions.go | 154 + ...p_CreateCustomVerificationEmailTemplate.go | 170 + .../service/ses/api_op_CreateReceiptFilter.go | 144 + .../service/ses/api_op_CreateReceiptRule.go | 153 + .../ses/api_op_CreateReceiptRuleSet.go | 150 + .../service/ses/api_op_CreateTemplate.go | 143 + .../ses/api_op_DeleteConfigurationSet.go | 142 + ..._DeleteConfigurationSetEventDestination.go | 149 + ...p_DeleteConfigurationSetTrackingOptions.go | 145 + ...p_DeleteCustomVerificationEmailTemplate.go | 139 + .../service/ses/api_op_DeleteIdentity.go | 138 + .../ses/api_op_DeleteIdentityPolicy.go | 160 + .../service/ses/api_op_DeleteReceiptFilter.go | 142 + .../service/ses/api_op_DeleteReceiptRule.go | 147 + .../ses/api_op_DeleteReceiptRuleSet.go | 145 + .../service/ses/api_op_DeleteTemplate.go | 137 + .../ses/api_op_DeleteVerifiedEmailAddress.go | 134 + .../api_op_DescribeActiveReceiptRuleSet.go | 145 + .../ses/api_op_DescribeConfigurationSet.go | 168 + .../service/ses/api_op_DescribeReceiptRule.go | 154 + .../ses/api_op_DescribeReceiptRuleSet.go | 152 + .../ses/api_op_GetAccountSendingEnabled.go | 132 + ...i_op_GetCustomVerificationEmailTemplate.go | 162 + .../ses/api_op_GetIdentityDkimAttributes.go | 171 + ..._op_GetIdentityMailFromDomainAttributes.go | 148 + ...pi_op_GetIdentityNotificationAttributes.go | 154 + .../service/ses/api_op_GetIdentityPolicies.go | 168 + ...pi_op_GetIdentityVerificationAttributes.go | 365 + .../service/ses/api_op_GetSendQuota.go | 141 + .../service/ses/api_op_GetSendStatistics.go | 134 + .../service/ses/api_op_GetTemplate.go | 140 + .../ses/api_op_ListConfigurationSets.go | 160 + ...op_ListCustomVerificationEmailTemplates.go | 255 + .../service/ses/api_op_ListIdentities.go | 250 + .../ses/api_op_ListIdentityPolicies.go | 162 + .../service/ses/api_op_ListReceiptFilters.go | 141 + .../service/ses/api_op_ListReceiptRuleSets.go | 153 + .../service/ses/api_op_ListTemplates.go | 147 + .../ses/api_op_ListVerifiedEmailAddresses.go | 129 + ...i_op_PutConfigurationSetDeliveryOptions.go | 139 + .../service/ses/api_op_PutIdentityPolicy.go | 171 + .../ses/api_op_ReorderReceiptRuleSet.go | 151 + .../service/ses/api_op_SendBounce.go | 179 + .../ses/api_op_SendBulkTemplatedEmail.go | 272 + .../ses/api_op_SendCustomVerificationEmail.go | 159 + .../service/ses/api_op_SendEmail.go | 256 + .../service/ses/api_op_SendRawEmail.go | 340 + .../service/ses/api_op_SendTemplatedEmail.go | 275 + .../ses/api_op_SetActiveReceiptRuleSet.go | 142 + .../ses/api_op_SetIdentityDkimEnabled.go | 160 + ...op_SetIdentityFeedbackForwardingEnabled.go | 160 + ...etIdentityHeadersInNotificationsEnabled.go | 163 + .../ses/api_op_SetIdentityMailFromDomain.go | 167 + .../api_op_SetIdentityNotificationTopic.go | 166 + .../ses/api_op_SetReceiptRulePosition.go | 151 + .../service/ses/api_op_TestRenderTemplate.go | 146 + .../ses/api_op_UpdateAccountSendingEnabled.go | 135 + ..._UpdateConfigurationSetEventDestination.go | 155 + ...onfigurationSetReputationMetricsEnabled.go | 145 + ...op_UpdateConfigurationSetSendingEnabled.go | 146 + ...p_UpdateConfigurationSetTrackingOptions.go | 152 + ...p_UpdateCustomVerificationEmailTemplate.go | 160 + .../service/ses/api_op_UpdateReceiptRule.go | 148 + .../service/ses/api_op_UpdateTemplate.go | 139 + .../service/ses/api_op_VerifyDomainDkim.go | 185 + .../ses/api_op_VerifyDomainIdentity.go | 159 + .../service/ses/api_op_VerifyEmailAddress.go | 135 + .../service/ses/api_op_VerifyEmailIdentity.go | 140 + .../aws/aws-sdk-go-v2/service/ses/auth.go | 284 + .../service/ses/deserializers.go | 17724 ++++++++++++++++ .../aws/aws-sdk-go-v2/service/ses/doc.go | 30 + .../aws-sdk-go-v2/service/ses/endpoints.go | 516 + .../aws-sdk-go-v2/service/ses/generated.json | 104 + .../service/ses/go_module_metadata.go | 6 + .../ses/internal/endpoints/endpoints.go | 477 + .../aws/aws-sdk-go-v2/service/ses/options.go | 224 + .../aws-sdk-go-v2/service/ses/serializers.go | 6689 ++++++ .../aws-sdk-go-v2/service/ses/types/enums.go | 373 + .../aws-sdk-go-v2/service/ses/types/errors.go | 1027 + .../aws-sdk-go-v2/service/ses/types/types.go | 1355 ++ .../aws-sdk-go-v2/service/ses/validators.go | 3104 +++ .../sergi/go-diff/diffmatchpatch/diff.go | 13 +- .../go-diff/diffmatchpatch/stringutil.go | 100 +- vendor/github.com/webrpc/webrpc/go.mod | 21 +- vendor/modules.txt | 26 +- 148 files changed, 62719 insertions(+), 149 deletions(-) create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/LICENSE.txt create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_BatchGetSecretValue.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RemoveRegionsFromReplication.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ReplicateSecretToRegions.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_StopReplicationToReplica.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/auth.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/options.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/CHANGELOG.md create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/LICENSE.txt create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_client.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CloneReceiptRuleSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetEventDestination.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetTrackingOptions.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateCustomVerificationEmailTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptFilter.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRule.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRuleSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetEventDestination.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetTrackingOptions.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteCustomVerificationEmailTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentity.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentityPolicy.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptFilter.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRule.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRuleSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteVerifiedEmailAddress.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeActiveReceiptRuleSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeConfigurationSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRule.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRuleSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetAccountSendingEnabled.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetCustomVerificationEmailTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityDkimAttributes.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityMailFromDomainAttributes.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityNotificationAttributes.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityPolicies.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityVerificationAttributes.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendQuota.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendStatistics.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListConfigurationSets.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListCustomVerificationEmailTemplates.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentities.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentityPolicies.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptFilters.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptRuleSets.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListTemplates.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListVerifiedEmailAddresses.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutConfigurationSetDeliveryOptions.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutIdentityPolicy.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ReorderReceiptRuleSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBounce.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBulkTemplatedEmail.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendCustomVerificationEmail.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendEmail.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendRawEmail.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendTemplatedEmail.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetActiveReceiptRuleSet.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityDkimEnabled.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityFeedbackForwardingEnabled.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityHeadersInNotificationsEnabled.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityMailFromDomain.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityNotificationTopic.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetReceiptRulePosition.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_TestRenderTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateAccountSendingEnabled.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetEventDestination.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetReputationMetricsEnabled.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetSendingEnabled.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetTrackingOptions.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateCustomVerificationEmailTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateReceiptRule.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateTemplate.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainDkim.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainIdentity.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailAddress.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailIdentity.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/auth.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/deserializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/generated.json create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/go_module_metadata.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/internal/endpoints/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/options.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/serializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/enums.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/types.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ses/validators.go diff --git a/go.mod b/go.mod index 4bfb89ec..6a6ff367 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,19 @@ module github.com/0xsequence/waas-authenticator go 1.22.1 require ( - github.com/0xsequence/ethkit v1.24.12 - github.com/0xsequence/go-sequence v0.32.1 + github.com/0xsequence/ethkit v1.25.0 + github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e github.com/0xsequence/nitrocontrol v0.3.0 github.com/BurntSushi/toml v1.3.2 - github.com/aws/aws-sdk-go-v2 v1.26.1 + github.com/aws/aws-sdk-go-v2 v1.27.0 github.com/aws/aws-sdk-go-v2/config v1.27.4 + github.com/aws/aws-sdk-go-v2/credentials v1.17.4 github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.13.6 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.1 github.com/aws/aws-sdk-go-v2/service/kms v1.29.1 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.29.1 + github.com/aws/aws-sdk-go-v2/service/ses v1.22.9 + github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 github.com/go-chi/chi/v5 v5.0.12 github.com/go-chi/httplog v0.3.2 github.com/go-chi/jwtauth/v5 v5.3.0 @@ -26,7 +30,7 @@ require ( github.com/riandyrn/otelchi v0.7.0 github.com/rs/zerolog v1.32.0 github.com/stretchr/testify v1.9.0 - github.com/webrpc/webrpc v0.18.6 + github.com/webrpc/webrpc v0.18.7 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.50.0 go.opentelemetry.io/contrib/propagators/aws v1.25.0 go.opentelemetry.io/otel v1.26.0 @@ -43,10 +47,9 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.4 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.20.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect @@ -55,7 +58,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/sqs v1.31.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 // indirect github.com/aws/smithy-go v1.20.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd v0.24.0 // indirect @@ -120,7 +122,7 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/redis/go-redis/v9 v9.5.1 // indirect github.com/segmentio/asm v1.2.0 // indirect - github.com/sergi/go-diff v1.3.1 // indirect + github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect github.com/spf13/cast v1.6.0 // indirect diff --git a/go.sum b/go.sum index 0f6d1cc6..00a18bef 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,10 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/0xsequence/ethkit v1.24.12 h1:Pr45Fo5t6JJovmHlHVsgR9Smd+fuhmC4HPbNANSAe3Y= -github.com/0xsequence/ethkit v1.24.12/go.mod h1:E3eymNtV0oJabgqM9R92xTQYOsT7rVHxFRju8A2CFJw= +github.com/0xsequence/ethkit v1.25.0 h1:auXjpJrpIckfzQ5jgVAD6GECLpFSViZWsJtz1F3EAJg= +github.com/0xsequence/ethkit v1.25.0/go.mod h1:E3eymNtV0oJabgqM9R92xTQYOsT7rVHxFRju8A2CFJw= github.com/0xsequence/go-ethauth v0.13.0 h1:ZaqFEEqy574A2b1P7vjpcy5tb4W/izn+A3swwOYi9wA= github.com/0xsequence/go-ethauth v0.13.0/go.mod h1:f3kx39S9F+W+qvZEB6bkKKbpUstmyB7goUntO3wvlhg= -github.com/0xsequence/go-sequence v0.32.1 h1:JtArHYj+dlcNySsNmpIxoV4RDMrPQxD9xXxiz2gX+Dk= -github.com/0xsequence/go-sequence v0.32.1/go.mod h1:/2P2A1W54tBXFY3D3aam/D9DHeFTWtqeJhgCxEkKfKM= +github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e h1:Lo/jJN5p69ockVAQVxfHSm3bDCYaWmgoBwZ8zStxv5g= +github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e/go.mod h1:7VGqBMoOGI43fzr3NDCMYxkXoz+qwdnnR3ocz4fHWjM= github.com/0xsequence/nitrocontrol v0.3.0 h1:D0/gX576zQhitrJnBfBrOFFufEOzh6f2jO/+2ynwIUA= github.com/0xsequence/nitrocontrol v0.3.0/go.mod h1:sTG5akVPzoVr3unv/7h9aZGaT+BVGmvUMOdwXFeIEEA= github.com/0xsequence/nsm v0.1.0 h1:gVOViRWPUW/c5VEmGy2gCw1az/nqP3gY7VD9V2+069k= @@ -34,8 +34,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= -github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= +github.com/aws/aws-sdk-go-v2 v1.27.0 h1:7bZWKoXhzI+mMR/HjdMx8ZCC5+6fY0lS5tr0bbgiLlo= +github.com/aws/aws-sdk-go-v2 v1.27.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.27.4 h1:AhfWb5ZwimdsYTgP7Od8E9L1u4sKmDW2ZVeLcf2O42M= github.com/aws/aws-sdk-go-v2/config v1.27.4/go.mod h1:zq2FFXK3A416kiukwpsd+rD4ny6JC7QSkp4QdN1Mp2g= github.com/aws/aws-sdk-go-v2/credentials v1.17.4 h1:h5Vztbd8qLppiPwX+y0Q6WiwMZgpd9keKe2EAENgAuI= @@ -44,10 +44,10 @@ github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.13.6 h1:fKkSKZFq github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.13.6/go.mod h1:+/MkJPCE/m0lNlYKVyKG79YFM2IF/n2gM43llt34xXQ= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 h1:AK0J8iYBFeUk2Ax7O8YpLtFsfhdOByh2QIkHmigpRYk= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2/go.mod h1:iRlGzMix0SExQEviAyptRWRGdYNo3+ufW/lCzvKVTUc= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 h1:lf/8VTF2cM+N4SLzaYJERKEWAXq8MOMpZfU6wEPWsPk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7/go.mod h1:4SjkU7QiqK2M9oozyMzfZ/23LmUY+h3oFqhdeP5OMiI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 h1:4OYVp0705xu8yjdyoWix0r9wPIRXnIzzOoUpQVHIJ/g= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7/go.mod h1:vd7ESTEvI76T2Na050gODNmNU7+OyKrIKroYTu4ABiI= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.1 h1:dZXY07Dm59TxAjJcUfNMJHLDI/gLMxTRZefn2jFAVsw= @@ -62,6 +62,10 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 h1:5ffmXjPtw github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2/go.mod h1:Ru7vg1iQ7cR4i7SZ/JTLYN9kaXtbL69UdgG0OQWQxW0= github.com/aws/aws-sdk-go-v2/service/kms v1.29.1 h1:OdjJjUWFlMZLAMl54ASxIpZdGEesY4BH3/c0HAPSFdI= github.com/aws/aws-sdk-go-v2/service/kms v1.29.1/go.mod h1:Cbx2uxEX0bAB7SlSY+ys05ZBkEb8IbmuAOcGVmDfJFs= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.29.1 h1:NSWsFzdHN41mJ5I/DOFzxgkKSYNHQADHn7Mu+lU/AKw= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.29.1/go.mod h1:5mMk0DgUgaHlcqtN65fNyZI0ZDX3i9Cw+nwq75HKB3U= +github.com/aws/aws-sdk-go-v2/service/ses v1.22.9 h1:PCKzjZiusiIDUkbc3vXq1KsHleIYxfUEtSqO+TpWQU4= +github.com/aws/aws-sdk-go-v2/service/ses v1.22.9/go.mod h1:qPKQ6sRnlNj8HrPbMdEVMNNX9nxyNGQMII63JAUtiuw= github.com/aws/aws-sdk-go-v2/service/sqs v1.31.4 h1:mE2ysZMEeQ3ulHWs4mmc4fZEhOfeY1o6QXAfDqjbSgw= github.com/aws/aws-sdk-go-v2/service/sqs v1.31.4/go.mod h1:lCN2yKnj+Sp9F6UzpoPPTir+tSaC9Jwf6LcmTqnXFZw= github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 h1:utEGkfdQ4L6YW/ietH7111ZYglLJvS+sLriHJ1NBJEQ= @@ -384,8 +388,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= @@ -443,8 +447,8 @@ github.com/webrpc/gen-openapi v0.13.0 h1:+FrIyqdCBkjCbUBD3HJ6mVERJL2mPrhuIsW31BM github.com/webrpc/gen-openapi v0.13.0/go.mod h1:fwY3ylZmdiCr+WXjR8Ek8wm08CFRr2/GaXI7Zd/Ou4Y= github.com/webrpc/gen-typescript v0.13.0 h1:QgmGmm+OuKZAIDr8Qg/fNLzFem5aUUkH9z+k3OKkf3o= github.com/webrpc/gen-typescript v0.13.0/go.mod h1:xQzYnVaSMfcygDXA5SuW8eYyCLHBHkj15wCF7gcJF5Y= -github.com/webrpc/webrpc v0.18.6 h1:tGEKIIMKhSk06DSNKjxiqOFAahwrdUQ0ch0dfTjk3Ys= -github.com/webrpc/webrpc v0.18.6/go.mod h1:B9f1FJKatWz34GpEL0a5FU856K0N13BqQU53ITmM8YU= +github.com/webrpc/webrpc v0.18.7 h1:bRUYbLVyPbba0LjGZ8mYORuCoa4O/gRd/OQwQ5SA2U0= +github.com/webrpc/webrpc v0.18.7/go.mod h1:jhX8vP9Fgy9g98OgLCuuARL0KHUHPm4p9iOOO0rOBGM= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= diff --git a/vendor/github.com/0xsequence/ethkit/ethrpc/ethrpc.go b/vendor/github.com/0xsequence/ethkit/ethrpc/ethrpc.go index 83f8efa3..60a6c7fc 100644 --- a/vendor/github.com/0xsequence/ethkit/ethrpc/ethrpc.go +++ b/vendor/github.com/0xsequence/ethkit/ethrpc/ethrpc.go @@ -255,6 +255,26 @@ func (p *Provider) HeaderByNumber(ctx context.Context, blockNum *big.Int) (*type return head, err } +func (p *Provider) HeadersByNumbers(ctx context.Context, blockNumbers []*big.Int) ([]*types.Header, error) { + var headers = make([]*types.Header, len(blockNumbers)) + + var calls []Call + for index, blockNum := range blockNumbers { + calls = append(calls, HeaderByNumber(blockNum).Into(&headers[index])) + } + + _, err := p.Do(ctx, calls...) + return headers, err +} + +func (p *Provider) HeadersByNumberRange(ctx context.Context, fromBlockNumber, toBlockNumber *big.Int) ([]*types.Header, error) { + var blockNumbers []*big.Int + for i := big.NewInt(0).Set(fromBlockNumber); i.Cmp(toBlockNumber) < 0; i.Add(i, big.NewInt(1)) { + blockNumbers = append(blockNumbers, big.NewInt(0).Set(i)) + } + return p.HeadersByNumbers(ctx, blockNumbers) +} + func (p *Provider) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, pending bool, err error) { _, err = p.Do(ctx, TransactionByHash(hash).Into(&tx, &pending)) if err == nil && tx == nil { diff --git a/vendor/github.com/0xsequence/ethkit/ethrpc/interface.go b/vendor/github.com/0xsequence/ethkit/ethrpc/interface.go index d8dc3461..3b27159c 100644 --- a/vendor/github.com/0xsequence/ethkit/ethrpc/interface.go +++ b/vendor/github.com/0xsequence/ethkit/ethrpc/interface.go @@ -89,6 +89,12 @@ type Interface interface { // HeaderByNumber = eth_getBlockByHash (true) HeaderByNumber(ctx context.Context, blockNum *big.Int) (*types.Header, error) + // HeadersByNumbers = batch of eth_getHeaderByNumber + HeadersByNumbers(ctx context.Context, blockNumbers []*big.Int) ([]*types.Header, error) + + // HeadersByNumberRange = batch of eth_getHeaderByNumber + HeadersByNumberRange(ctx context.Context, fromBlockNumber, toBlockNumber *big.Int) ([]*types.Header, error) + // TransactionByHash = eth_getTransactionByHash TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, pending bool, err error) diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go b/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go index bd40aefa..0d1529ad 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go @@ -1,6 +1,6 @@ -// sequence-waas-intents v0.1.0 7ab7a9ad425b7f572331c5b85eda53436264c646 +// sequence-waas-intents v0.1.0 fb35a368ac7c24fd83ba22f4ce7c57b9575d4d19 // -- -// Code generated by webrpc-gen@v0.18.6 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.18.7 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=intent.ridl -target=golang -pkg=intents -client -out=./intent.gen.go package intents @@ -25,7 +25,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "7ab7a9ad425b7f572331c5b85eda53436264c646" + return "fb35a368ac7c24fd83ba22f4ce7c57b9575d4d19" } // @@ -35,6 +35,7 @@ func WebRPCSchemaHash() string { type IntentName string const ( + IntentName_initiateAuth IntentName = "initiateAuth" IntentName_openSession IntentName = "openSession" IntentName_closeSession IntentName = "closeSession" IntentName_validateSession IntentName = "validateSession" @@ -49,6 +50,7 @@ const ( IntentName_federateAccount IntentName = "federateAccount" IntentName_removeAccount IntentName = "removeAccount" IntentName_listAccounts IntentName = "listAccounts" + IntentName_getIdToken IntentName = "getIdToken" ) func (x IntentName) MarshalText() ([]byte, error) { @@ -106,6 +108,7 @@ func (x *TransactionType) Is(values ...TransactionType) bool { type IntentResponseCode string const ( + IntentResponseCode_authInitiated IntentResponseCode = "authInitiated" IntentResponseCode_sessionOpened IntentResponseCode = "sessionOpened" IntentResponseCode_sessionClosed IntentResponseCode = "sessionClosed" IntentResponseCode_sessionList IntentResponseCode = "sessionList" @@ -121,6 +124,7 @@ const ( IntentResponseCode_accountList IntentResponseCode = "accountList" IntentResponseCode_accountFederated IntentResponseCode = "accountFederated" IntentResponseCode_accountRemoved IntentResponseCode = "accountRemoved" + IntentResponseCode_idToken IntentResponseCode = "idToken" ) func (x IntentResponseCode) MarshalText() ([]byte, error) { @@ -195,6 +199,7 @@ const ( IdentityType_None IdentityType = "None" IdentityType_Guest IdentityType = "Guest" IdentityType_OIDC IdentityType = "OIDC" + IdentityType_Email IdentityType = "Email" ) func (x IdentityType) MarshalText() ([]byte, error) { @@ -232,11 +237,23 @@ type Signature struct { Signature string `json:"signature"` } +type IntentDataInitiateAuth struct { + SessionID string `json:"sessionId"` + IdentityType IdentityType `json:"identityType"` + Verifier string `json:"verifier"` + Metadata *string `json:"metadata,omitempty"` +} + type IntentDataOpenSession struct { - SessionID string `json:"sessionId"` - Email *string `json:"email,omitempty"` - IdToken *string `json:"idToken,omitempty"` - ForceCreateAccount bool `json:"forceCreateAccount,omitempty"` + SessionID string `json:"sessionId"` + IdentityType IdentityType `json:"identityType,omitempty"` + Verifier string `json:"verifier,omitempty"` + Answer string `json:"answer,omitempty"` + ForceCreateAccount bool `json:"forceCreateAccount,omitempty"` + // Deprecated + Email *string `json:"email,omitempty"` + // Deprecated + IdToken *string `json:"idToken,omitempty"` } type IntentDataCloseSession struct { @@ -301,9 +318,11 @@ type IntentDataGetTransactionReceipt struct { } type IntentDataFederateAccount struct { - SessionID string `json:"sessionId"` - Wallet string `json:"wallet"` - IdToken string `json:"idToken,omitempty"` + SessionID string `json:"sessionId"` + Wallet string `json:"wallet"` + IdentityType IdentityType `json:"identityType"` + Verifier string `json:"verifier,omitempty"` + Answer string `json:"answer,omitempty"` } type IntentDataListAccounts struct { @@ -315,6 +334,12 @@ type IntentDataRemoveAccount struct { AccountID string `json:"accountId"` } +type IntentDataGetIdToken struct { + SessionID string `json:"sessionId"` + Wallet string `json:"wallet"` + Nonce string `json:"nonce"` +} + type TransactionRaw struct { Type string `json:"type"` To string `json:"to"` @@ -363,6 +388,13 @@ type IntentResponse struct { Data interface{} `json:"data"` } +type IntentResponseAuthInitiated struct { + SessionID string `json:"sessionId"` + IdentityType IdentityType `json:"identityType"` + ExpiresIn int `json:"expiresIn"` + Challenge *string `json:"challenge"` +} + type IntentResponseSessionOpened struct { SessionID string `json:"sessionId"` Wallet string `json:"wallet"` @@ -459,10 +491,15 @@ type IntentResponseAccountFederated struct { type IntentResponseAccountRemoved struct { } +type IntentResponseIdToken struct { + IdToken string `json:"idToken"` + ExpiresIn int `json:"expiresIn"` +} + type Account struct { ID string `json:"id"` Type IdentityType `json:"type"` - Issuer string `json:"issuer"` + Issuer *string `json:"issuer,omitempty"` Email *string `json:"email,omitempty"` } diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.ts b/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.ts index 21304c44..3fe79282 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.ts +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -// sequence-waas-intents v0.1.0 7ab7a9ad425b7f572331c5b85eda53436264c646 +// sequence-waas-intents v0.1.0 fb35a368ac7c24fd83ba22f4ce7c57b9575d4d19 // -- -// Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.18.7 with typescript generator. DO NOT EDIT. // // webrpc-gen -schema=intent.ridl -target=typescript -client -out=./intent.gen.ts @@ -12,7 +12,7 @@ export const WebRPCVersion = "v1" export const WebRPCSchemaVersion = "v0.1.0" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = "7ab7a9ad425b7f572331c5b85eda53436264c646" +export const WebRPCSchemaHash = "fb35a368ac7c24fd83ba22f4ce7c57b9575d4d19" // // Types @@ -20,6 +20,7 @@ export const WebRPCSchemaHash = "7ab7a9ad425b7f572331c5b85eda53436264c646" export enum IntentName { + initiateAuth = 'initiateAuth', openSession = 'openSession', closeSession = 'closeSession', validateSession = 'validateSession', @@ -33,7 +34,8 @@ export enum IntentName { getTransactionReceipt = 'getTransactionReceipt', federateAccount = 'federateAccount', removeAccount = 'removeAccount', - listAccounts = 'listAccounts' + listAccounts = 'listAccounts', + getIdToken = 'getIdToken' } export enum TransactionType { @@ -45,6 +47,7 @@ export enum TransactionType { } export enum IntentResponseCode { + authInitiated = 'authInitiated', sessionOpened = 'sessionOpened', sessionClosed = 'sessionClosed', sessionList = 'sessionList', @@ -59,7 +62,8 @@ export enum IntentResponseCode { getSessionResponse = 'getSessionResponse', accountList = 'accountList', accountFederated = 'accountFederated', - accountRemoved = 'accountRemoved' + accountRemoved = 'accountRemoved', + idToken = 'idToken' } export enum FeeTokenType { @@ -71,7 +75,8 @@ export enum FeeTokenType { export enum IdentityType { None = 'None', Guest = 'Guest', - OIDC = 'OIDC' + OIDC = 'OIDC', + Email = 'Email' } export interface Intent { @@ -88,11 +93,21 @@ export interface Signature { signature: string } +export interface IntentDataInitiateAuth { + sessionId: string + identityType: IdentityType + verifier: string + metadata?: string +} + export interface IntentDataOpenSession { sessionId: string + identityType: IdentityType + verifier?: string + answer?: string + forceCreateAccount?: boolean email?: string idToken?: string - forceCreateAccount?: boolean } export interface IntentDataCloseSession { @@ -157,7 +172,9 @@ export interface IntentDataGetTransactionReceipt { export interface IntentDataFederateAccount { sessionId: string wallet: string - idToken: string + identityType: IdentityType + verifier?: string + answer?: string } export interface IntentDataListAccounts { @@ -169,6 +186,12 @@ export interface IntentDataRemoveAccount { accountId: string } +export interface IntentDataGetIdToken { + sessionId: string + wallet: string + nonce?: string +} + export interface TransactionRaw { type: string to: string @@ -217,6 +240,13 @@ export interface IntentResponse { data: any } +export interface IntentResponseAuthInitiated { + sessionId: string + identityType: IdentityType + expiresIn: number + challenge?: string +} + export interface IntentResponseSessionOpened { sessionId: string wallet: string @@ -312,10 +342,15 @@ export interface IntentResponseAccountFederated { export interface IntentResponseAccountRemoved { } +export interface IntentResponseIdToken { + idToken: string + expiresIn: number +} + export interface Account { id: string type: IdentityType - issuer: string + issuer?: string email?: string } diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl b/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl index 52dcb91c..0728ecc6 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl @@ -17,7 +17,8 @@ struct Signature + go.field.name = SessionID - signature: string - enum IntentName: string +enum IntentName: string + - initiateAuth - openSession - closeSession - validateSession @@ -32,17 +33,37 @@ struct Signature - federateAccount - removeAccount - listAccounts + - getIdToken + +struct IntentDataInitiateAuth + - sessionId: string + + go.field.name = SessionID + - identityType: IdentityType + - verifier: string + - metadata?: string + + go.tag.json = metadata,omitempty struct IntentDataOpenSession - sessionId: string + go.field.name = SessionID + - identityType: IdentityType + + go.field.type = IdentityType + + go.tag.json = identityType,omitempty + - verifier?: string + + go.field.type = string + + go.tag.json = verifier,omitempty + - answer?: string + + go.field.type = string + + go.tag.json = answer,omitempty + - forceCreateAccount?: bool + + go.field.type = bool + + go.tag.json = forceCreateAccount,omitempty + # Deprecated - email?: string + go.tag.json = email,omitempty + # Deprecated - idToken?: string + go.tag.json = idToken,omitempty - - forceCreateAccount?: bool - + go.field.type = bool - + go.tag.json = forceCreateAccount,omitempty struct IntentDataCloseSession - sessionId: string @@ -104,8 +125,13 @@ struct IntentDataFederateAccount - sessionId: string + go.field.name = SessionID - wallet: string - - idToken: string - + go.tag.json = idToken,omitempty + - identityType: IdentityType + - verifier?: string + + go.field.type = string + + go.tag.json = verifier,omitempty + - answer?: string + + go.field.type = string + + go.tag.json = answer,omitempty struct IntentDataListAccounts - wallet: string @@ -115,6 +141,13 @@ struct IntentDataRemoveAccount - accountId: string + go.field.name = AccountID +struct IntentDataGetIdToken + - sessionId: string + + go.field.name = SessionID + - wallet: string + - nonce?: string + + go.field.type = string + struct TransactionRaw - type: string - to: string @@ -166,6 +199,7 @@ struct IntentResponse - data: any enum IntentResponseCode: string + - authInitiated - sessionOpened - sessionClosed - sessionList @@ -181,6 +215,14 @@ enum IntentResponseCode: string - accountList - accountFederated - accountRemoved + - idToken + +struct IntentResponseAuthInitiated + - sessionId: string + + go.field.name = SessionID + - identityType: IdentityType + - expiresIn: int + - challenge?: string struct IntentResponseSessionOpened - sessionId: string @@ -270,16 +312,22 @@ struct IntentResponseAccountFederated struct IntentResponseAccountRemoved +struct IntentResponseIdToken + - idToken: string + - expiresIn: int + enum IdentityType: string - None - Guest - OIDC + - Email struct Account - id: string + go.field.name = ID - type: IdentityType + go.field.type = IdentityType - - issuer: string + - issuer?: string + + go.tag.json = issuer,omitempty - email?: string + go.tag.json = email,omitempty diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent_data_ext.go b/vendor/github.com/0xsequence/go-sequence/intents/intent_data_ext.go index 3475361b..02f892e7 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent_data_ext.go +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent_data_ext.go @@ -11,9 +11,6 @@ func (id *IntentDataOpenSession) IsValid() error { return fmt.Errorf("session id is empty") } - if id.IdToken == nil && id.Email == nil { - return fmt.Errorf("idToken and email are both nil") - } return nil } diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent_response_typed.go b/vendor/github.com/0xsequence/go-sequence/intents/intent_response_typed.go index 1a4e3781..4afe24d5 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent_response_typed.go +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent_response_typed.go @@ -8,6 +8,8 @@ import ( func IntentResponseTypeToCode[T any](t *T) IntentResponseCode { var data any = t switch data.(type) { + case *IntentResponseAuthInitiated: + return IntentResponseCode_authInitiated case *IntentResponseSessionOpened: return IntentResponseCode_sessionOpened case *IntentResponseValidationStarted: @@ -32,6 +34,8 @@ func IntentResponseTypeToCode[T any](t *T) IntentResponseCode { return IntentResponseCode_accountFederated case *IntentResponseAccountRemoved: return IntentResponseCode_accountRemoved + case *IntentResponseIdToken: + return IntentResponseCode_idToken default: return "" } diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent_typed.go b/vendor/github.com/0xsequence/go-sequence/intents/intent_typed.go index 51cea854..6fc89d5b 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent_typed.go +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent_typed.go @@ -9,6 +9,8 @@ import ( func IntentDataTypeToName[T any](t *T) IntentName { var data any = t switch data.(type) { + case *IntentDataInitiateAuth: + return IntentName_initiateAuth case *IntentDataOpenSession: return IntentName_openSession case *IntentDataCloseSession: @@ -37,6 +39,8 @@ func IntentDataTypeToName[T any](t *T) IntentName { return IntentName_federateAccount case *IntentDataRemoveAccount: return IntentName_removeAccount + case *IntentDataGetIdToken: + return IntentName_getIdToken default: return "" } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index 639ba763..e648346b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.26.1" +const goModuleVersion = "1.27.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go index b0133f4c..19d6107c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go @@ -112,6 +112,8 @@ type MetricData struct { ResolveEndpointStartTime time.Time ResolveEndpointEndTime time.Time EndpointResolutionDuration time.Duration + GetIdentityStartTime time.Time + GetIdentityEndTime time.Time InThroughput float64 OutThroughput float64 RetryCount int @@ -122,6 +124,7 @@ type MetricData struct { OperationName string PartitionID string Region string + UserAgent string RequestContentLength int64 Stream StreamMetrics Attempts []AttemptMetrics @@ -144,8 +147,6 @@ type AttemptMetrics struct { ConnRequestedTime time.Time ConnObtainedTime time.Time ConcurrencyAcquireDuration time.Duration - CredentialFetchStartTime time.Time - CredentialFetchEndTime time.Time SignStartTime time.Time SignEndTime time.Time SigningDuration time.Duration diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go index febeb048..a9db6433 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go @@ -11,7 +11,6 @@ import ( "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/middleware/private/metrics" v4Internal "github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" "github.com/aws/aws-sdk-go-v2/internal/sdk" @@ -301,22 +300,7 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl return out, metadata, &SigningError{Err: fmt.Errorf("computed payload hash missing from context")} } - mctx := metrics.Context(ctx) - - if mctx != nil { - if attempt, err := mctx.Data().LatestAttempt(); err == nil { - attempt.CredentialFetchStartTime = sdk.NowTime() - } - } - credentials, err := s.credentialsProvider.Retrieve(ctx) - - if mctx != nil { - if attempt, err := mctx.Data().LatestAttempt(); err == nil { - attempt.CredentialFetchEndTime = sdk.NowTime() - } - } - if err != nil { return out, metadata, &SigningError{Err: fmt.Errorf("failed to retrieve credentials: %w", err)} } @@ -337,20 +321,7 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl }) } - if mctx != nil { - if attempt, err := mctx.Data().LatestAttempt(); err == nil { - attempt.SignStartTime = sdk.NowTime() - } - } - err = s.signer.SignHTTP(ctx, credentials, req.Request, payloadHash, signingName, signingRegion, sdk.NowTime(), signerOptions...) - - if mctx != nil { - if attempt, err := mctx.Data().LatestAttempt(); err == nil { - attempt.SignEndTime = sdk.NowTime() - } - } - if err != nil { return out, metadata, &SigningError{Err: fmt.Errorf("failed to sign http request, %w", err)} } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go index bb61904e..55dfd07b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go @@ -1,48 +1,41 @@ -// Package v4 implements signing for AWS V4 signer +// Package v4 implements the AWS signature version 4 algorithm (commonly known +// as SigV4). // -// Provides request signing for request that need to be signed with -// AWS V4 Signatures. +// For more information about SigV4, see [Signing AWS API requests] in the IAM +// user guide. // -// # Standalone Signer +// While this implementation CAN work in an external context, it is developed +// primarily for SDK use and you may encounter fringe behaviors around header +// canonicalization. // -// Generally using the signer outside of the SDK should not require any additional +// # Pre-escaping a request URI // -// The signer does this by taking advantage of the URL.EscapedPath method. If your request URI requires +// AWS v4 signature validation requires that the canonical string's URI path +// component must be the escaped form of the HTTP request's path. +// +// The Go HTTP client will perform escaping automatically on the HTTP request. +// This may cause signature validation errors because the request differs from +// the URI path or query from which the signature was generated. // -// additional escaping you many need to use the URL.Opaque to define what the raw URI should be sent -// to the service as. +// Because of this, we recommend that you explicitly escape the request when +// using this signer outside of the SDK to prevent possible signature mismatch. +// This can be done by setting URL.Opaque on the request. The signer will +// prefer that value, falling back to the return of URL.EscapedPath if unset. // -// The signer will first check the URL.Opaque field, and use its value if set. -// The signer does require the URL.Opaque field to be set in the form of: +// When setting URL.Opaque you must do so in the form of: // // "///" // // // e.g. // "//example.com/some/path" // -// The leading "//" and hostname are required or the URL.Opaque escaping will -// not work correctly. -// -// If URL.Opaque is not set the signer will fallback to the URL.EscapedPath() -// method and using the returned value. -// -// AWS v4 signature validation requires that the canonical string's URI path -// element must be the URI escaped form of the HTTP request's path. -// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html -// -// The Go HTTP client will perform escaping automatically on the request. Some -// of these escaping may cause signature validation errors because the HTTP -// request differs from the URI path or query that the signature was generated. -// https://golang.org/pkg/net/url/#URL.EscapedPath +// The leading "//" and hostname are required or the escaping will not work +// correctly. // -// Because of this, it is recommended that when using the signer outside of the -// SDK that explicitly escaping the request prior to being signed is preferable, -// and will help prevent signature validation errors. This can be done by setting -// the URL.Opaque or URL.RawPath. The SDK will use URL.Opaque first and then -// call URL.EscapedPath() if Opaque is not set. +// The TestStandaloneSign unit test provides a complete example of using the +// signer outside of the SDK and pre-escaping the URI path. // -// Test `TestStandaloneSign` provides a complete example of using the signer -// outside of the SDK and pre-escaping the URI path. +// [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html package v4 import ( diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index 72e196dd..e5ab2766 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.3.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.3.5 (2024-03-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index faf71cac..67cbc376 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.3.5" +const goModuleVersion = "1.3.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index 6f6dafa8..5ff8fef9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,3 +1,11 @@ +# v2.6.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v2.6.5 (2024-03-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index 27981631..cc9b7807 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.6.5" +const goModuleVersion = "2.6.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md new file mode 100644 index 00000000..a05d1fc9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md @@ -0,0 +1,510 @@ +# v1.29.1 (2024-05-23) + +* No change notes available for this release. + +# v1.29.0 (2024-05-20) + +* **Feature**: add v2 smoke tests and smithy smokeTests trait for SDK testing + +# v1.28.9 (2024-05-16) + +* **Documentation**: Documentation updates for AWS Secrets Manager +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.8 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.7 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.28.6 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.5 (2024-03-27) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.28.4 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.3 (2024-03-14) + +* **Documentation**: Doc only update for Secrets Manager + +# v1.28.2 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.1 (2024-02-23) + +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.27.3 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.2 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.27.1 (2024-02-15) + +* **Bug Fix**: Correct failure to determine the error type in awsJson services that could occur when errors were modeled with a non-string `code` field. +* **Documentation**: Doc only update for Secrets Manager + +# v1.27.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.2 (2024-01-11) + +* **Documentation**: Doc only update for Secrets Manager + +# v1.26.1 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2023-12-22) + +* **Feature**: Update endpoint rules and examples. + +# v1.25.6 (2023-12-20) + +* No change notes available for this release. + +# v1.25.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.25.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.25.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.2 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.1 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.24.0 (2023-11-27) + +* **Feature**: AWS Secrets Manager has released the BatchGetSecretValue API, which allows customers to fetch up to 20 Secrets with a single request using a list of secret names or filters. + +# v1.23.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.6 (2023-10-19) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.21.5 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.4 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.2 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-08-10) + +* **Feature**: Add additional InvalidRequestException to list of possible exceptions for ListSecret. + +# v1.20.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2023-08-01) + +* No change notes available for this release. + +# v1.20.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.12 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.11 (2023-07-13) + +* **Documentation**: Documentation updates for Secrets Manager +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.10 (2023-06-15) + +* No change notes available for this release. + +# v1.19.9 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.8 (2023-05-16) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.19.7 (2023-05-04) + +* No change notes available for this release. + +# v1.19.6 (2023-04-27) + +* No change notes available for this release. + +# v1.19.5 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.4 (2023-04-19) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.19.3 (2023-04-10) + +* No change notes available for this release. + +# v1.19.2 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-03-10) + +* **Feature**: The type definitions of SecretString and SecretBinary now have a minimum length of 1 in the model to match the exception thrown when you pass in empty values. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.7 (2023-03-02) + +* No change notes available for this release. + +# v1.18.6 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.18.5 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.4 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.18.3 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2023-01-23) + +* No change notes available for this release. + +# v1.18.1 (2023-01-12) + +* **Documentation**: Update documentation for new ListSecrets and DescribeSecret parameters + +# v1.18.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.17.0 (2022-12-29) + +* **Feature**: Added owning service filter, include planned deletion flag, and next rotation date response parameter in ListSecrets. + +# v1.16.11 (2022-12-22) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.16.10 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2022-11-22) + +* No change notes available for this release. + +# v1.16.7 (2022-11-17) + +* **Documentation**: Documentation updates for Secrets Manager. + +# v1.16.6 (2022-11-16) + +* No change notes available for this release. + +# v1.16.5 (2022-11-10) + +* No change notes available for this release. + +# v1.16.4 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2022-09-29) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.16.1 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2022-09-14) + +* **Feature**: Fixed a bug in the API client generation which caused some operation parameters to be incorrectly generated as value types instead of pointer types. The service API always required these affected parameters to be nilable. This fixes the SDK client to match the expectations of the the service API. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.22 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.21 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.20 (2022-08-30) + +* No change notes available for this release. + +# v1.15.19 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.18 (2022-08-17) + +* **Documentation**: Documentation updates for Secrets Manager. + +# v1.15.17 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.16 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.15 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.14 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.13 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.12 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.11 (2022-06-16) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.15.10 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.9 (2022-05-25) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.15.8 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.7 (2022-05-11) + +* **Documentation**: Doc only update for Secrets Manager that fixes several customer-reported issues. + +# v1.15.6 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.5 (2022-04-21) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.15.4 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2022-03-11) + +* **Documentation**: Documentation updates for Secrets Manager. + +# v1.15.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-01-07) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. +* **Documentation**: API client updated + +# v1.10.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. + +# v1.9.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-11) + +* **Feature**: API client updated +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-08-04) + +* **Feature**: Updated to latest API model. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go new file mode 100644 index 00000000..306c347d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go @@ -0,0 +1,553 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + cryptorand "crypto/rand" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "Secrets Manager" +const ServiceAPIVersion = "2017-10-17" + +// Client provides the API client to make operations call for AWS Secrets Manager. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveIdempotencyTokenProvider(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "secretsmanager", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_BatchGetSecretValue.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_BatchGetSecretValue.go new file mode 100644 index 00000000..6aaf0d80 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_BatchGetSecretValue.go @@ -0,0 +1,276 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the contents of the encrypted fields SecretString or SecretBinary for +// up to 20 secrets. To retrieve a single secret, call GetSecretValue. +// +// To choose which secrets to retrieve, you can specify a list of secrets by name +// or ARN, or you can use filters. If Secrets Manager encounters errors such as +// AccessDeniedException while attempting to retrieve any of the secrets, you can +// see the errors in Errors in the response. +// +// Secrets Manager generates CloudTrail GetSecretValue log entries for each secret +// you request when you call this action. Do not include sensitive information in +// request parameters because it might be logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:BatchGetSecretValue , and you must have +// secretsmanager:GetSecretValue for each secret. If you use filters, you must also +// have secretsmanager:ListSecrets . If the secrets are encrypted using +// customer-managed keys instead of the Amazon Web Services managed key +// aws/secretsmanager , then you also need kms:Decrypt permissions for the keys. +// For more information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) BatchGetSecretValue(ctx context.Context, params *BatchGetSecretValueInput, optFns ...func(*Options)) (*BatchGetSecretValueOutput, error) { + if params == nil { + params = &BatchGetSecretValueInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetSecretValue", params, optFns, c.addOperationBatchGetSecretValueMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetSecretValueOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetSecretValueInput struct { + + // The filters to choose which secrets to retrieve. You must include Filters or + // SecretIdList , but not both. + Filters []types.Filter + + // The number of results to include in the response. + // + // If there are more results available, in the response, Secrets Manager includes + // NextToken . To get the next results, call BatchGetSecretValue again with the + // value from NextToken . To use this parameter, you must also use the Filters + // parameter. + MaxResults *int32 + + // A token that indicates where the output should continue from, if a previous + // call did not show all results. To get the next results, call BatchGetSecretValue + // again with this value. + NextToken *string + + // The ARN or names of the secrets to retrieve. You must include Filters or + // SecretIdList , but not both. + SecretIdList []string + + noSmithyDocumentSerde +} + +type BatchGetSecretValueOutput struct { + + // A list of errors Secrets Manager encountered while attempting to retrieve + // individual secrets. + Errors []types.APIErrorType + + // Secrets Manager includes this value if there's more output available than what + // is included in the current response. This can occur even when the response + // includes no values at all, such as when you ask for a filtered view of a long + // list. To get the next results, call BatchGetSecretValue again with this value. + NextToken *string + + // A list of secret values. + SecretValues []types.SecretValueEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetSecretValue{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchGetSecretValue{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchGetSecretValue"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetSecretValue(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// BatchGetSecretValueAPIClient is a client that implements the +// BatchGetSecretValue operation. +type BatchGetSecretValueAPIClient interface { + BatchGetSecretValue(context.Context, *BatchGetSecretValueInput, ...func(*Options)) (*BatchGetSecretValueOutput, error) +} + +var _ BatchGetSecretValueAPIClient = (*Client)(nil) + +// BatchGetSecretValuePaginatorOptions is the paginator options for +// BatchGetSecretValue +type BatchGetSecretValuePaginatorOptions struct { + // The number of results to include in the response. + // + // If there are more results available, in the response, Secrets Manager includes + // NextToken . To get the next results, call BatchGetSecretValue again with the + // value from NextToken . To use this parameter, you must also use the Filters + // parameter. + 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 +} + +// BatchGetSecretValuePaginator is a paginator for BatchGetSecretValue +type BatchGetSecretValuePaginator struct { + options BatchGetSecretValuePaginatorOptions + client BatchGetSecretValueAPIClient + params *BatchGetSecretValueInput + nextToken *string + firstPage bool +} + +// NewBatchGetSecretValuePaginator returns a new BatchGetSecretValuePaginator +func NewBatchGetSecretValuePaginator(client BatchGetSecretValueAPIClient, params *BatchGetSecretValueInput, optFns ...func(*BatchGetSecretValuePaginatorOptions)) *BatchGetSecretValuePaginator { + if params == nil { + params = &BatchGetSecretValueInput{} + } + + options := BatchGetSecretValuePaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &BatchGetSecretValuePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *BatchGetSecretValuePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next BatchGetSecretValue page. +func (p *BatchGetSecretValuePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*BatchGetSecretValueOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.BatchGetSecretValue(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_opBatchGetSecretValue(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchGetSecretValue", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go new file mode 100644 index 00000000..42ce02ce --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go @@ -0,0 +1,173 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Turns off automatic rotation, and if a rotation is currently in progress, +// cancels the rotation. +// +// If you cancel a rotation in progress, it can leave the VersionStage labels in +// an unexpected state. You might need to remove the staging label AWSPENDING from +// the partially created version. You also need to determine whether to roll back +// to the previous version of the secret by moving the staging label AWSCURRENT to +// the version that has AWSPENDING . To determine which version has a specific +// staging label, call ListSecretVersionIds. Then use UpdateSecretVersionStage to change staging labels. For more information, +// see [How rotation works]. +// +// To turn on automatic rotation again, call RotateSecret. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:CancelRotateSecret . For more information, +// see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [How rotation works]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) CancelRotateSecret(ctx context.Context, params *CancelRotateSecretInput, optFns ...func(*Options)) (*CancelRotateSecretOutput, error) { + if params == nil { + params = &CancelRotateSecretInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelRotateSecret", params, optFns, c.addOperationCancelRotateSecretMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelRotateSecretOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelRotateSecretInput struct { + + // The ARN or name of the secret. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type CancelRotateSecretOutput struct { + + // The ARN of the secret. + ARN *string + + // The name of the secret. + Name *string + + // The unique identifier of the version of the secret created during the rotation. + // This version might not be complete, and should be evaluated for possible + // deletion. We recommend that you remove the VersionStage value AWSPENDING from + // this version so that Secrets Manager can delete it. Failing to clean up a + // cancelled rotation can block you from starting future rotations. + VersionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCancelRotateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelRotateSecret{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelRotateSecret{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelRotateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCancelRotateSecretValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelRotateSecret(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCancelRotateSecret(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CancelRotateSecret", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go new file mode 100644 index 00000000..b25d5d17 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go @@ -0,0 +1,356 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new secret. A secret can be a password, a set of credentials such as +// a user name and password, an OAuth token, or other secret information that you +// store in an encrypted form in Secrets Manager. The secret also includes the +// connection information to access a database or other service, which Secrets +// Manager doesn't encrypt. A secret in Secrets Manager consists of both the +// protected secret data and the important information needed to manage the secret. +// +// For secrets that use managed rotation, you need to create the secret through +// the managing service. For more information, see [Secrets Manager secrets managed by other Amazon Web Services services]. +// +// For information about creating a secret in the console, see [Create a secret]. +// +// To create a secret, you can provide the secret value to be encrypted in either +// the SecretString parameter or the SecretBinary parameter, but not both. If you +// include SecretString or SecretBinary then Secrets Manager creates an initial +// secret version and automatically attaches the staging label AWSCURRENT to it. +// +// For database credentials you want to rotate, for Secrets Manager to be able to +// rotate the secret, you must make sure the JSON you store in the SecretString +// matches the [JSON structure of a database secret]. +// +// If you don't specify an KMS encryption key, Secrets Manager uses the Amazon Web +// Services managed key aws/secretsmanager . If this key doesn't already exist in +// your account, then Secrets Manager creates it for you automatically. All users +// and roles in the Amazon Web Services account automatically have access to use +// aws/secretsmanager . Creating aws/secretsmanager can result in a one-time +// significant delay in returning the result. +// +// If the secret is in a different Amazon Web Services account from the +// credentials calling the API, then you can't use aws/secretsmanager to encrypt +// the secret, and you must create and use a customer managed KMS key. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters except SecretBinary or +// SecretString because it might be logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:CreateSecret . If you include tags in the +// secret, you also need secretsmanager:TagResource . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// To encrypt the secret with a KMS key other than aws/secretsmanager , you need +// kms:GenerateDataKey and kms:Decrypt permission to the key. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Secrets Manager secrets managed by other Amazon Web Services services]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html +// [Create a secret]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +// [JSON structure of a database secret]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_secret_json_structure.html +func (c *Client) CreateSecret(ctx context.Context, params *CreateSecretInput, optFns ...func(*Options)) (*CreateSecretOutput, error) { + if params == nil { + params = &CreateSecretInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSecret", params, optFns, c.addOperationCreateSecretMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSecretOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSecretInput struct { + + // The name of the new secret. + // + // The secret name can contain ASCII letters, numbers, and the following + // characters: /_+=.@- + // + // Do not end your secret name with a hyphen followed by six characters. If you do + // so, you risk confusion and unexpected results when searching for a secret by + // partial ARN. Secrets Manager automatically adds a hyphen and six random + // characters after the secret name at the end of the ARN. + // + // This member is required. + Name *string + + // A list of Regions and KMS keys to replicate secrets. + AddReplicaRegions []types.ReplicaRegionType + + // If you include SecretString or SecretBinary , then Secrets Manager creates an + // initial version for the secret, and this parameter specifies the unique + // identifier for the new version. + // + // If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs + // to call this operation, then you can leave this parameter empty. The CLI or SDK + // generates a random UUID for you and includes it as the value for this parameter + // in the request. + // + // If you generate a raw HTTP request to the Secrets Manager service endpoint, + // then you must generate a ClientRequestToken and include it in the request. + // + // This value helps ensure idempotency. Secrets Manager uses this value to prevent + // the accidental creation of duplicate versions if there are failures and retries + // during a rotation. We recommend that you generate a [UUID-type]value to ensure uniqueness + // of your versions within the specified secret. + // + // - If the ClientRequestToken value isn't already associated with a version of + // the secret then a new version of the secret is created. + // + // - If a version with this value already exists and the version SecretString and + // SecretBinary values are the same as those in the request, then the request is + // ignored. + // + // - If a version with this value already exists and that version's SecretString + // and SecretBinary values are different from those in the request, then the + // request fails because you cannot modify an existing version. Instead, use PutSecretValueto + // create a new version. + // + // This value becomes the VersionId of the new version. + // + // [UUID-type]: https://wikipedia.org/wiki/Universally_unique_identifier + ClientRequestToken *string + + // The description of the secret. + Description *string + + // Specifies whether to overwrite a secret with the same name in the destination + // Region. By default, secrets aren't overwritten. + ForceOverwriteReplicaSecret bool + + // The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt + // the secret value in the secret. An alias is always prefixed by alias/ , for + // example alias/aws/secretsmanager . For more information, see [About aliases]. + // + // To use a KMS key in a different account, use the key ARN or the alias ARN. + // + // If you don't specify this value, then Secrets Manager uses the key + // aws/secretsmanager . If that key doesn't yet exist, then Secrets Manager creates + // it for you automatically the first time it encrypts the secret value. + // + // If the secret is in a different Amazon Web Services account from the + // credentials calling the API, then you can't use aws/secretsmanager to encrypt + // the secret, and you must create and use a customer managed KMS key. + // + // [About aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html + KmsKeyId *string + + // The binary data to encrypt and store in the new version of the secret. We + // recommend that you store your binary data in a file and then pass the contents + // of the file as a parameter. + // + // Either SecretString or SecretBinary must have a value, but not both. + // + // This parameter is not available in the Secrets Manager console. + SecretBinary []byte + + // The text data to encrypt and store in this new version of the secret. We + // recommend you use a JSON structure of key/value pairs for your secret value. + // + // Either SecretString or SecretBinary must have a value, but not both. + // + // If you create a secret by using the Secrets Manager console then Secrets + // Manager puts the protected secret text in only the SecretString parameter. The + // Secrets Manager console stores the information as a JSON structure of key/value + // pairs that a Lambda rotation function can parse. + SecretString *string + + // A list of tags to attach to the secret. Each tag is a key and value pair of + // strings in a JSON text string, for example: + // + // [{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}] + // + // Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a + // different tag from one with key "abc". + // + // If you check tags in permissions policies as part of your security strategy, + // then adding or removing a tag can change permissions. If the completion of this + // operation would result in you losing your permissions for this secret, then + // Secrets Manager blocks the operation and returns an Access Denied error. For + // more information, see [Control access to secrets using tags]and [Limit access to identities with tags that match secrets' tags]. + // + // For information about how to format a JSON parameter for the various command + // line tool environments, see [Using JSON for Parameters]. If your command-line tool or SDK requires + // quotation marks around the parameter, you should use single quotes to avoid + // confusion with the double quotes required in the JSON text. + // + // For tag quotas and naming restrictions, see [Service quotas for Tagging] in the Amazon Web Services General + // Reference guide. + // + // [Limit access to identities with tags that match secrets' tags]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2 + // [Using JSON for Parameters]: https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json + // [Service quotas for Tagging]: https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas + // [Control access to secrets using tags]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateSecretOutput struct { + + // The ARN of the new secret. The ARN includes the name of the secret followed by + // six random characters. This ensures that if you create a new secret with the + // same name as a deleted secret, then users with access to the old secret don't + // get access to the new secret because the ARNs are different. + ARN *string + + // The name of the new secret. + Name *string + + // A list of the replicas of this secret and their status: + // + // - Failed , which indicates that the replica was not created. + // + // - InProgress , which indicates that Secrets Manager is in the process of + // creating the replica. + // + // - InSync , which indicates that the replica was created. + ReplicationStatus []types.ReplicationStatusType + + // The unique identifier associated with the version of the new secret. + VersionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSecret{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSecret{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateSecretMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateSecretValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSecret(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateSecret struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateSecret) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateSecret) 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.(*CreateSecretInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateSecretInput ") + } + + 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_opCreateSecretMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSecret{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateSecret(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateSecret", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go new file mode 100644 index 00000000..4d8772a4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the resource-based permission policy attached to the secret. To attach +// a policy to a secret, use PutResourcePolicy. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:DeleteResourcePolicy . For more +// information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { + if params == nil { + params = &DeleteResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteResourcePolicyInput struct { + + // The ARN or name of the secret to delete the attached resource-based policy for. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type DeleteResourcePolicyOutput struct { + + // The ARN of the secret that the resource-based policy was deleted for. + ARN *string + + // The name of the secret that the resource-based policy was deleted for. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteResourcePolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go new file mode 100644 index 00000000..153f42b7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Deletes a secret and all of its versions. You can specify a recovery window +// during which you can restore the secret. The minimum recovery window is 7 days. +// The default recovery window is 30 days. Secrets Manager attaches a DeletionDate +// stamp to the secret that specifies the end of the recovery window. At the end of +// the recovery window, Secrets Manager deletes the secret permanently. +// +// You can't delete a primary secret that is replicated to other Regions. You must +// first delete the replicas using RemoveRegionsFromReplication, and then delete the primary secret. When you +// delete a replica, it is deleted immediately. +// +// You can't directly delete a version of a secret. Instead, you remove all +// staging labels from the version using UpdateSecretVersionStage. This marks the version as deprecated, +// and then Secrets Manager can automatically delete the version in the background. +// +// To determine whether an application still uses a secret, you can create an +// Amazon CloudWatch alarm to alert you to any attempts to access a secret during +// the recovery window. For more information, see [Monitor secrets scheduled for deletion]. +// +// Secrets Manager performs the permanent secret deletion at the end of the +// waiting period as a background task with low priority. There is no guarantee of +// a specific time after the recovery window for the permanent delete to occur. +// +// At any time before recovery window ends, you can use RestoreSecret to remove the DeletionDate +// and cancel the deletion of the secret. +// +// When a secret is scheduled for deletion, you cannot retrieve the secret value. +// You must first cancel the deletion with RestoreSecretand then you can retrieve the secret. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:DeleteSecret . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Monitor secrets scheduled for deletion]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring_cloudwatch_deleted-secrets.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) DeleteSecret(ctx context.Context, params *DeleteSecretInput, optFns ...func(*Options)) (*DeleteSecretOutput, error) { + if params == nil { + params = &DeleteSecretInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSecret", params, optFns, c.addOperationDeleteSecretMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSecretOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSecretInput struct { + + // The ARN or name of the secret to delete. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // Specifies whether to delete the secret without any recovery window. You can't + // use both this parameter and RecoveryWindowInDays in the same call. If you don't + // use either, then by default Secrets Manager uses a 30 day recovery window. + // + // Secrets Manager performs the actual deletion with an asynchronous background + // process, so there might be a short delay before the secret is permanently + // deleted. If you delete a secret and then immediately create a secret with the + // same name, use appropriate back off and retry logic. + // + // If you forcibly delete an already deleted or nonexistent secret, the operation + // does not return ResourceNotFoundException . + // + // Use this parameter with caution. This parameter causes the operation to skip + // the normal recovery window before the permanent deletion that Secrets Manager + // would normally impose with the RecoveryWindowInDays parameter. If you delete a + // secret with the ForceDeleteWithoutRecovery parameter, then you have no + // opportunity to recover the secret. You lose the secret permanently. + ForceDeleteWithoutRecovery *bool + + // The number of days from 7 to 30 that Secrets Manager waits before permanently + // deleting the secret. You can't use both this parameter and + // ForceDeleteWithoutRecovery in the same call. If you don't use either, then by + // default Secrets Manager uses a 30 day recovery window. + RecoveryWindowInDays *int64 + + noSmithyDocumentSerde +} + +type DeleteSecretOutput struct { + + // The ARN of the secret. + ARN *string + + // The date and time after which this secret Secrets Manager can permanently + // delete this secret, and it can no longer be restored. This value is the date and + // time of the delete request plus the number of days in RecoveryWindowInDays . + DeletionDate *time.Time + + // The name of the secret. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSecret{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteSecret{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSecretValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSecret(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSecret(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteSecret", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go new file mode 100644 index 00000000..be73019d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves the details of a secret. It does not include the encrypted secret +// value. Secrets Manager only returns fields that have a value in the response. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:DescribeSecret . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) DescribeSecret(ctx context.Context, params *DescribeSecretInput, optFns ...func(*Options)) (*DescribeSecretOutput, error) { + if params == nil { + params = &DescribeSecretInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeSecret", params, optFns, c.addOperationDescribeSecretMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeSecretOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeSecretInput struct { + + // The ARN or name of the secret. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type DescribeSecretOutput struct { + + // The ARN of the secret. + ARN *string + + // The date the secret was created. + CreatedDate *time.Time + + // The date the secret is scheduled for deletion. If it is not scheduled for + // deletion, this field is omitted. When you delete a secret, Secrets Manager + // requires a recovery window of at least 7 days before deleting the secret. Some + // time after the deleted date, Secrets Manager deletes the secret, including all + // of its versions. + // + // If a secret is scheduled for deletion, then its details, including the + // encrypted secret value, is not accessible. To cancel a scheduled deletion and + // restore access to the secret, use RestoreSecret. + DeletedDate *time.Time + + // The description of the secret. + Description *string + + // The key ID or alias ARN of the KMS key that Secrets Manager uses to encrypt the + // secret value. If the secret is encrypted with the Amazon Web Services managed + // key aws/secretsmanager , this field is omitted. Secrets created using the + // console use an KMS key ID. + KmsKeyId *string + + // The date that the secret was last accessed in the Region. This field is omitted + // if the secret has never been retrieved in the Region. + LastAccessedDate *time.Time + + // The last date and time that this secret was modified in any way. + LastChangedDate *time.Time + + // The last date and time that Secrets Manager rotated the secret. If the secret + // isn't configured for rotation or rotation has been disabled, Secrets Manager + // returns null. + LastRotatedDate *time.Time + + // The name of the secret. + Name *string + + // The next rotation is scheduled to occur on or before this date. If the secret + // isn't configured for rotation or rotation has been disabled, Secrets Manager + // returns null. If rotation fails, Secrets Manager retries the entire rotation + // process multiple times. If rotation is unsuccessful, this date may be in the + // past. + // + // This date represents the latest date that rotation will occur, but it is not an + // approximate rotation date. In some cases, for example if you turn off automatic + // rotation and then turn it back on, the next rotation may occur much sooner than + // this date. + NextRotationDate *time.Time + + // The ID of the service that created this secret. For more information, see [Secrets managed by other Amazon Web Services services]. + // + // [Secrets managed by other Amazon Web Services services]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html + OwningService *string + + // The Region the secret is in. If a secret is replicated to other Regions, the + // replicas are listed in ReplicationStatus . + PrimaryRegion *string + + // A list of the replicas of this secret and their status: + // + // - Failed , which indicates that the replica was not created. + // + // - InProgress , which indicates that Secrets Manager is in the process of + // creating the replica. + // + // - InSync , which indicates that the replica was created. + ReplicationStatus []types.ReplicationStatusType + + // Specifies whether automatic rotation is turned on for this secret. + // + // To turn on rotation, use RotateSecret. To turn off rotation, use CancelRotateSecret. + RotationEnabled *bool + + // The ARN of the Lambda function that Secrets Manager invokes to rotate the + // secret. + RotationLambdaARN *string + + // The rotation schedule and Lambda function for this secret. If the secret + // previously had rotation turned on, but it is now turned off, this field shows + // the previous rotation schedule and rotation function. If the secret never had + // rotation turned on, this field is omitted. + RotationRules *types.RotationRulesType + + // The list of tags attached to the secret. To add tags to a secret, use TagResource. To + // remove tags, use UntagResource. + Tags []types.Tag + + // A list of the versions of the secret that have staging labels attached. + // Versions that don't have staging labels are considered deprecated and Secrets + // Manager can delete them. + // + // Secrets Manager uses staging labels to indicate the status of a secret version + // during rotation. The three staging labels for rotation are: + // + // - AWSCURRENT , which indicates the current version of the secret. + // + // - AWSPENDING , which indicates the version of the secret that contains new + // secret information that will become the next current version when rotation + // finishes. + // + // During rotation, Secrets Manager creates an AWSPENDING version ID before + // creating the new secret version. To check if a secret version exists, call GetSecretValue. + // + // - AWSPREVIOUS , which indicates the previous current version of the secret. + // You can use this as the last known good version. + // + // For more information about rotation and staging labels, see [How rotation works]. + // + // [How rotation works]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html + VersionIdsToStages map[string][]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSecret{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSecret{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeSecretValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecret(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeSecret(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeSecret", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go new file mode 100644 index 00000000..857fe52d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Generates a random password. We recommend that you specify the maximum length +// and include every character type that the system you are generating a password +// for can support. By default, Secrets Manager uses uppercase and lowercase +// letters, numbers, and the following characters in passwords: +// !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ +// +// Secrets Manager generates a CloudTrail log entry when you call this action. +// +// Required permissions: secretsmanager:GetRandomPassword . For more information, +// see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) GetRandomPassword(ctx context.Context, params *GetRandomPasswordInput, optFns ...func(*Options)) (*GetRandomPasswordOutput, error) { + if params == nil { + params = &GetRandomPasswordInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRandomPassword", params, optFns, c.addOperationGetRandomPasswordMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRandomPasswordOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRandomPasswordInput struct { + + // A string of the characters that you don't want in the password. + ExcludeCharacters *string + + // Specifies whether to exclude lowercase letters from the password. If you don't + // include this switch, the password can contain lowercase letters. + ExcludeLowercase *bool + + // Specifies whether to exclude numbers from the password. If you don't include + // this switch, the password can contain numbers. + ExcludeNumbers *bool + + // Specifies whether to exclude the following punctuation characters from the + // password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ . If + // you don't include this switch, the password can contain punctuation. + ExcludePunctuation *bool + + // Specifies whether to exclude uppercase letters from the password. If you don't + // include this switch, the password can contain uppercase letters. + ExcludeUppercase *bool + + // Specifies whether to include the space character. If you include this switch, + // the password can contain space characters. + IncludeSpace *bool + + // The length of the password. If you don't include this parameter, the default + // length is 32 characters. + PasswordLength *int64 + + // Specifies whether to include at least one upper and lowercase letter, one + // number, and one punctuation. If you don't include this switch, the password + // contains at least one of every character type. + RequireEachIncludedType *bool + + noSmithyDocumentSerde +} + +type GetRandomPasswordOutput struct { + + // A string with the password. + RandomPassword *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRandomPasswordMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRandomPassword{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRandomPassword{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRandomPassword"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRandomPassword(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRandomPassword(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetRandomPassword", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go new file mode 100644 index 00000000..3a2e6c68 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the JSON text of the resource-based policy document attached to the +// secret. For more information about permissions policies attached to a secret, +// see [Permissions policies attached to a secret]. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:GetResourcePolicy . For more information, +// see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +// [Permissions policies attached to a secret]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-policies.html +func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { + if params == nil { + params = &GetResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, c.addOperationGetResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourcePolicyInput struct { + + // The ARN or name of the secret to retrieve the attached resource-based policy + // for. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type GetResourcePolicyOutput struct { + + // The ARN of the secret that the resource-based policy was retrieved for. + ARN *string + + // The name of the secret that the resource-based policy was retrieved for. + Name *string + + // A JSON-formatted string that contains the permissions policy attached to the + // secret. For more information about permissions policies, see [Authentication and access control for Secrets Manager]. + // + // [Authentication and access control for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html + ResourcePolicy *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetResourcePolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go new file mode 100644 index 00000000..16a7f98d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves the contents of the encrypted fields SecretString or SecretBinary +// from the specified version of a secret, whichever contains content. +// +// To retrieve the values for a group of secrets, call BatchGetSecretValue. +// +// We recommend that you cache your secret values by using client-side caching. +// Caching secrets improves speed and reduces your costs. For more information, see +// [Cache secrets for your applications]. +// +// To retrieve the previous version of a secret, use VersionStage and specify +// AWSPREVIOUS. To revert to the previous version of a secret, call [UpdateSecretVersionStage]. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:GetSecretValue . If the secret is encrypted +// using a customer-managed key instead of the Amazon Web Services managed key +// aws/secretsmanager , then you also need kms:Decrypt permissions for that key. +// For more information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [UpdateSecretVersionStage]: https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/update-secret-version-stage.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +// [Cache secrets for your applications]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets.html +func (c *Client) GetSecretValue(ctx context.Context, params *GetSecretValueInput, optFns ...func(*Options)) (*GetSecretValueOutput, error) { + if params == nil { + params = &GetSecretValueInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSecretValue", params, optFns, c.addOperationGetSecretValueMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSecretValueOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSecretValueInput struct { + + // The ARN or name of the secret to retrieve. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // The unique identifier of the version of the secret to retrieve. If you include + // both this parameter and VersionStage , the two parameters must refer to the same + // secret version. If you don't specify either a VersionStage or VersionId , then + // Secrets Manager returns the AWSCURRENT version. + // + // This value is typically a [UUID-type] value with 32 hexadecimal digits. + // + // [UUID-type]: https://wikipedia.org/wiki/Universally_unique_identifier + VersionId *string + + // The staging label of the version of the secret to retrieve. + // + // Secrets Manager uses staging labels to keep track of different versions during + // the rotation process. If you include both this parameter and VersionId , the two + // parameters must refer to the same secret version. If you don't specify either a + // VersionStage or VersionId , Secrets Manager returns the AWSCURRENT version. + VersionStage *string + + noSmithyDocumentSerde +} + +type GetSecretValueOutput struct { + + // The ARN of the secret. + ARN *string + + // The date and time that this version of the secret was created. If you don't + // specify which version in VersionId or VersionStage , then Secrets Manager uses + // the AWSCURRENT version. + CreatedDate *time.Time + + // The friendly name of the secret. + Name *string + + // The decrypted secret value, if the secret value was originally provided as + // binary data in the form of a byte array. When you retrieve a SecretBinary using + // the HTTP API, the Python SDK, or the Amazon Web Services CLI, the value is + // Base64-encoded. Otherwise, it is not encoded. + // + // If the secret was created by using the Secrets Manager console, or if the + // secret value was originally provided as a string, then this field is omitted. + // The secret value appears in SecretString instead. + SecretBinary []byte + + // The decrypted secret value, if the secret value was originally provided as a + // string or through the Secrets Manager console. + // + // If this secret was created by using the console, then Secrets Manager stores + // the information as a JSON structure of key/value pairs. + SecretString *string + + // The unique identifier of this version of the secret. + VersionId *string + + // A list of all of the staging labels currently attached to this version of the + // secret. + VersionStages []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSecretValue{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSecretValue{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSecretValue"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetSecretValueValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSecretValue(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSecretValue(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSecretValue", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go new file mode 100644 index 00000000..0cb7f524 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go @@ -0,0 +1,281 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the versions of a secret. Secrets Manager uses staging labels to indicate +// the different versions of a secret. For more information, see [Secrets Manager concepts: Versions]. +// +// To list the secrets in the account, use ListSecrets. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:ListSecretVersionIds . For more +// information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Secrets Manager concepts: Versions]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) ListSecretVersionIds(ctx context.Context, params *ListSecretVersionIdsInput, optFns ...func(*Options)) (*ListSecretVersionIdsOutput, error) { + if params == nil { + params = &ListSecretVersionIdsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSecretVersionIds", params, optFns, c.addOperationListSecretVersionIdsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSecretVersionIdsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSecretVersionIdsInput struct { + + // The ARN or name of the secret whose versions you want to list. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // Specifies whether to include versions of secrets that don't have any staging + // labels attached to them. Versions without staging labels are considered + // deprecated and are subject to deletion by Secrets Manager. By default, versions + // without staging labels aren't included. + IncludeDeprecated *bool + + // The number of results to include in the response. + // + // If there are more results available, in the response, Secrets Manager includes + // NextToken . To get the next results, call ListSecretVersionIds again with the + // value from NextToken . + MaxResults *int32 + + // A token that indicates where the output should continue from, if a previous + // call did not show all results. To get the next results, call + // ListSecretVersionIds again with this value. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSecretVersionIdsOutput struct { + + // The ARN of the secret. + ARN *string + + // The name of the secret. + Name *string + + // Secrets Manager includes this value if there's more output available than what + // is included in the current response. This can occur even when the response + // includes no values at all, such as when you ask for a filtered view of a long + // list. To get the next results, call ListSecretVersionIds again with this value. + NextToken *string + + // A list of the versions of the secret. + Versions []types.SecretVersionsListEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSecretVersionIds{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSecretVersionIds{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSecretVersionIds"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListSecretVersionIdsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSecretVersionIds(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListSecretVersionIdsAPIClient is a client that implements the +// ListSecretVersionIds operation. +type ListSecretVersionIdsAPIClient interface { + ListSecretVersionIds(context.Context, *ListSecretVersionIdsInput, ...func(*Options)) (*ListSecretVersionIdsOutput, error) +} + +var _ ListSecretVersionIdsAPIClient = (*Client)(nil) + +// ListSecretVersionIdsPaginatorOptions is the paginator options for +// ListSecretVersionIds +type ListSecretVersionIdsPaginatorOptions struct { + // The number of results to include in the response. + // + // If there are more results available, in the response, Secrets Manager includes + // NextToken . To get the next results, call ListSecretVersionIds again with the + // value from NextToken . + 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 +} + +// ListSecretVersionIdsPaginator is a paginator for ListSecretVersionIds +type ListSecretVersionIdsPaginator struct { + options ListSecretVersionIdsPaginatorOptions + client ListSecretVersionIdsAPIClient + params *ListSecretVersionIdsInput + nextToken *string + firstPage bool +} + +// NewListSecretVersionIdsPaginator returns a new ListSecretVersionIdsPaginator +func NewListSecretVersionIdsPaginator(client ListSecretVersionIdsAPIClient, params *ListSecretVersionIdsInput, optFns ...func(*ListSecretVersionIdsPaginatorOptions)) *ListSecretVersionIdsPaginator { + if params == nil { + params = &ListSecretVersionIdsInput{} + } + + options := ListSecretVersionIdsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSecretVersionIdsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecretVersionIdsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSecretVersionIds page. +func (p *ListSecretVersionIdsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecretVersionIdsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListSecretVersionIds(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_opListSecretVersionIds(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSecretVersionIds", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go new file mode 100644 index 00000000..7ebdc309 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go @@ -0,0 +1,273 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the secrets that are stored by Secrets Manager in the Amazon Web Services +// account, not including secrets that are marked for deletion. To see secrets +// marked for deletion, use the Secrets Manager console. +// +// All Secrets Manager operations are eventually consistent. ListSecrets might not +// reflect changes from the last five minutes. You can get more recent information +// for a specific secret by calling DescribeSecret. +// +// To list the versions of a secret, use ListSecretVersionIds. +// +// To retrieve the values for the secrets, call BatchGetSecretValue or GetSecretValue. +// +// For information about finding secrets in the console, see [Find secrets in Secrets Manager]. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:ListSecrets . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +// [Find secrets in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html +func (c *Client) ListSecrets(ctx context.Context, params *ListSecretsInput, optFns ...func(*Options)) (*ListSecretsOutput, error) { + if params == nil { + params = &ListSecretsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSecrets", params, optFns, c.addOperationListSecretsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSecretsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSecretsInput struct { + + // The filters to apply to the list of secrets. + Filters []types.Filter + + // Specifies whether to include secrets scheduled for deletion. By default, + // secrets scheduled for deletion aren't included. + IncludePlannedDeletion *bool + + // The number of results to include in the response. + // + // If there are more results available, in the response, Secrets Manager includes + // NextToken . To get the next results, call ListSecrets again with the value from + // NextToken . + MaxResults *int32 + + // A token that indicates where the output should continue from, if a previous + // call did not show all results. To get the next results, call ListSecrets again + // with this value. + NextToken *string + + // Secrets are listed by CreatedDate . + SortOrder types.SortOrderType + + noSmithyDocumentSerde +} + +type ListSecretsOutput struct { + + // Secrets Manager includes this value if there's more output available than what + // is included in the current response. This can occur even when the response + // includes no values at all, such as when you ask for a filtered view of a long + // list. To get the next results, call ListSecrets again with this value. + NextToken *string + + // A list of the secrets in the account. + SecretList []types.SecretListEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSecrets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSecrets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSecrets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSecrets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListSecretsAPIClient is a client that implements the ListSecrets operation. +type ListSecretsAPIClient interface { + ListSecrets(context.Context, *ListSecretsInput, ...func(*Options)) (*ListSecretsOutput, error) +} + +var _ ListSecretsAPIClient = (*Client)(nil) + +// ListSecretsPaginatorOptions is the paginator options for ListSecrets +type ListSecretsPaginatorOptions struct { + // The number of results to include in the response. + // + // If there are more results available, in the response, Secrets Manager includes + // NextToken . To get the next results, call ListSecrets again with the value from + // NextToken . + 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 +} + +// ListSecretsPaginator is a paginator for ListSecrets +type ListSecretsPaginator struct { + options ListSecretsPaginatorOptions + client ListSecretsAPIClient + params *ListSecretsInput + nextToken *string + firstPage bool +} + +// NewListSecretsPaginator returns a new ListSecretsPaginator +func NewListSecretsPaginator(client ListSecretsAPIClient, params *ListSecretsInput, optFns ...func(*ListSecretsPaginatorOptions)) *ListSecretsPaginator { + if params == nil { + params = &ListSecretsInput{} + } + + options := ListSecretsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSecretsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecretsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSecrets page. +func (p *ListSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecretsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListSecrets(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_opListSecrets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSecrets", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go new file mode 100644 index 00000000..a3e36689 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Attaches a resource-based permission policy to a secret. A resource-based +// policy is optional. For more information, see [Authentication and access control for Secrets Manager] +// +// For information about attaching a policy in the console, see [Attach a permissions policy to a secret]. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:PutResourcePolicy . For more information, +// see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Attach a permissions policy to a secret]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +// [Authentication and access control for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { + if params == nil { + params = &PutResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutResourcePolicyInput struct { + + // A JSON-formatted string for an Amazon Web Services resource-based policy. For + // example policies, see [Permissions policy examples]. + // + // [Permissions policy examples]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html + // + // This member is required. + ResourcePolicy *string + + // The ARN or name of the secret to attach the resource-based policy. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // Specifies whether to block resource-based policies that allow broad access to + // the secret, for example those that use a wildcard for the principal. By default, + // public policies aren't blocked. + // + // Resource policy validation and the BlockPublicPolicy parameter help protect + // your resources by preventing public access from being granted through the + // resource policies that are directly attached to your secrets. In addition to + // using these features, carefully inspect the following policies to confirm that + // they do not grant public access: + // + // - Identity-based policies attached to associated Amazon Web Services + // principals (for example, IAM roles) + // + // - Resource-based policies attached to associated Amazon Web Services + // resources (for example, Key Management Service (KMS) keys) + // + // To review permissions to your secrets, see [Determine who has permissions to your secrets]. + // + // [Determine who has permissions to your secrets]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/determine-acccess_examine-iam-policies.html + BlockPublicPolicy *bool + + noSmithyDocumentSerde +} + +type PutResourcePolicyOutput struct { + + // The ARN of the secret. + ARN *string + + // The name of the secret. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutResourcePolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go new file mode 100644 index 00000000..b82eb6c1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go @@ -0,0 +1,288 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new version with a new encrypted secret value and attaches it to the +// secret. The version can contain a new SecretString value or a new SecretBinary +// value. +// +// We recommend you avoid calling PutSecretValue at a sustained rate of more than +// once every 10 minutes. When you update the secret value, Secrets Manager creates +// a new version of the secret. Secrets Manager removes outdated versions when +// there are more than 100, but it does not remove versions created less than 24 +// hours ago. If you call PutSecretValue more than once every 10 minutes, you +// create more versions than Secrets Manager removes, and you will reach the quota +// for secret versions. +// +// You can specify the staging labels to attach to the new version in VersionStages +// . If you don't include VersionStages , then Secrets Manager automatically moves +// the staging label AWSCURRENT to this version. If this operation creates the +// first version for the secret, then Secrets Manager automatically attaches the +// staging label AWSCURRENT to it. If this operation moves the staging label +// AWSCURRENT from another version to this version, then Secrets Manager also +// automatically moves the staging label AWSPREVIOUS to the version that AWSCURRENT +// was removed from. +// +// This operation is idempotent. If you call this operation with a +// ClientRequestToken that matches an existing version's VersionId, and you specify +// the same secret data, the operation succeeds but does nothing. However, if the +// secret data is different, then the operation fails because you can't modify an +// existing version; you can only create new ones. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters except SecretBinary or +// SecretString because it might be logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:PutSecretValue . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) PutSecretValue(ctx context.Context, params *PutSecretValueInput, optFns ...func(*Options)) (*PutSecretValueOutput, error) { + if params == nil { + params = &PutSecretValueInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutSecretValue", params, optFns, c.addOperationPutSecretValueMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutSecretValueOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutSecretValueInput struct { + + // The ARN or name of the secret to add a new version to. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // If the secret doesn't already exist, use CreateSecret instead. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // A unique identifier for the new version of the secret. + // + // If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs + // to call this operation, then you can leave this parameter empty. The CLI or SDK + // generates a random UUID for you and includes it as the value for this parameter + // in the request. + // + // If you generate a raw HTTP request to the Secrets Manager service endpoint, + // then you must generate a ClientRequestToken and include it in the request. + // + // This value helps ensure idempotency. Secrets Manager uses this value to prevent + // the accidental creation of duplicate versions if there are failures and retries + // during a rotation. We recommend that you generate a [UUID-type]value to ensure uniqueness + // of your versions within the specified secret. + // + // - If the ClientRequestToken value isn't already associated with a version of + // the secret then a new version of the secret is created. + // + // - If a version with this value already exists and that version's SecretString + // or SecretBinary values are the same as those in the request then the request + // is ignored. The operation is idempotent. + // + // - If a version with this value already exists and the version of the + // SecretString and SecretBinary values are different from those in the request, + // then the request fails because you can't modify a secret version. You can only + // create new versions to store new secret values. + // + // This value becomes the VersionId of the new version. + // + // [UUID-type]: https://wikipedia.org/wiki/Universally_unique_identifier + ClientRequestToken *string + + // The binary data to encrypt and store in the new version of the secret. To use + // this parameter in the command-line tools, we recommend that you store your + // binary data in a file and then pass the contents of the file as a parameter. + // + // You must include SecretBinary or SecretString , but not both. + // + // You can't access this value from the Secrets Manager console. + SecretBinary []byte + + // The text to encrypt and store in the new version of the secret. + // + // You must include SecretBinary or SecretString , but not both. + // + // We recommend you create the secret string as JSON key/value pairs, as shown in + // the example. + SecretString *string + + // A list of staging labels to attach to this version of the secret. Secrets + // Manager uses staging labels to track versions of a secret through the rotation + // process. + // + // If you specify a staging label that's already associated with a different + // version of the same secret, then Secrets Manager removes the label from the + // other version and attaches it to this version. If you specify AWSCURRENT , and + // it is already attached to another version, then Secrets Manager also moves the + // staging label AWSPREVIOUS to the version that AWSCURRENT was removed from. + // + // If you don't include VersionStages , then Secrets Manager automatically moves + // the staging label AWSCURRENT to this version. + VersionStages []string + + noSmithyDocumentSerde +} + +type PutSecretValueOutput struct { + + // The ARN of the secret. + ARN *string + + // The name of the secret. + Name *string + + // The unique identifier of the version of the secret. + VersionId *string + + // The list of staging labels that are currently attached to this version of the + // secret. Secrets Manager uses staging labels to track a version as it progresses + // through the secret rotation process. + VersionStages []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutSecretValue{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutSecretValue{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutSecretValue"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opPutSecretValueMiddleware(stack, options); err != nil { + return err + } + if err = addOpPutSecretValueValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSecretValue(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpPutSecretValue struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpPutSecretValue) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpPutSecretValue) 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.(*PutSecretValueInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *PutSecretValueInput ") + } + + 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_opPutSecretValueMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpPutSecretValue{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opPutSecretValue(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutSecretValue", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RemoveRegionsFromReplication.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RemoveRegionsFromReplication.go new file mode 100644 index 00000000..44950e25 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RemoveRegionsFromReplication.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// For a secret that is replicated to other Regions, deletes the secret replicas +// from the Regions you specify. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:RemoveRegionsFromReplication . For more +// information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) RemoveRegionsFromReplication(ctx context.Context, params *RemoveRegionsFromReplicationInput, optFns ...func(*Options)) (*RemoveRegionsFromReplicationOutput, error) { + if params == nil { + params = &RemoveRegionsFromReplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveRegionsFromReplication", params, optFns, c.addOperationRemoveRegionsFromReplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveRegionsFromReplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveRegionsFromReplicationInput struct { + + // The Regions of the replicas to remove. + // + // This member is required. + RemoveReplicaRegions []string + + // The ARN or name of the secret. + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type RemoveRegionsFromReplicationOutput struct { + + // The ARN of the primary secret. + ARN *string + + // The status of replicas for this secret after you remove Regions. + ReplicationStatus []types.ReplicationStatusType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveRegionsFromReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveRegionsFromReplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveRegionsFromReplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveRegionsFromReplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpRemoveRegionsFromReplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveRegionsFromReplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveRegionsFromReplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveRegionsFromReplication", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ReplicateSecretToRegions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ReplicateSecretToRegions.go new file mode 100644 index 00000000..e6115da0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ReplicateSecretToRegions.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Replicates the secret to a new Regions. See [Multi-Region secrets]. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:ReplicateSecretToRegions . If the primary +// secret is encrypted with a KMS key other than aws/secretsmanager , you also need +// kms:Decrypt permission to the key. To encrypt the replicated secret with a KMS +// key other than aws/secretsmanager , you need kms:GenerateDataKey and kms:Encrypt +// to the key. For more information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Multi-Region secrets]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/create-manage-multi-region-secrets.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) ReplicateSecretToRegions(ctx context.Context, params *ReplicateSecretToRegionsInput, optFns ...func(*Options)) (*ReplicateSecretToRegionsOutput, error) { + if params == nil { + params = &ReplicateSecretToRegionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ReplicateSecretToRegions", params, optFns, c.addOperationReplicateSecretToRegionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ReplicateSecretToRegionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ReplicateSecretToRegionsInput struct { + + // A list of Regions in which to replicate the secret. + // + // This member is required. + AddReplicaRegions []types.ReplicaRegionType + + // The ARN or name of the secret to replicate. + // + // This member is required. + SecretId *string + + // Specifies whether to overwrite a secret with the same name in the destination + // Region. By default, secrets aren't overwritten. + ForceOverwriteReplicaSecret bool + + noSmithyDocumentSerde +} + +type ReplicateSecretToRegionsOutput struct { + + // The ARN of the primary secret. + ARN *string + + // The status of replication. + ReplicationStatus []types.ReplicationStatusType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationReplicateSecretToRegionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpReplicateSecretToRegions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpReplicateSecretToRegions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ReplicateSecretToRegions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpReplicateSecretToRegionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplicateSecretToRegions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opReplicateSecretToRegions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ReplicateSecretToRegions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go new file mode 100644 index 00000000..adcd8ce4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Cancels the scheduled deletion of a secret by removing the DeletedDate time +// stamp. You can access a secret again after it has been restored. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:RestoreSecret . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) RestoreSecret(ctx context.Context, params *RestoreSecretInput, optFns ...func(*Options)) (*RestoreSecretOutput, error) { + if params == nil { + params = &RestoreSecretInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreSecret", params, optFns, c.addOperationRestoreSecretMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreSecretOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreSecretInput struct { + + // The ARN or name of the secret to restore. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type RestoreSecretOutput struct { + + // The ARN of the secret that was restored. + ARN *string + + // The name of the secret that was restored. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRestoreSecret{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRestoreSecret{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpRestoreSecretValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreSecret(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreSecret(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RestoreSecret", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go new file mode 100644 index 00000000..7d11126c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go @@ -0,0 +1,257 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Configures and starts the asynchronous process of rotating the secret. For +// information about rotation, see [Rotate secrets]in the Secrets Manager User Guide. If you +// include the configuration parameters, the operation sets the values for the +// secret and then immediately starts a rotation. If you don't include the +// configuration parameters, the operation starts a rotation with the values +// already stored in the secret. +// +// When rotation is successful, the AWSPENDING staging label might be attached to +// the same version as the AWSCURRENT version, or it might not be attached to any +// version. If the AWSPENDING staging label is present but not attached to the +// same version as AWSCURRENT , then any later invocation of RotateSecret assumes +// that a previous rotation request is still in progress and returns an error. When +// rotation is unsuccessful, the AWSPENDING staging label might be attached to an +// empty secret version. For more information, see [Troubleshoot rotation]in the Secrets Manager User +// Guide. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:RotateSecret . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. You also need lambda:InvokeFunction permissions on the rotation function. +// For more information, see [Permissions for rotation]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Permissions for rotation]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets-required-permissions-function.html +// [Rotate secrets]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Troubleshoot rotation]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot_rotation.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) RotateSecret(ctx context.Context, params *RotateSecretInput, optFns ...func(*Options)) (*RotateSecretOutput, error) { + if params == nil { + params = &RotateSecretInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RotateSecret", params, optFns, c.addOperationRotateSecretMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RotateSecretOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RotateSecretInput struct { + + // The ARN or name of the secret to rotate. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // A unique identifier for the new version of the secret. You only need to specify + // this value if you implement your own retry logic and you want to ensure that + // Secrets Manager doesn't attempt to create a secret version twice. + // + // If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs + // to call this operation, then you can leave this parameter empty. The CLI or SDK + // generates a random UUID for you and includes it as the value for this parameter + // in the request. + // + // If you generate a raw HTTP request to the Secrets Manager service endpoint, + // then you must generate a ClientRequestToken and include it in the request. + // + // This value helps ensure idempotency. Secrets Manager uses this value to prevent + // the accidental creation of duplicate versions if there are failures and retries + // during a rotation. We recommend that you generate a [UUID-type]value to ensure uniqueness + // of your versions within the specified secret. + // + // [UUID-type]: https://wikipedia.org/wiki/Universally_unique_identifier + ClientRequestToken *string + + // Specifies whether to rotate the secret immediately or wait until the next + // scheduled rotation window. The rotation schedule is defined in RotateSecretRequest$RotationRules. + // + // For secrets that use a Lambda rotation function to rotate, if you don't + // immediately rotate the secret, Secrets Manager tests the rotation configuration + // by running the [testSecret step]testSecret of the Lambda rotation function. The test creates an + // AWSPENDING version of the secret and then removes it. + // + // By default, Secrets Manager rotates the secret immediately. + // + // [testSecret step]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html + RotateImmediately *bool + + // For secrets that use a Lambda rotation function to rotate, the ARN of the + // Lambda rotation function. + // + // For secrets that use managed rotation, omit this field. For more information, + // see [Managed rotation]in the Secrets Manager User Guide. + // + // [Managed rotation]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html + RotationLambdaARN *string + + // A structure that defines the rotation configuration for this secret. + RotationRules *types.RotationRulesType + + noSmithyDocumentSerde +} + +type RotateSecretOutput struct { + + // The ARN of the secret. + ARN *string + + // The name of the secret. + Name *string + + // The ID of the new version of the secret. + VersionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRotateSecret{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRotateSecret{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RotateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opRotateSecretMiddleware(stack, options); err != nil { + return err + } + if err = addOpRotateSecretValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRotateSecret(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpRotateSecret struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpRotateSecret) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpRotateSecret) 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.(*RotateSecretInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *RotateSecretInput ") + } + + 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_opRotateSecretMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpRotateSecret{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opRotateSecret(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RotateSecret", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_StopReplicationToReplica.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_StopReplicationToReplica.go new file mode 100644 index 00000000..b32fc01e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_StopReplicationToReplica.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the link between the replica secret and the primary secret and promotes +// the replica to a primary secret in the replica Region. +// +// You must call this operation from the Region in which you want to promote the +// replica to a primary secret. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:StopReplicationToReplica . For more +// information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) StopReplicationToReplica(ctx context.Context, params *StopReplicationToReplicaInput, optFns ...func(*Options)) (*StopReplicationToReplicaOutput, error) { + if params == nil { + params = &StopReplicationToReplicaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopReplicationToReplica", params, optFns, c.addOperationStopReplicationToReplicaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopReplicationToReplicaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopReplicationToReplicaInput struct { + + // The ARN of the primary secret. + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type StopReplicationToReplicaOutput struct { + + // The ARN of the promoted secret. The ARN is the same as the original primary + // secret except the Region is changed. + ARN *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopReplicationToReplicaMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopReplicationToReplica{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopReplicationToReplica{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopReplicationToReplica"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStopReplicationToReplicaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopReplicationToReplica(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopReplicationToReplica(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopReplicationToReplica", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go new file mode 100644 index 00000000..a59d84f2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Attaches tags to a secret. Tags consist of a key name and a value. Tags are +// part of the secret's metadata. They are not associated with specific versions of +// the secret. This operation appends tags to the existing list of tags. +// +// For tag quotas and naming restrictions, see [Service quotas for Tagging] in the Amazon Web Services General +// Reference guide. +// +// If you use tags as part of your security strategy, then adding or removing a +// tag can change permissions. If successfully completing this operation would +// result in you losing your permissions for this secret, then the operation is +// blocked and returns an Access Denied error. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:TagResource . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +// [Service quotas for Tagging]: https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The identifier for the secret to attach tags to. You can specify either the + // Amazon Resource Name (ARN) or the friendly name of the secret. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // The tags to attach to the secret as a JSON text string argument. Each element + // in the list consists of a Key and a Value . + // + // For storing multiple values, we recommend that you use a JSON text string + // argument and specify key/value pairs. For more information, see [Specifying parameter values for the Amazon Web Services CLI]in the Amazon + // Web Services CLI User Guide. + // + // [Specifying parameter values for the Amazon Web Services CLI]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go new file mode 100644 index 00000000..f089be8e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes specific tags from a secret. +// +// This operation is idempotent. If a requested tag is not attached to the secret, +// no error is returned and the secret metadata is unchanged. +// +// If you use tags as part of your security strategy, then removing a tag can +// change permissions. If successfully completing this operation would result in +// you losing your permissions for this secret, then the operation is blocked and +// returns an Access Denied error. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:UntagResource . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN or name of the secret. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // A list of tag key names to remove from the secret. You don't specify the value. + // Both the key and its associated value are removed. + // + // This parameter requires a JSON text string argument. + // + // For storing multiple values, we recommend that you use a JSON text string + // argument and specify key/value pairs. For more information, see [Specifying parameter values for the Amazon Web Services CLI]in the Amazon + // Web Services CLI User Guide. + // + // [Specifying parameter values for the Amazon Web Services CLI]: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go new file mode 100644 index 00000000..336e9ab1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go @@ -0,0 +1,290 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the details of a secret, including metadata and the secret value. To +// change the secret value, you can also use PutSecretValue. +// +// To change the rotation configuration of a secret, use RotateSecret instead. +// +// To change a secret so that it is managed by another service, you need to +// recreate the secret in that service. See [Secrets Manager secrets managed by other Amazon Web Services services]. +// +// We recommend you avoid calling UpdateSecret at a sustained rate of more than +// once every 10 minutes. When you call UpdateSecret to update the secret value, +// Secrets Manager creates a new version of the secret. Secrets Manager removes +// outdated versions when there are more than 100, but it does not remove versions +// created less than 24 hours ago. If you update the secret value more than once +// every 10 minutes, you create more versions than Secrets Manager removes, and you +// will reach the quota for secret versions. +// +// If you include SecretString or SecretBinary to create a new secret version, +// Secrets Manager automatically moves the staging label AWSCURRENT to the new +// version. Then it attaches the label AWSPREVIOUS to the version that AWSCURRENT +// was removed from. +// +// If you call this operation with a ClientRequestToken that matches an existing +// version's VersionId , the operation results in an error. You can't modify an +// existing version, you can only create a new version. To remove a version, remove +// all staging labels from it. See UpdateSecretVersionStage. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters except SecretBinary or +// SecretString because it might be logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:UpdateSecret . For more information, see [IAM policy actions for Secrets Manager] +// and [Authentication and access control in Secrets Manager]. If you use a customer managed key, you must also have kms:GenerateDataKey +// , kms:Encrypt , and kms:Decrypt permissions on the key. If you change the KMS +// key and you don't have kms:Encrypt permission to the new key, Secrets Manager +// does not re-ecrypt existing secret versions with the new key. For more +// information, see [Secret encryption and decryption]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Secret encryption and decryption]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/security-encryption.html +// [Secrets Manager secrets managed by other Amazon Web Services services]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) UpdateSecret(ctx context.Context, params *UpdateSecretInput, optFns ...func(*Options)) (*UpdateSecretOutput, error) { + if params == nil { + params = &UpdateSecretInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSecret", params, optFns, c.addOperationUpdateSecretMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSecretOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSecretInput struct { + + // The ARN or name of the secret. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // If you include SecretString or SecretBinary , then Secrets Manager creates a new + // version for the secret, and this parameter specifies the unique identifier for + // the new version. + // + // If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs + // to call this operation, then you can leave this parameter empty. The CLI or SDK + // generates a random UUID for you and includes it as the value for this parameter + // in the request. + // + // If you generate a raw HTTP request to the Secrets Manager service endpoint, + // then you must generate a ClientRequestToken and include it in the request. + // + // This value helps ensure idempotency. Secrets Manager uses this value to prevent + // the accidental creation of duplicate versions if there are failures and retries + // during a rotation. We recommend that you generate a [UUID-type]value to ensure uniqueness + // of your versions within the specified secret. + // + // [UUID-type]: https://wikipedia.org/wiki/Universally_unique_identifier + ClientRequestToken *string + + // The description of the secret. + Description *string + + // The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt + // new secret versions as well as any existing versions with the staging labels + // AWSCURRENT , AWSPENDING , or AWSPREVIOUS . If you don't have kms:Encrypt + // permission to the new key, Secrets Manager does not re-ecrypt existing secret + // versions with the new key. For more information about versions and staging + // labels, see [Concepts: Version]. + // + // A key alias is always prefixed by alias/ , for example alias/aws/secretsmanager + // . For more information, see [About aliases]. + // + // If you set this to an empty string, Secrets Manager uses the Amazon Web + // Services managed key aws/secretsmanager . If this key doesn't already exist in + // your account, then Secrets Manager creates it for you automatically. All users + // and roles in the Amazon Web Services account automatically have access to use + // aws/secretsmanager . Creating aws/secretsmanager can result in a one-time + // significant delay in returning the result. + // + // You can only use the Amazon Web Services managed key aws/secretsmanager if you + // call this operation using credentials from the same Amazon Web Services account + // that owns the secret. If the secret is in a different account, then you must use + // a customer managed key and provide the ARN of that KMS key in this field. The + // user making the call must have permissions to both the secret and the KMS key in + // their respective accounts. + // + // [Concepts: Version]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version + // [About aliases]: https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html + KmsKeyId *string + + // The binary data to encrypt and store in the new version of the secret. We + // recommend that you store your binary data in a file and then pass the contents + // of the file as a parameter. + // + // Either SecretBinary or SecretString must have a value, but not both. + // + // You can't access this parameter in the Secrets Manager console. + SecretBinary []byte + + // The text data to encrypt and store in the new version of the secret. We + // recommend you use a JSON structure of key/value pairs for your secret value. + // + // Either SecretBinary or SecretString must have a value, but not both. + SecretString *string + + noSmithyDocumentSerde +} + +type UpdateSecretOutput struct { + + // The ARN of the secret that was updated. + ARN *string + + // The name of the secret that was updated. + Name *string + + // If Secrets Manager created a new version of the secret during this operation, + // then VersionId contains the unique identifier of the new version. + VersionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSecret{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSecret{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opUpdateSecretMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateSecretValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecret(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpUpdateSecret struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateSecret) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateSecret) 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.(*UpdateSecretInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateSecretInput ") + } + + 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_opUpdateSecretMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateSecret{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateSecret(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSecret", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go new file mode 100644 index 00000000..cf266679 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go @@ -0,0 +1,193 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the staging labels attached to a version of a secret. Secrets Manager +// uses staging labels to track a version as it progresses through the secret +// rotation process. Each staging label can be attached to only one version at a +// time. To add a staging label to a version when it is already attached to another +// version, Secrets Manager first removes it from the other version first and then +// attaches it to this one. For more information about versions and staging labels, +// see [Concepts: Version]. +// +// The staging labels that you specify in the VersionStage parameter are added to +// the existing list of staging labels for the version. +// +// You can move the AWSCURRENT staging label to this version by including it in +// this call. +// +// Whenever you move AWSCURRENT , Secrets Manager automatically moves the label +// AWSPREVIOUS to the version that AWSCURRENT was removed from. +// +// If this action results in the last label being removed from a version, then the +// version is considered to be 'deprecated' and can be deleted by Secrets Manager. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:UpdateSecretVersionStage . For more +// information, see [IAM policy actions for Secrets Manager]and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [Concepts: Version]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +func (c *Client) UpdateSecretVersionStage(ctx context.Context, params *UpdateSecretVersionStageInput, optFns ...func(*Options)) (*UpdateSecretVersionStageOutput, error) { + if params == nil { + params = &UpdateSecretVersionStageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSecretVersionStage", params, optFns, c.addOperationUpdateSecretVersionStageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSecretVersionStageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSecretVersionStageInput struct { + + // The ARN or the name of the secret with the version and staging labelsto modify. + // + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See [Finding a secret from a partial ARN]. + // + // [Finding a secret from a partial ARN]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen + // + // This member is required. + SecretId *string + + // The staging label to add to this version. + // + // This member is required. + VersionStage *string + + // The ID of the version to add the staging label to. To remove a label from a + // version, then do not specify this parameter. + // + // If the staging label is already attached to a different version of the secret, + // then you must also specify the RemoveFromVersionId parameter. + MoveToVersionId *string + + // The ID of the version that the staging label is to be removed from. If the + // staging label you are trying to attach to one version is already attached to a + // different version, then you must include this parameter and specify the version + // that the label is to be removed from. If the label is attached and you either do + // not specify this parameter, or the version ID does not match, then the operation + // fails. + RemoveFromVersionId *string + + noSmithyDocumentSerde +} + +type UpdateSecretVersionStageOutput struct { + + // The ARN of the secret that was updated. + ARN *string + + // The name of the secret that was updated. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSecretVersionStageMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSecretVersionStage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSecretVersionStage{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSecretVersionStage"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSecretVersionStageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecretVersionStage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSecretVersionStage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSecretVersionStage", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go new file mode 100644 index 00000000..eef801a0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Validates that a resource policy does not grant a wide range of principals +// access to your secret. A resource-based policy is optional for secrets. +// +// The API performs three checks when validating the policy: +// +// - Sends a call to [Zelkova], an automated reasoning engine, to ensure your resource +// policy does not allow broad access to your secret, for example policies that use +// a wildcard for the principal. +// +// - Checks for correct syntax in a policy. +// +// - Verifies the policy does not lock out a caller. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see [Logging Secrets Manager events with CloudTrail]. +// +// Required permissions: secretsmanager:ValidateResourcePolicy and +// secretsmanager:PutResourcePolicy . For more information, see [IAM policy actions for Secrets Manager] and [Authentication and access control in Secrets Manager]. +// +// [Authentication and access control in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html +// [Logging Secrets Manager events with CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html +// [IAM policy actions for Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions +// [Zelkova]: https://aws.amazon.com/blogs/security/protect-sensitive-data-in-the-cloud-with-automated-reasoning-zelkova/ +func (c *Client) ValidateResourcePolicy(ctx context.Context, params *ValidateResourcePolicyInput, optFns ...func(*Options)) (*ValidateResourcePolicyOutput, error) { + if params == nil { + params = &ValidateResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ValidateResourcePolicy", params, optFns, c.addOperationValidateResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ValidateResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ValidateResourcePolicyInput struct { + + // A JSON-formatted string that contains an Amazon Web Services resource-based + // policy. The policy in the string identifies who can access or manage this secret + // and its versions. For example policies, see [Permissions policy examples]. + // + // [Permissions policy examples]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html + // + // This member is required. + ResourcePolicy *string + + // This field is reserved for internal use. + SecretId *string + + noSmithyDocumentSerde +} + +type ValidateResourcePolicyOutput struct { + + // True if your policy passes validation, otherwise false. + PolicyValidationPassed bool + + // Validation errors if your policy didn't pass validation. + ValidationErrors []types.ValidationErrorsEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpValidateResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpValidateResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ValidateResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpValidateResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidateResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opValidateResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ValidateResourcePolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/auth.go new file mode 100644 index 00000000..ff911710 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/auth.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "secretsmanager") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go new file mode 100644 index 00000000..7873fb62 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go @@ -0,0 +1,6001 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsAwsjson11_deserializeOpBatchGetSecretValue struct { +} + +func (*awsAwsjson11_deserializeOpBatchGetSecretValue) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchGetSecretValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorBatchGetSecretValue(response, &metadata) + } + output := &BatchGetSecretValueOutput{} + 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_deserializeOpDocumentBatchGetSecretValueOutput(&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_deserializeOpErrorBatchGetSecretValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCancelRotateSecret struct { +} + +func (*awsAwsjson11_deserializeOpCancelRotateSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCancelRotateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCancelRotateSecret(response, &metadata) + } + output := &CancelRotateSecretOutput{} + 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_deserializeOpDocumentCancelRotateSecretOutput(&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_deserializeOpErrorCancelRotateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCreateSecret struct { +} + +func (*awsAwsjson11_deserializeOpCreateSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateSecret(response, &metadata) + } + output := &CreateSecretOutput{} + 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_deserializeOpDocumentCreateSecretOutput(&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_deserializeOpErrorCreateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("EncryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PreconditionNotMetException", errorCode): + return awsAwsjson11_deserializeErrorPreconditionNotMetException(response, errorBody) + + case strings.EqualFold("ResourceExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata) + } + output := &DeleteResourcePolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteSecret struct { +} + +func (*awsAwsjson11_deserializeOpDeleteSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteSecret(response, &metadata) + } + output := &DeleteSecretOutput{} + 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_deserializeOpDocumentDeleteSecretOutput(&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_deserializeOpErrorDeleteSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDescribeSecret struct { +} + +func (*awsAwsjson11_deserializeOpDescribeSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDescribeSecret(response, &metadata) + } + output := &DescribeSecretOutput{} + 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_deserializeOpDocumentDescribeSecretOutput(&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_deserializeOpErrorDescribeSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + 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_deserializeOpGetRandomPassword struct { +} + +func (*awsAwsjson11_deserializeOpGetRandomPassword) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetRandomPassword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetRandomPassword(response, &metadata) + } + output := &GetRandomPasswordOutput{} + 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_deserializeOpDocumentGetRandomPasswordOutput(&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_deserializeOpErrorGetRandomPassword(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpGetResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetResourcePolicy(response, &metadata) + } + output := &GetResourcePolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetSecretValue struct { +} + +func (*awsAwsjson11_deserializeOpGetSecretValue) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetSecretValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetSecretValue(response, &metadata) + } + output := &GetSecretValueOutput{} + 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_deserializeOpDocumentGetSecretValueOutput(&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_deserializeOpErrorGetSecretValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListSecrets struct { +} + +func (*awsAwsjson11_deserializeOpListSecrets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListSecrets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListSecrets(response, &metadata) + } + output := &ListSecretsOutput{} + 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_deserializeOpDocumentListSecretsOutput(&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_deserializeOpErrorListSecrets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListSecretVersionIds struct { +} + +func (*awsAwsjson11_deserializeOpListSecretVersionIds) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListSecretVersionIds) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListSecretVersionIds(response, &metadata) + } + output := &ListSecretVersionIdsOutput{} + 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_deserializeOpDocumentListSecretVersionIdsOutput(&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_deserializeOpErrorListSecretVersionIds(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + 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_deserializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) + } + output := &PutResourcePolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PublicPolicyException", errorCode): + return awsAwsjson11_deserializeErrorPublicPolicyException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutSecretValue struct { +} + +func (*awsAwsjson11_deserializeOpPutSecretValue) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutSecretValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutSecretValue(response, &metadata) + } + output := &PutSecretValueOutput{} + 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_deserializeOpDocumentPutSecretValueOutput(&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_deserializeOpErrorPutSecretValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("EncryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpRemoveRegionsFromReplication struct { +} + +func (*awsAwsjson11_deserializeOpRemoveRegionsFromReplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRemoveRegionsFromReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorRemoveRegionsFromReplication(response, &metadata) + } + output := &RemoveRegionsFromReplicationOutput{} + 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_deserializeOpDocumentRemoveRegionsFromReplicationOutput(&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_deserializeOpErrorRemoveRegionsFromReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpReplicateSecretToRegions struct { +} + +func (*awsAwsjson11_deserializeOpReplicateSecretToRegions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpReplicateSecretToRegions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorReplicateSecretToRegions(response, &metadata) + } + output := &ReplicateSecretToRegionsOutput{} + 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_deserializeOpDocumentReplicateSecretToRegionsOutput(&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_deserializeOpErrorReplicateSecretToRegions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpRestoreSecret struct { +} + +func (*awsAwsjson11_deserializeOpRestoreSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRestoreSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorRestoreSecret(response, &metadata) + } + output := &RestoreSecretOutput{} + 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_deserializeOpDocumentRestoreSecretOutput(&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_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpRotateSecret struct { +} + +func (*awsAwsjson11_deserializeOpRotateSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRotateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorRotateSecret(response, &metadata) + } + output := &RotateSecretOutput{} + 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_deserializeOpDocumentRotateSecretOutput(&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_deserializeOpErrorRotateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStopReplicationToReplica struct { +} + +func (*awsAwsjson11_deserializeOpStopReplicationToReplica) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStopReplicationToReplica) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStopReplicationToReplica(response, &metadata) + } + output := &StopReplicationToReplicaOutput{} + 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_deserializeOpDocumentStopReplicationToReplicaOutput(&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_deserializeOpErrorStopReplicationToReplica(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateSecret struct { +} + +func (*awsAwsjson11_deserializeOpUpdateSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateSecret(response, &metadata) + } + output := &UpdateSecretOutput{} + 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_deserializeOpDocumentUpdateSecretOutput(&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_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("EncryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PreconditionNotMetException", errorCode): + return awsAwsjson11_deserializeErrorPreconditionNotMetException(response, errorBody) + + case strings.EqualFold("ResourceExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateSecretVersionStage struct { +} + +func (*awsAwsjson11_deserializeOpUpdateSecretVersionStage) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateSecretVersionStage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateSecretVersionStage(response, &metadata) + } + output := &UpdateSecretVersionStageOutput{} + 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_deserializeOpDocumentUpdateSecretVersionStageOutput(&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_deserializeOpErrorUpdateSecretVersionStage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpValidateResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpValidateResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpValidateResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorValidateResourcePolicy(response, &metadata) + } + output := &ValidateResourcePolicyOutput{} + 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_deserializeOpDocumentValidateResourcePolicyOutput(&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_deserializeOpErrorValidateResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorDecryptionFailure(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.DecryptionFailure{} + err := awsAwsjson11_deserializeDocumentDecryptionFailure(&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_deserializeErrorEncryptionFailure(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.EncryptionFailure{} + err := awsAwsjson11_deserializeDocumentEncryptionFailure(&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_deserializeErrorInternalServiceError(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.InternalServiceError{} + err := awsAwsjson11_deserializeDocumentInternalServiceError(&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_deserializeErrorInvalidNextTokenException(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.InvalidNextTokenException{} + err := awsAwsjson11_deserializeDocumentInvalidNextTokenException(&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_deserializeErrorInvalidRequestException(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.InvalidRequestException{} + err := awsAwsjson11_deserializeDocumentInvalidRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func 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_deserializeErrorMalformedPolicyDocumentException(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.MalformedPolicyDocumentException{} + err := awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(&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_deserializeErrorPreconditionNotMetException(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.PreconditionNotMetException{} + err := awsAwsjson11_deserializeDocumentPreconditionNotMetException(&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_deserializeErrorPublicPolicyException(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.PublicPolicyException{} + err := awsAwsjson11_deserializeDocumentPublicPolicyException(&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_deserializeErrorResourceExistsException(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.ResourceExistsException{} + err := awsAwsjson11_deserializeDocumentResourceExistsException(&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_deserializeDocumentAPIErrorListType(v *[]types.APIErrorType, 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.APIErrorType + if *v == nil { + cv = []types.APIErrorType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.APIErrorType + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAPIErrorType(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAPIErrorType(v **types.APIErrorType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.APIErrorType + if *v == nil { + sv = &types.APIErrorType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "SecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretIdType to be of type string, got %T instead", value) + } + sv.SecretId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDecryptionFailure(v **types.DecryptionFailure, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DecryptionFailure + if *v == nil { + sv = &types.DecryptionFailure{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEncryptionFailure(v **types.EncryptionFailure, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EncryptionFailure + if *v == nil { + sv = &types.EncryptionFailure{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInternalServiceError(v **types.InternalServiceError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServiceError + if *v == nil { + sv = &types.InternalServiceError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidNextTokenException + if *v == nil { + sv = &types.InvalidNextTokenException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidParameterException + if *v == nil { + sv = &types.InvalidParameterException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentKmsKeyIdListType(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 KmsKeyIdType to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MalformedPolicyDocumentException + if *v == nil { + sv = &types.MalformedPolicyDocumentException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPreconditionNotMetException(v **types.PreconditionNotMetException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PreconditionNotMetException + if *v == nil { + sv = &types.PreconditionNotMetException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPublicPolicyException(v **types.PublicPolicyException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PublicPolicyException + if *v == nil { + sv = &types.PublicPolicyException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentReplicationStatusListType(v *[]types.ReplicationStatusType, 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.ReplicationStatusType + if *v == nil { + cv = []types.ReplicationStatusType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ReplicationStatusType + destAddr := &col + if err := awsAwsjson11_deserializeDocumentReplicationStatusType(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentReplicationStatusType(v **types.ReplicationStatusType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReplicationStatusType + if *v == nil { + sv = &types.ReplicationStatusType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "LastAccessedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusType to be of type string, got %T instead", value) + } + sv.Status = types.StatusType(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusMessageType to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceExistsException(v **types.ResourceExistsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceExistsException + if *v == nil { + sv = &types.ResourceExistsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRotationRulesType(v **types.RotationRulesType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RotationRulesType + if *v == nil { + sv = &types.RotationRulesType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AutomaticallyAfterDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AutomaticallyRotateAfterDaysType to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AutomaticallyAfterDays = ptr.Int64(i64) + } + + case "Duration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DurationType to be of type string, got %T instead", value) + } + sv.Duration = ptr.String(jtv) + } + + case "ScheduleExpression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleExpressionType to be of type string, got %T instead", value) + } + sv.ScheduleExpression = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SecretListEntry + if *v == nil { + sv = &types.SecretListEntry{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) + + } + } + + case "DeletedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DeletedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DescriptionType to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "KmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "LastAccessedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "LastChangedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastChangedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "LastRotatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastRotatedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "NextRotationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.NextRotationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected NextRotationDateType to be a JSON Number, got %T instead", value) + + } + } + + case "OwningService": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OwningServiceType to be of type string, got %T instead", value) + } + sv.OwningService = ptr.String(jtv) + } + + case "PrimaryRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) + } + sv.PrimaryRegion = ptr.String(jtv) + } + + case "RotationEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected RotationEnabledType to be of type *bool, got %T instead", value) + } + sv.RotationEnabled = ptr.Bool(jtv) + } + + case "RotationLambdaARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RotationLambdaARNType to be of type string, got %T instead", value) + } + sv.RotationLambdaARN = ptr.String(jtv) + } + + case "RotationRules": + if err := awsAwsjson11_deserializeDocumentRotationRulesType(&sv.RotationRules, value); err != nil { + return err + } + + case "SecretVersionsToStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionsToStagesMapType(&sv.SecretVersionsToStages, value); err != nil { + return err + } + + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagListType(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretListType(v *[]types.SecretListEntry, 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.SecretListEntry + if *v == nil { + cv = []types.SecretListEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SecretListEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSecretListEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretValueEntry(v **types.SecretValueEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SecretValueEntry + if *v == nil { + sv = &types.SecretValueEntry{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SecretBinary": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretBinaryType to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode SecretBinaryType, %w", err) + } + sv.SecretBinary = dv + } + + case "SecretString": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretStringType to be of type string, got %T instead", value) + } + sv.SecretString = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + case "VersionStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretValuesType(v *[]types.SecretValueEntry, 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.SecretValueEntry + if *v == nil { + cv = []types.SecretValueEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SecretValueEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSecretValueEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretVersionsListEntry(v **types.SecretVersionsListEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SecretVersionsListEntry + if *v == nil { + sv = &types.SecretVersionsListEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "KmsKeyIds": + if err := awsAwsjson11_deserializeDocumentKmsKeyIdListType(&sv.KmsKeyIds, value); err != nil { + return err + } + + case "LastAccessedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + case "VersionStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretVersionsListType(v *[]types.SecretVersionsListEntry, 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.SecretVersionsListEntry + if *v == nil { + cv = []types.SecretVersionsListEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SecretVersionsListEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSecretVersionsListEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretVersionStagesType(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 SecretVersionStageType to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretVersionsToStagesMapType(v *map[string][]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string][]string + if *v == nil { + mv = map[string][]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal []string + mapVar := parsedVal + if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKeyType to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValueType to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTagListType(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentValidationErrorsEntry(v **types.ValidationErrorsEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationErrorsEntry + if *v == nil { + sv = &types.ValidationErrorsEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CheckName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameType to be of type string, got %T instead", value) + } + sv.CheckName = ptr.String(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentValidationErrorsType(v *[]types.ValidationErrorsEntry, 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.ValidationErrorsEntry + if *v == nil { + cv = []types.ValidationErrorsEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationErrorsEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentValidationErrorsEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeOpDocumentBatchGetSecretValueOutput(v **BatchGetSecretValueOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchGetSecretValueOutput + if *v == nil { + sv = &BatchGetSecretValueOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Errors": + if err := awsAwsjson11_deserializeDocumentAPIErrorListType(&sv.Errors, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SecretValues": + if err := awsAwsjson11_deserializeDocumentSecretValuesType(&sv.SecretValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCancelRotateSecretOutput(v **CancelRotateSecretOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CancelRotateSecretOutput + if *v == nil { + sv = &CancelRotateSecretOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateSecretOutput(v **CreateSecretOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateSecretOutput + if *v == nil { + sv = &CreateSecretOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(v **DeleteResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteResourcePolicyOutput + if *v == nil { + sv = &DeleteResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteSecretOutput(v **DeleteSecretOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteSecretOutput + if *v == nil { + sv = &DeleteSecretOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "DeletionDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DeletionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DeletionDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeSecretOutput(v **DescribeSecretOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeSecretOutput + if *v == nil { + sv = &DescribeSecretOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) + + } + } + + case "DeletedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DeletedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DescriptionType to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "KmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "LastAccessedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "LastChangedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastChangedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "LastRotatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastRotatedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "NextRotationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.NextRotationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected NextRotationDateType to be a JSON Number, got %T instead", value) + + } + } + + case "OwningService": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OwningServiceType to be of type string, got %T instead", value) + } + sv.OwningService = ptr.String(jtv) + } + + case "PrimaryRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) + } + sv.PrimaryRegion = ptr.String(jtv) + } + + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + + case "RotationEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected RotationEnabledType to be of type *bool, got %T instead", value) + } + sv.RotationEnabled = ptr.Bool(jtv) + } + + case "RotationLambdaARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RotationLambdaARNType to be of type string, got %T instead", value) + } + sv.RotationLambdaARN = ptr.String(jtv) + } + + case "RotationRules": + if err := awsAwsjson11_deserializeDocumentRotationRulesType(&sv.RotationRules, value); err != nil { + return err + } + + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagListType(&sv.Tags, value); err != nil { + return err + } + + case "VersionIdsToStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionsToStagesMapType(&sv.VersionIdsToStages, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetRandomPasswordOutput(v **GetRandomPasswordOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetRandomPasswordOutput + if *v == nil { + sv = &GetRandomPasswordOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RandomPassword": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RandomPasswordType to be of type string, got %T instead", value) + } + sv.RandomPassword = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetResourcePolicyOutput + if *v == nil { + sv = &GetResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ResourcePolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyResourcePolicyType to be of type string, got %T instead", value) + } + sv.ResourcePolicy = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetSecretValueOutput(v **GetSecretValueOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSecretValueOutput + if *v == nil { + sv = &GetSecretValueOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SecretBinary": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretBinaryType to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode SecretBinaryType, %w", err) + } + sv.SecretBinary = dv + } + + case "SecretString": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretStringType to be of type string, got %T instead", value) + } + sv.SecretString = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + case "VersionStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListSecretsOutput(v **ListSecretsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSecretsOutput + if *v == nil { + sv = &ListSecretsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SecretList": + if err := awsAwsjson11_deserializeDocumentSecretListType(&sv.SecretList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListSecretVersionIdsOutput(v **ListSecretVersionIdsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSecretVersionIdsOutput + if *v == nil { + sv = &ListSecretVersionIdsOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Versions": + if err := awsAwsjson11_deserializeDocumentSecretVersionsListType(&sv.Versions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutResourcePolicyOutput + if *v == nil { + sv = &PutResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentPutSecretValueOutput(v **PutSecretValueOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutSecretValueOutput + if *v == nil { + sv = &PutSecretValueOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + case "VersionStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentRemoveRegionsFromReplicationOutput(v **RemoveRegionsFromReplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RemoveRegionsFromReplicationOutput + if *v == nil { + sv = &RemoveRegionsFromReplicationOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentReplicateSecretToRegionsOutput(v **ReplicateSecretToRegionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ReplicateSecretToRegionsOutput + if *v == nil { + sv = &ReplicateSecretToRegionsOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentRestoreSecretOutput(v **RestoreSecretOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RestoreSecretOutput + if *v == nil { + sv = &RestoreSecretOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentRotateSecretOutput(v **RotateSecretOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RotateSecretOutput + if *v == nil { + sv = &RotateSecretOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentStopReplicationToReplicaOutput(v **StopReplicationToReplicaOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StopReplicationToReplicaOutput + if *v == nil { + sv = &StopReplicationToReplicaOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateSecretOutput(v **UpdateSecretOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateSecretOutput + if *v == nil { + sv = &UpdateSecretOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateSecretVersionStageOutput(v **UpdateSecretVersionStageOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateSecretVersionStageOutput + if *v == nil { + sv = &UpdateSecretVersionStageOutput{} + } 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 SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentValidateResourcePolicyOutput(v **ValidateResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ValidateResourcePolicyOutput + if *v == nil { + sv = &ValidateResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PolicyValidationPassed": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanType to be of type *bool, got %T instead", value) + } + sv.PolicyValidationPassed = jtv + } + + case "ValidationErrors": + if err := awsAwsjson11_deserializeDocumentValidationErrorsType(&sv.ValidationErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type protocolErrorInfo struct { + Type string `json:"__type"` + Message string + Code any // nonstandard for awsjson but some services do present the type here +} + +func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) { + var errInfo protocolErrorInfo + if err := decoder.Decode(&errInfo); err != nil { + if err == io.EOF { + return errInfo, nil + } + return errInfo, err + } + + return errInfo, nil +} + +func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) { + if len(headerType) != 0 { + return headerType, true + } else if len(bodyInfo.Type) != 0 { + return bodyInfo.Type, true + } else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 { + return code, true + } + return "", false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go new file mode 100644 index 00000000..2d0ba2e6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go @@ -0,0 +1,45 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package secretsmanager provides the API client, operations, and parameter types +// for AWS Secrets Manager. +// +// # Amazon Web Services Secrets Manager +// +// Amazon Web Services Secrets Manager provides a service to enable you to store, +// manage, and retrieve, secrets. +// +// This guide provides descriptions of the Secrets Manager API. For more +// information about using this service, see the [Amazon Web Services Secrets Manager User Guide]. +// +// # API Version +// +// This version of the Secrets Manager API Reference documents the Secrets Manager +// API version 2017-10-17. +// +// For a list of endpoints, see [Amazon Web Services Secrets Manager endpoints]. +// +// # Support and Feedback for Amazon Web Services Secrets Manager +// +// We welcome your feedback. Send your comments to awssecretsmanager-feedback@amazon.com, or post your feedback and +// questions in the [Amazon Web Services Secrets Manager Discussion Forum]. For more information about the Amazon Web Services +// Discussion Forums, see [Forums Help]. +// +// # Logging API Requests +// +// Amazon Web Services Secrets Manager supports Amazon Web Services CloudTrail, a +// service that records Amazon Web Services API calls for your Amazon Web Services +// account and delivers log files to an Amazon S3 bucket. By using information +// that's collected by Amazon Web Services CloudTrail, you can determine the +// requests successfully made to Secrets Manager, who made the request, when it was +// made, and so on. For more about Amazon Web Services Secrets Manager and support +// for Amazon Web Services CloudTrail, see [Logging Amazon Web Services Secrets Manager Events with Amazon Web Services CloudTrail]in the Amazon Web Services Secrets +// Manager User Guide. To learn more about CloudTrail, including enabling it and +// find your log files, see the [Amazon Web Services CloudTrail User Guide]. +// +// [Forums Help]: http://forums.aws.amazon.com/help.jspa +// [Amazon Web Services CloudTrail User Guide]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html +// [Amazon Web Services Secrets Manager endpoints]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/asm_access.html#endpoints +// [Amazon Web Services Secrets Manager User Guide]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/introduction.html +// [Amazon Web Services Secrets Manager Discussion Forum]: http://forums.aws.amazon.com/forum.jspa?forumID=296 +// [Logging Amazon Web Services Secrets Manager Events with Amazon Web Services CloudTrail]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring.html#monitoring_cloudtrail +package secretsmanager diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go new file mode 100644 index 00000000..ce51d643 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go @@ -0,0 +1,611 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "secretsmanager" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SECRETS_MANAGER") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Secrets Manager", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + if "aws" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + if "aws" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-cn" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com.cn") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json new file mode 100644 index 00000000..b64ce162 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json @@ -0,0 +1,55 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_BatchGetSecretValue.go", + "api_op_CancelRotateSecret.go", + "api_op_CreateSecret.go", + "api_op_DeleteResourcePolicy.go", + "api_op_DeleteSecret.go", + "api_op_DescribeSecret.go", + "api_op_GetRandomPassword.go", + "api_op_GetResourcePolicy.go", + "api_op_GetSecretValue.go", + "api_op_ListSecretVersionIds.go", + "api_op_ListSecrets.go", + "api_op_PutResourcePolicy.go", + "api_op_PutSecretValue.go", + "api_op_RemoveRegionsFromReplication.go", + "api_op_ReplicateSecretToRegions.go", + "api_op_RestoreSecret.go", + "api_op_RotateSecret.go", + "api_op_StopReplicationToReplica.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateSecret.go", + "api_op_UpdateSecretVersionStage.go", + "api_op_ValidateResourcePolicy.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/secretsmanager", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go new file mode 100644 index 00000000..a49b8bfe --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package secretsmanager + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.29.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go new file mode 100644 index 00000000..4181a93f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go @@ -0,0 +1,650 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Secrets Manager endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-west-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-2-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-2-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-north-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + Variant: endpoints.DualStackVariant, + }: {}, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-east-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-west-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/options.go new file mode 100644 index 00000000..7f022a39 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/options.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go new file mode 100644 index 00000000..564feb18 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go @@ -0,0 +1,2012 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsjson11_serializeOpBatchGetSecretValue struct { +} + +func (*awsAwsjson11_serializeOpBatchGetSecretValue) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchGetSecretValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetSecretValueInput) + _ = 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("secretsmanager.BatchGetSecretValue") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchGetSecretValueInput(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_serializeOpCancelRotateSecret struct { +} + +func (*awsAwsjson11_serializeOpCancelRotateSecret) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCancelRotateSecret) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CancelRotateSecretInput) + _ = 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("secretsmanager.CancelRotateSecret") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCancelRotateSecretInput(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_serializeOpCreateSecret struct { +} + +func (*awsAwsjson11_serializeOpCreateSecret) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateSecret) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSecretInput) + _ = 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("secretsmanager.CreateSecret") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateSecretInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpDeleteResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.DeleteResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpDeleteSecret struct { +} + +func (*awsAwsjson11_serializeOpDeleteSecret) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteSecret) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSecretInput) + _ = 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("secretsmanager.DeleteSecret") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteSecretInput(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_serializeOpDescribeSecret struct { +} + +func (*awsAwsjson11_serializeOpDescribeSecret) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeSecret) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeSecretInput) + _ = 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("secretsmanager.DescribeSecret") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeSecretInput(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_serializeOpGetRandomPassword struct { +} + +func (*awsAwsjson11_serializeOpGetRandomPassword) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetRandomPassword) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetRandomPasswordInput) + _ = 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("secretsmanager.GetRandomPassword") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetRandomPasswordInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpGetResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.GetResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetSecretValue struct { +} + +func (*awsAwsjson11_serializeOpGetSecretValue) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetSecretValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSecretValueInput) + _ = 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("secretsmanager.GetSecretValue") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetSecretValueInput(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_serializeOpListSecrets struct { +} + +func (*awsAwsjson11_serializeOpListSecrets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListSecrets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSecretsInput) + _ = 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("secretsmanager.ListSecrets") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListSecretsInput(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_serializeOpListSecretVersionIds struct { +} + +func (*awsAwsjson11_serializeOpListSecretVersionIds) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListSecretVersionIds) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSecretVersionIdsInput) + _ = 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("secretsmanager.ListSecretVersionIds") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListSecretVersionIdsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpPutResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.PutResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpPutSecretValue struct { +} + +func (*awsAwsjson11_serializeOpPutSecretValue) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutSecretValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutSecretValueInput) + _ = 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("secretsmanager.PutSecretValue") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutSecretValueInput(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_serializeOpRemoveRegionsFromReplication struct { +} + +func (*awsAwsjson11_serializeOpRemoveRegionsFromReplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRemoveRegionsFromReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveRegionsFromReplicationInput) + _ = 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("secretsmanager.RemoveRegionsFromReplication") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRemoveRegionsFromReplicationInput(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_serializeOpReplicateSecretToRegions struct { +} + +func (*awsAwsjson11_serializeOpReplicateSecretToRegions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpReplicateSecretToRegions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ReplicateSecretToRegionsInput) + _ = 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("secretsmanager.ReplicateSecretToRegions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentReplicateSecretToRegionsInput(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_serializeOpRestoreSecret struct { +} + +func (*awsAwsjson11_serializeOpRestoreSecret) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRestoreSecret) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreSecretInput) + _ = 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("secretsmanager.RestoreSecret") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRestoreSecretInput(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_serializeOpRotateSecret struct { +} + +func (*awsAwsjson11_serializeOpRotateSecret) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRotateSecret) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RotateSecretInput) + _ = 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("secretsmanager.RotateSecret") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRotateSecretInput(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_serializeOpStopReplicationToReplica struct { +} + +func (*awsAwsjson11_serializeOpStopReplicationToReplica) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStopReplicationToReplica) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StopReplicationToReplicaInput) + _ = 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("secretsmanager.StopReplicationToReplica") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStopReplicationToReplicaInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpTagResource struct { +} + +func (*awsAwsjson11_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.TagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUntagResource struct { +} + +func (*awsAwsjson11_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUpdateSecret struct { +} + +func (*awsAwsjson11_serializeOpUpdateSecret) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateSecret) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSecretInput) + _ = 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("secretsmanager.UpdateSecret") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateSecretInput(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_serializeOpUpdateSecretVersionStage struct { +} + +func (*awsAwsjson11_serializeOpUpdateSecretVersionStage) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateSecretVersionStage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSecretVersionStageInput) + _ = 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("secretsmanager.UpdateSecretVersionStage") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateSecretVersionStageInput(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_serializeOpValidateResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpValidateResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpValidateResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ValidateResourcePolicyInput) + _ = 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("secretsmanager.ValidateResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentValidateResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsAwsjson11_serializeDocumentAddReplicaRegionListType(v []types.ReplicaRegionType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentReplicaRegionType(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Key) > 0 { + ok := object.Key("Key") + ok.String(string(v.Key)) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsAwsjson11_serializeDocumentFilterValuesStringList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentFiltersListType(v []types.Filter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentFilterValuesStringList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentRemoveReplicaRegionListType(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentReplicaRegionType(v *types.ReplicaRegionType, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyId != nil { + ok := object.Key("KmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.Region != nil { + ok := object.Key("Region") + ok.String(*v.Region) + } + + return nil +} + +func awsAwsjson11_serializeDocumentRotationRulesType(v *types.RotationRulesType, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutomaticallyAfterDays != nil { + ok := object.Key("AutomaticallyAfterDays") + ok.Long(*v.AutomaticallyAfterDays) + } + + if v.Duration != nil { + ok := object.Key("Duration") + ok.String(*v.Duration) + } + + if v.ScheduleExpression != nil { + ok := object.Key("ScheduleExpression") + ok.String(*v.ScheduleExpression) + } + + return nil +} + +func awsAwsjson11_serializeDocumentSecretIdListType(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentSecretVersionStagesType(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentTagKeyListType(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagListType(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeOpDocumentBatchGetSecretValueInput(v *BatchGetSecretValueInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentFiltersListType(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.SecretIdList != nil { + ok := object.Key("SecretIdList") + if err := awsAwsjson11_serializeDocumentSecretIdListType(v.SecretIdList, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCancelRotateSecretInput(v *CancelRotateSecretInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateSecretInput(v *CreateSecretInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddReplicaRegions != nil { + ok := object.Key("AddReplicaRegions") + if err := awsAwsjson11_serializeDocumentAddReplicaRegionListType(v.AddReplicaRegions, ok); err != nil { + return err + } + } + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.ForceOverwriteReplicaSecret { + ok := object.Key("ForceOverwriteReplicaSecret") + ok.Boolean(v.ForceOverwriteReplicaSecret) + } + + if v.KmsKeyId != nil { + ok := object.Key("KmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.SecretBinary != nil { + ok := object.Key("SecretBinary") + ok.Base64EncodeBytes(v.SecretBinary) + } + + if v.SecretString != nil { + ok := object.Key("SecretString") + ok.String(*v.SecretString) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagListType(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteSecretInput(v *DeleteSecretInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ForceDeleteWithoutRecovery != nil { + ok := object.Key("ForceDeleteWithoutRecovery") + ok.Boolean(*v.ForceDeleteWithoutRecovery) + } + + if v.RecoveryWindowInDays != nil { + ok := object.Key("RecoveryWindowInDays") + ok.Long(*v.RecoveryWindowInDays) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDescribeSecretInput(v *DescribeSecretInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetRandomPasswordInput(v *GetRandomPasswordInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExcludeCharacters != nil { + ok := object.Key("ExcludeCharacters") + ok.String(*v.ExcludeCharacters) + } + + if v.ExcludeLowercase != nil { + ok := object.Key("ExcludeLowercase") + ok.Boolean(*v.ExcludeLowercase) + } + + if v.ExcludeNumbers != nil { + ok := object.Key("ExcludeNumbers") + ok.Boolean(*v.ExcludeNumbers) + } + + if v.ExcludePunctuation != nil { + ok := object.Key("ExcludePunctuation") + ok.Boolean(*v.ExcludePunctuation) + } + + if v.ExcludeUppercase != nil { + ok := object.Key("ExcludeUppercase") + ok.Boolean(*v.ExcludeUppercase) + } + + if v.IncludeSpace != nil { + ok := object.Key("IncludeSpace") + ok.Boolean(*v.IncludeSpace) + } + + if v.PasswordLength != nil { + ok := object.Key("PasswordLength") + ok.Long(*v.PasswordLength) + } + + if v.RequireEachIncludedType != nil { + ok := object.Key("RequireEachIncludedType") + ok.Boolean(*v.RequireEachIncludedType) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetResourcePolicyInput(v *GetResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetSecretValueInput(v *GetSecretValueInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + if v.VersionId != nil { + ok := object.Key("VersionId") + ok.String(*v.VersionId) + } + + if v.VersionStage != nil { + ok := object.Key("VersionStage") + ok.String(*v.VersionStage) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListSecretsInput(v *ListSecretsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentFiltersListType(v.Filters, ok); err != nil { + return err + } + } + + if v.IncludePlannedDeletion != nil { + ok := object.Key("IncludePlannedDeletion") + ok.Boolean(*v.IncludePlannedDeletion) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("SortOrder") + ok.String(string(v.SortOrder)) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListSecretVersionIdsInput(v *ListSecretVersionIdsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IncludeDeprecated != nil { + ok := object.Key("IncludeDeprecated") + ok.Boolean(*v.IncludeDeprecated) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BlockPublicPolicy != nil { + ok := object.Key("BlockPublicPolicy") + ok.Boolean(*v.BlockPublicPolicy) + } + + if v.ResourcePolicy != nil { + ok := object.Key("ResourcePolicy") + ok.String(*v.ResourcePolicy) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentPutSecretValueInput(v *PutSecretValueInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.SecretBinary != nil { + ok := object.Key("SecretBinary") + ok.Base64EncodeBytes(v.SecretBinary) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + if v.SecretString != nil { + ok := object.Key("SecretString") + ok.String(*v.SecretString) + } + + if v.VersionStages != nil { + ok := object.Key("VersionStages") + if err := awsAwsjson11_serializeDocumentSecretVersionStagesType(v.VersionStages, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentRemoveRegionsFromReplicationInput(v *RemoveRegionsFromReplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RemoveReplicaRegions != nil { + ok := object.Key("RemoveReplicaRegions") + if err := awsAwsjson11_serializeDocumentRemoveReplicaRegionListType(v.RemoveReplicaRegions, ok); err != nil { + return err + } + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentReplicateSecretToRegionsInput(v *ReplicateSecretToRegionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddReplicaRegions != nil { + ok := object.Key("AddReplicaRegions") + if err := awsAwsjson11_serializeDocumentAddReplicaRegionListType(v.AddReplicaRegions, ok); err != nil { + return err + } + } + + if v.ForceOverwriteReplicaSecret { + ok := object.Key("ForceOverwriteReplicaSecret") + ok.Boolean(v.ForceOverwriteReplicaSecret) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentRestoreSecretInput(v *RestoreSecretInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentRotateSecretInput(v *RotateSecretInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.RotateImmediately != nil { + ok := object.Key("RotateImmediately") + ok.Boolean(*v.RotateImmediately) + } + + if v.RotationLambdaARN != nil { + ok := object.Key("RotationLambdaARN") + ok.String(*v.RotationLambdaARN) + } + + if v.RotationRules != nil { + ok := object.Key("RotationRules") + if err := awsAwsjson11_serializeDocumentRotationRulesType(v.RotationRules, ok); err != nil { + return err + } + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentStopReplicationToReplicaInput(v *StopReplicationToReplicaInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagListType(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson11_serializeDocumentTagKeyListType(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateSecretInput(v *UpdateSecretInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.KmsKeyId != nil { + ok := object.Key("KmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.SecretBinary != nil { + ok := object.Key("SecretBinary") + ok.Base64EncodeBytes(v.SecretBinary) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + if v.SecretString != nil { + ok := object.Key("SecretString") + ok.String(*v.SecretString) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateSecretVersionStageInput(v *UpdateSecretVersionStageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MoveToVersionId != nil { + ok := object.Key("MoveToVersionId") + ok.String(*v.MoveToVersionId) + } + + if v.RemoveFromVersionId != nil { + ok := object.Key("RemoveFromVersionId") + ok.String(*v.RemoveFromVersionId) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + if v.VersionStage != nil { + ok := object.Key("VersionStage") + ok.String(*v.VersionStage) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentValidateResourcePolicyInput(v *ValidateResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourcePolicy != nil { + ok := object.Key("ResourcePolicy") + ok.String(*v.ResourcePolicy) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go new file mode 100644 index 00000000..e458ec8f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go @@ -0,0 +1,72 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type FilterNameStringType string + +// Enum values for FilterNameStringType +const ( + FilterNameStringTypeDescription FilterNameStringType = "description" + FilterNameStringTypeName FilterNameStringType = "name" + FilterNameStringTypeTagKey FilterNameStringType = "tag-key" + FilterNameStringTypeTagValue FilterNameStringType = "tag-value" + FilterNameStringTypePrimaryRegion FilterNameStringType = "primary-region" + FilterNameStringTypeOwningService FilterNameStringType = "owning-service" + FilterNameStringTypeAll FilterNameStringType = "all" +) + +// Values returns all known values for FilterNameStringType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FilterNameStringType) Values() []FilterNameStringType { + return []FilterNameStringType{ + "description", + "name", + "tag-key", + "tag-value", + "primary-region", + "owning-service", + "all", + } +} + +type SortOrderType string + +// Enum values for SortOrderType +const ( + SortOrderTypeAsc SortOrderType = "asc" + SortOrderTypeDesc SortOrderType = "desc" +) + +// Values returns all known values for SortOrderType. Note that this can be +// expanded in the future, and 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 (SortOrderType) Values() []SortOrderType { + return []SortOrderType{ + "asc", + "desc", + } +} + +type StatusType string + +// Enum values for StatusType +const ( + StatusTypeInSync StatusType = "InSync" + StatusTypeFailed StatusType = "Failed" + StatusTypeInProgress StatusType = "InProgress" +) + +// Values returns all known values for StatusType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (StatusType) Values() []StatusType { + return []StatusType{ + "InSync", + "Failed", + "InProgress", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go new file mode 100644 index 00000000..09c59ed1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go @@ -0,0 +1,339 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Secrets Manager can't decrypt the protected secret text using the provided KMS +// key. +type DecryptionFailure struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DecryptionFailure) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DecryptionFailure) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DecryptionFailure) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DecryptionFailure" + } + return *e.ErrorCodeOverride +} +func (e *DecryptionFailure) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Secrets Manager can't encrypt the protected secret text using the provided KMS +// key. Check that the KMS key is available, enabled, and not in an invalid state. +// For more information, see [Key state: Effect on your KMS key]. +// +// [Key state: Effect on your KMS key]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html +type EncryptionFailure struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EncryptionFailure) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EncryptionFailure) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EncryptionFailure) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EncryptionFailure" + } + return *e.ErrorCodeOverride +} +func (e *EncryptionFailure) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An error occurred on the server side. +type InternalServiceError struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServiceError) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServiceError) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServiceError) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServiceError" + } + return *e.ErrorCodeOverride +} +func (e *InternalServiceError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The NextToken value is invalid. +type InvalidNextTokenException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidNextTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidNextTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidNextTokenException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidNextTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The parameter name or value is invalid. +type InvalidParameterException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidParameterException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidParameterException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidParameterException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A parameter value is not valid for the current state of the resource. +// +// Possible causes: +// +// - The secret is scheduled for deletion. +// +// - You tried to enable rotation on a secret that doesn't already have a Lambda +// function ARN configured and you didn't include such an ARN as a parameter in +// this call. +// +// - The secret is managed by another service, and you must use that service to +// update it. For more information, see [Secrets managed by other Amazon Web Services services]. +// +// [Secrets managed by other Amazon Web Services services]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html +type InvalidRequestException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed because it would exceed one of the Secrets Manager quotas. +type LimitExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *LimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *LimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "LimitExceededException" + } + return *e.ErrorCodeOverride +} +func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource policy has syntax errors. +type MalformedPolicyDocumentException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *MalformedPolicyDocumentException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *MalformedPolicyDocumentException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *MalformedPolicyDocumentException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MalformedPolicyDocumentException" + } + return *e.ErrorCodeOverride +} +func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed because you did not complete all the prerequisite steps. +type PreconditionNotMetException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *PreconditionNotMetException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PreconditionNotMetException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PreconditionNotMetException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PreconditionNotMetException" + } + return *e.ErrorCodeOverride +} +func (e *PreconditionNotMetException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The BlockPublicPolicy parameter is set to true, and the resource policy did not +// prevent broad access to the secret. +type PublicPolicyException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *PublicPolicyException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PublicPolicyException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PublicPolicyException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PublicPolicyException" + } + return *e.ErrorCodeOverride +} +func (e *PublicPolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A resource with the ID you requested already exists. +type ResourceExistsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceExistsException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Secrets Manager can't find the resource that you asked for. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go new file mode 100644 index 00000000..7b848975 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go @@ -0,0 +1,321 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// The error Secrets Manager encountered while retrieving an individual secret as +// part of BatchGetSecretValue. +type APIErrorType struct { + + // The error Secrets Manager encountered while retrieving an individual secret as + // part of BatchGetSecretValue, for example ResourceNotFoundException , InvalidParameterException , + // InvalidRequestException , DecryptionFailure , or AccessDeniedException . + ErrorCode *string + + // A message describing the error. + Message *string + + // The ARN or name of the secret. + SecretId *string + + noSmithyDocumentSerde +} + +// Allows you to add filters when you use the search function in Secrets Manager. +// For more information, see [Find secrets in Secrets Manager]. +// +// [Find secrets in Secrets Manager]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html +type Filter struct { + + // The following are keys you can use: + // + // - description: Prefix match, not case-sensitive. + // + // - name: Prefix match, case-sensitive. + // + // - tag-key: Prefix match, case-sensitive. + // + // - tag-value: Prefix match, case-sensitive. + // + // - primary-region: Prefix match, case-sensitive. + // + // - owning-service: Prefix match, case-sensitive. + // + // - all: Breaks the filter value string into words and then searches all + // attributes for matches. Not case-sensitive. + Key FilterNameStringType + + // The keyword to filter for. + // + // You can prefix your search value with an exclamation mark ( ! ) in order to + // perform negation filters. + Values []string + + noSmithyDocumentSerde +} + +// A custom type that specifies a Region and the KmsKeyId for a replica secret. +type ReplicaRegionType struct { + + // The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't + // include this field, Secrets Manager uses aws/secretsmanager . + KmsKeyId *string + + // A Region code. For a list of Region codes, see [Name and code of Regions]. + // + // [Name and code of Regions]: https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints + Region *string + + noSmithyDocumentSerde +} + +// A replication object consisting of a RegionReplicationStatus object and +// includes a Region, KMSKeyId, status, and status message. +type ReplicationStatusType struct { + + // Can be an ARN , Key ID , or Alias . + KmsKeyId *string + + // The date that the secret was last accessed in the Region. This field is omitted + // if the secret has never been retrieved in the Region. + LastAccessedDate *time.Time + + // The Region where replication occurs. + Region *string + + // The status can be InProgress , Failed , or InSync . + Status StatusType + + // Status message such as "Secret with this name already exists in this region". + StatusMessage *string + + noSmithyDocumentSerde +} + +// A structure that defines the rotation configuration for the secret. +type RotationRulesType struct { + + // The number of days between rotations of the secret. You can use this value to + // check that your secret meets your compliance guidelines for how often secrets + // must be rotated. If you use this field to set the rotation schedule, Secrets + // Manager calculates the next rotation date based on the previous rotation. + // Manually updating the secret value by calling PutSecretValue or UpdateSecret is + // considered a valid rotation. + // + // In DescribeSecret and ListSecrets , this value is calculated from the rotation + // schedule after every successful rotation. In RotateSecret , you can set the + // rotation schedule in RotationRules with AutomaticallyAfterDays or + // ScheduleExpression , but not both. To set a rotation schedule in hours, use + // ScheduleExpression . + AutomaticallyAfterDays *int64 + + // The length of the rotation window in hours, for example 3h for a three hour + // window. Secrets Manager rotates your secret at any time during this window. The + // window must not extend into the next rotation window or the next UTC day. The + // window starts according to the ScheduleExpression . If you don't specify a + // Duration , for a ScheduleExpression in hours, the window automatically closes + // after one hour. For a ScheduleExpression in days, the window automatically + // closes at the end of the UTC day. For more information, including examples, see [Schedule expressions in Secrets Manager rotation] + // in the Secrets Manager Users Guide. + // + // [Schedule expressions in Secrets Manager rotation]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html + Duration *string + + // A cron() or rate() expression that defines the schedule for rotating your + // secret. Secrets Manager rotation schedules use UTC time zone. Secrets Manager + // rotates your secret any time during a rotation window. + // + // Secrets Manager rate() expressions represent the interval in hours or days that + // you want to rotate your secret, for example rate(12 hours) or rate(10 days) . + // You can rotate a secret as often as every four hours. If you use a rate() + // expression, the rotation window starts at midnight. For a rate in hours, the + // default rotation window closes after one hour. For a rate in days, the default + // rotation window closes at the end of the day. You can set the Duration to + // change the rotation window. The rotation window must not extend into the next + // UTC day or into the next rotation window. + // + // You can use a cron() expression to create a rotation schedule that is more + // detailed than a rotation interval. For more information, including examples, see + // [Schedule expressions in Secrets Manager rotation]in the Secrets Manager Users Guide. For a cron expression that represents a + // schedule in hours, the default rotation window closes after one hour. For a cron + // expression that represents a schedule in days, the default rotation window + // closes at the end of the day. You can set the Duration to change the rotation + // window. The rotation window must not extend into the next UTC day or into the + // next rotation window. + // + // [Schedule expressions in Secrets Manager rotation]: https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html + ScheduleExpression *string + + noSmithyDocumentSerde +} + +// A structure that contains the details about a secret. It does not include the +// encrypted SecretString and SecretBinary values. To get those values, use [GetSecretValue] . +// +// [GetSecretValue]: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html +type SecretListEntry struct { + + // The Amazon Resource Name (ARN) of the secret. + ARN *string + + // The date and time when a secret was created. + CreatedDate *time.Time + + // The date and time the deletion of the secret occurred. Not present on active + // secrets. The secret can be recovered until the number of days in the recovery + // window has passed, as specified in the RecoveryWindowInDays parameter of the [DeleteSecret] + // DeleteSecret operation. + // + // [DeleteSecret]: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html + DeletedDate *time.Time + + // The user-provided description of the secret. + Description *string + + // The ARN of the KMS key that Secrets Manager uses to encrypt the secret value. + // If the secret is encrypted with the Amazon Web Services managed key + // aws/secretsmanager , this field is omitted. + KmsKeyId *string + + // The date that the secret was last accessed in the Region. This field is omitted + // if the secret has never been retrieved in the Region. + LastAccessedDate *time.Time + + // The last date and time that this secret was modified in any way. + LastChangedDate *time.Time + + // The most recent date and time that the Secrets Manager rotation process was + // successfully completed. This value is null if the secret hasn't ever rotated. + LastRotatedDate *time.Time + + // The friendly name of the secret. + Name *string + + // The next rotation is scheduled to occur on or before this date. If the secret + // isn't configured for rotation or rotation has been disabled, Secrets Manager + // returns null. + NextRotationDate *time.Time + + // Returns the name of the service that created the secret. + OwningService *string + + // The Region where Secrets Manager originated the secret. + PrimaryRegion *string + + // Indicates whether automatic, scheduled rotation is enabled for this secret. + RotationEnabled *bool + + // The ARN of an Amazon Web Services Lambda function invoked by Secrets Manager to + // rotate and expire the secret either automatically per the schedule or manually + // by a call to [RotateSecret]RotateSecret . + // + // [RotateSecret]: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html + RotationLambdaARN *string + + // A structure that defines the rotation configuration for the secret. + RotationRules *RotationRulesType + + // A list of all of the currently assigned SecretVersionStage staging labels and + // the SecretVersionId attached to each one. Staging labels are used to keep track + // of the different versions during the rotation process. + // + // A version that does not have any SecretVersionStage is considered deprecated + // and subject to deletion. Such versions are not included in this list. + SecretVersionsToStages map[string][]string + + // The list of user-defined tags associated with the secret. To add tags to a + // secret, use [TagResource]TagResource . To remove tags, use [UntagResource]UntagResource . + // + // [TagResource]: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html + // [UntagResource]: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html + Tags []Tag + + noSmithyDocumentSerde +} + +// A structure that contains the secret value and other details for a secret. +type SecretValueEntry struct { + + // The Amazon Resource Name (ARN) of the secret. + ARN *string + + // The date the secret was created. + CreatedDate *time.Time + + // The friendly name of the secret. + Name *string + + // The decrypted secret value, if the secret value was originally provided as + // binary data in the form of a byte array. The parameter represents the binary + // data as a [base64-encoded]string. + // + // [base64-encoded]: https://tools.ietf.org/html/rfc4648#section-4 + SecretBinary []byte + + // The decrypted secret value, if the secret value was originally provided as a + // string or through the Secrets Manager console. + SecretString *string + + // The unique version identifier of this version of the secret. + VersionId *string + + // A list of all of the staging labels currently attached to this version of the + // secret. + VersionStages []string + + noSmithyDocumentSerde +} + +// A structure that contains information about one version of a secret. +type SecretVersionsListEntry struct { + + // The date and time this version of the secret was created. + CreatedDate *time.Time + + // The KMS keys used to encrypt the secret version. + KmsKeyIds []string + + // The date that this version of the secret was last accessed. Note that the + // resolution of this field is at the date level and does not include the time. + LastAccessedDate *time.Time + + // The unique version identifier of this version of the secret. + VersionId *string + + // An array of staging labels that are currently associated with this version of + // the secret. + VersionStages []string + + noSmithyDocumentSerde +} + +// A structure that contains information about a tag. +type Tag struct { + + // The key identifier, or name, of the tag. + Key *string + + // The string value associated with the key of the tag. + Value *string + + noSmithyDocumentSerde +} + +// Displays errors that occurred during validation of the resource policy. +type ValidationErrorsEntry struct { + + // Checks the name of the policy. + CheckName *string + + // Displays error messages if validation encounters problems during validation of + // the resource policy. + ErrorMessage *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go new file mode 100644 index 00000000..90159c6c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go @@ -0,0 +1,808 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCancelRotateSecret struct { +} + +func (*validateOpCancelRotateSecret) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelRotateSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelRotateSecretInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelRotateSecretInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSecret struct { +} + +func (*validateOpCreateSecret) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSecretInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSecretInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteResourcePolicy struct { +} + +func (*validateOpDeleteResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSecret struct { +} + +func (*validateOpDeleteSecret) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSecretInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSecretInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeSecret struct { +} + +func (*validateOpDescribeSecret) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeSecretInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeSecretInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetResourcePolicy struct { +} + +func (*validateOpGetResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSecretValue struct { +} + +func (*validateOpGetSecretValue) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSecretValue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSecretValueInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSecretValueInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListSecretVersionIds struct { +} + +func (*validateOpListSecretVersionIds) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSecretVersionIds) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSecretVersionIdsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSecretVersionIdsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutResourcePolicy struct { +} + +func (*validateOpPutResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutSecretValue struct { +} + +func (*validateOpPutSecretValue) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutSecretValue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutSecretValueInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutSecretValueInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRemoveRegionsFromReplication struct { +} + +func (*validateOpRemoveRegionsFromReplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveRegionsFromReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveRegionsFromReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveRegionsFromReplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpReplicateSecretToRegions struct { +} + +func (*validateOpReplicateSecretToRegions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpReplicateSecretToRegions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ReplicateSecretToRegionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpReplicateSecretToRegionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreSecret struct { +} + +func (*validateOpRestoreSecret) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreSecretInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreSecretInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRotateSecret struct { +} + +func (*validateOpRotateSecret) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRotateSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RotateSecretInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRotateSecretInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopReplicationToReplica struct { +} + +func (*validateOpStopReplicationToReplica) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopReplicationToReplica) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopReplicationToReplicaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopReplicationToReplicaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSecret struct { +} + +func (*validateOpUpdateSecret) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSecretInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSecretInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSecretVersionStage struct { +} + +func (*validateOpUpdateSecretVersionStage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSecretVersionStage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSecretVersionStageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSecretVersionStageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpValidateResourcePolicy struct { +} + +func (*validateOpValidateResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpValidateResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ValidateResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpValidateResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCancelRotateSecretValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelRotateSecret{}, middleware.After) +} + +func addOpCreateSecretValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSecret{}, middleware.After) +} + +func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) +} + +func addOpDeleteSecretValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSecret{}, middleware.After) +} + +func addOpDescribeSecretValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeSecret{}, middleware.After) +} + +func addOpGetResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourcePolicy{}, middleware.After) +} + +func addOpGetSecretValueValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSecretValue{}, middleware.After) +} + +func addOpListSecretVersionIdsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSecretVersionIds{}, middleware.After) +} + +func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) +} + +func addOpPutSecretValueValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutSecretValue{}, middleware.After) +} + +func addOpRemoveRegionsFromReplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveRegionsFromReplication{}, middleware.After) +} + +func addOpReplicateSecretToRegionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpReplicateSecretToRegions{}, middleware.After) +} + +func addOpRestoreSecretValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreSecret{}, middleware.After) +} + +func addOpRotateSecretValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRotateSecret{}, middleware.After) +} + +func addOpStopReplicationToReplicaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopReplicationToReplica{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateSecretValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSecret{}, middleware.After) +} + +func addOpUpdateSecretVersionStageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSecretVersionStage{}, middleware.After) +} + +func addOpValidateResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpValidateResourcePolicy{}, middleware.After) +} + +func validateOpCancelRotateSecretInput(v *CancelRotateSecretInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelRotateSecretInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSecretInput(v *CreateSecretInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSecretInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSecretInput(v *DeleteSecretInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSecretInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeSecretInput(v *DescribeSecretInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeSecretInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetResourcePolicyInput(v *GetResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourcePolicyInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSecretValueInput(v *GetSecretValueInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSecretValueInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListSecretVersionIdsInput(v *ListSecretVersionIdsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSecretVersionIdsInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.ResourcePolicy == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourcePolicy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutSecretValueInput(v *PutSecretValueInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutSecretValueInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveRegionsFromReplicationInput(v *RemoveRegionsFromReplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveRegionsFromReplicationInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.RemoveReplicaRegions == nil { + invalidParams.Add(smithy.NewErrParamRequired("RemoveReplicaRegions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpReplicateSecretToRegionsInput(v *ReplicateSecretToRegionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReplicateSecretToRegionsInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.AddReplicaRegions == nil { + invalidParams.Add(smithy.NewErrParamRequired("AddReplicaRegions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreSecretInput(v *RestoreSecretInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreSecretInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRotateSecretInput(v *RotateSecretInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RotateSecretInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopReplicationToReplicaInput(v *StopReplicationToReplicaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopReplicationToReplicaInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSecretInput(v *UpdateSecretInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSecretInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSecretVersionStageInput(v *UpdateSecretVersionStageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSecretVersionStageInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.VersionStage == nil { + invalidParams.Add(smithy.NewErrParamRequired("VersionStage")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpValidateResourcePolicyInput(v *ValidateResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ValidateResourcePolicyInput"} + if v.ResourcePolicy == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourcePolicy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/CHANGELOG.md new file mode 100644 index 00000000..b3b240c0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/CHANGELOG.md @@ -0,0 +1,408 @@ +# v1.22.9 (2024-05-23) + +* No change notes available for this release. + +# v1.22.8 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.7 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.6 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.22.5 (2024-04-25) + +* No change notes available for this release. + +# v1.22.4 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.3 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.2 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.1 (2024-02-23) + +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.21.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.21.0 (2024-02-16) + +* **Feature**: Add new ClientOptions field to waiter config which allows you to extend the config for operation calls made by waiters. + +# v1.20.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.6 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.19.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.19.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.4 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.18.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2023-09-27) + +* No change notes available for this release. + +# v1.16.7 (2023-08-25) + +* No change notes available for this release. + +# v1.16.6 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.4 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2023-08-11) + +* **Documentation**: Doc only updates to include: 1) Clarified which part of an email address where it's okay to have Punycode when it contains non-ASCII characters for the SendRawEmail action and other actions where this is applicable. 2) Updated S3Action description with new MB max bucket size from 30 to 40. + +# v1.16.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2023-08-01) + +* No change notes available for this release. + +# v1.16.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.13 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.12 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.11 (2023-06-15) + +* No change notes available for this release. + +# v1.15.10 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.9 (2023-05-04) + +* No change notes available for this release. + +# v1.15.8 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.7 (2023-04-10) + +* No change notes available for this release. + +# v1.15.6 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.5 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.4 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.15.2 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization. + +# v1.15.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.14.23 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.22 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.21 (2022-11-11) + +* No change notes available for this release. + +# v1.14.20 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.19 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.18 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.17 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.16 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.15 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.14 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.13 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.12 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.11 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.10 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.9 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.8 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.7 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2022-05-24) + +* No change notes available for this release. + +# v1.14.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. + +# v1.9.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. +* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature. + +# v1.8.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.2 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-07-15) + +* **Feature**: The ErrorCode method on generated service error types has been corrected to match the API model. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-06-25) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_client.go new file mode 100644 index 00000000..50168ff8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_client.go @@ -0,0 +1,538 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "SES" +const ServiceAPIVersion = "2010-12-01" + +// Client provides the API client to make operations call for Amazon Simple Email +// Service. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ses", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CloneReceiptRuleSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CloneReceiptRuleSet.go new file mode 100644 index 00000000..0c1b681d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CloneReceiptRuleSet.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a receipt rule set by cloning an existing one. All receipt rules and +// configurations are copied to the new receipt rule set and are completely +// independent of the source rule set. +// +// For information about setting up rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html#receiving-email-concepts-rules +func (c *Client) CloneReceiptRuleSet(ctx context.Context, params *CloneReceiptRuleSetInput, optFns ...func(*Options)) (*CloneReceiptRuleSetOutput, error) { + if params == nil { + params = &CloneReceiptRuleSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CloneReceiptRuleSet", params, optFns, c.addOperationCloneReceiptRuleSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CloneReceiptRuleSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create a receipt rule set by cloning an existing one. +// You use receipt rule sets to receive email with Amazon SES. For more +// information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type CloneReceiptRuleSetInput struct { + + // The name of the rule set to clone. + // + // This member is required. + OriginalRuleSetName *string + + // The name of the rule set to create. The name must meet the following + // requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or + // dashes (-). + // + // - Start and end with a letter or number. + // + // - Contain 64 characters or fewer. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type CloneReceiptRuleSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCloneReceiptRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCloneReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCloneReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CloneReceiptRuleSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCloneReceiptRuleSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCloneReceiptRuleSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCloneReceiptRuleSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CloneReceiptRuleSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSet.go new file mode 100644 index 00000000..9add9298 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSet.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a configuration set. +// +// Configuration sets enable you to publish email sending events. For information +// about using configuration sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +func (c *Client) CreateConfigurationSet(ctx context.Context, params *CreateConfigurationSetInput, optFns ...func(*Options)) (*CreateConfigurationSetOutput, error) { + if params == nil { + params = &CreateConfigurationSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateConfigurationSet", params, optFns, c.addOperationCreateConfigurationSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateConfigurationSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create a configuration set. Configuration sets enable +// you to publish email sending events. For information about using configuration +// sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type CreateConfigurationSetInput struct { + + // A data structure that contains the name of the configuration set. + // + // This member is required. + ConfigurationSet *types.ConfigurationSet + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type CreateConfigurationSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateConfigurationSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateConfigurationSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateConfigurationSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateConfigurationSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateConfigurationSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConfigurationSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateConfigurationSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateConfigurationSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetEventDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetEventDestination.go new file mode 100644 index 00000000..d375800e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetEventDestination.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a configuration set event destination. +// +// When you create or update an event destination, you must provide one, and only +// one, destination. The destination can be CloudWatch, Amazon Kinesis Firehose, or +// Amazon Simple Notification Service (Amazon SNS). +// +// An event destination is the Amazon Web Services service to which Amazon SES +// publishes the email sending events associated with a configuration set. For +// information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +func (c *Client) CreateConfigurationSetEventDestination(ctx context.Context, params *CreateConfigurationSetEventDestinationInput, optFns ...func(*Options)) (*CreateConfigurationSetEventDestinationOutput, error) { + if params == nil { + params = &CreateConfigurationSetEventDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateConfigurationSetEventDestination", params, optFns, c.addOperationCreateConfigurationSetEventDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateConfigurationSetEventDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create a configuration set event destination. A +// configuration set event destination, which can be either Amazon CloudWatch or +// Amazon Kinesis Firehose, describes an Amazon Web Services service in which +// Amazon SES publishes the email sending events associated with a configuration +// set. For information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type CreateConfigurationSetEventDestinationInput struct { + + // The name of the configuration set that the event destination should be + // associated with. + // + // This member is required. + ConfigurationSetName *string + + // An object that describes the Amazon Web Services service that email sending + // event where information is published. + // + // This member is required. + EventDestination *types.EventDestination + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type CreateConfigurationSetEventDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateConfigurationSetEventDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateConfigurationSetEventDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateConfigurationSetEventDestination{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateConfigurationSetEventDestination"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateConfigurationSetEventDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConfigurationSetEventDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateConfigurationSetEventDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateConfigurationSetEventDestination", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetTrackingOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetTrackingOptions.go new file mode 100644 index 00000000..dc7a51da --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateConfigurationSetTrackingOptions.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an association between a configuration set and a custom domain for open +// and click event tracking. +// +// By default, images and links used for tracking open and click events are hosted +// on domains operated by Amazon SES. You can configure a subdomain of your own to +// handle these events. For information about using custom domains, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/configure-custom-open-click-domains.html +func (c *Client) CreateConfigurationSetTrackingOptions(ctx context.Context, params *CreateConfigurationSetTrackingOptionsInput, optFns ...func(*Options)) (*CreateConfigurationSetTrackingOptionsOutput, error) { + if params == nil { + params = &CreateConfigurationSetTrackingOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateConfigurationSetTrackingOptions", params, optFns, c.addOperationCreateConfigurationSetTrackingOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateConfigurationSetTrackingOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create an open and click tracking option object in a +// configuration set. +type CreateConfigurationSetTrackingOptionsInput struct { + + // The name of the configuration set that the tracking options should be + // associated with. + // + // This member is required. + ConfigurationSetName *string + + // A domain that is used to redirect email recipients to an Amazon SES-operated + // domain. This domain captures open and click events generated by Amazon SES + // emails. + // + // For more information, see [Configuring Custom Domains to Handle Open and Click Tracking] in the Amazon SES Developer Guide. + // + // [Configuring Custom Domains to Handle Open and Click Tracking]: https://docs.aws.amazon.com/ses/latest/dg/configure-custom-open-click-domains.html + // + // This member is required. + TrackingOptions *types.TrackingOptions + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type CreateConfigurationSetTrackingOptionsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateConfigurationSetTrackingOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateConfigurationSetTrackingOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateConfigurationSetTrackingOptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateConfigurationSetTrackingOptions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateConfigurationSetTrackingOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConfigurationSetTrackingOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateConfigurationSetTrackingOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateConfigurationSetTrackingOptions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateCustomVerificationEmailTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateCustomVerificationEmailTemplate.go new file mode 100644 index 00000000..e0b366db --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateCustomVerificationEmailTemplate.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new custom verification email template. +// +// For more information about custom verification email templates, see [Using Custom Verification Email Templates] in the +// Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. +// +// [Using Custom Verification Email Templates]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom +func (c *Client) CreateCustomVerificationEmailTemplate(ctx context.Context, params *CreateCustomVerificationEmailTemplateInput, optFns ...func(*Options)) (*CreateCustomVerificationEmailTemplateOutput, error) { + if params == nil { + params = &CreateCustomVerificationEmailTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateCustomVerificationEmailTemplate", params, optFns, c.addOperationCreateCustomVerificationEmailTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateCustomVerificationEmailTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create a custom verification email template. +type CreateCustomVerificationEmailTemplateInput struct { + + // The URL that the recipient of the verification email is sent to if his or her + // address is not successfully verified. + // + // This member is required. + FailureRedirectionURL *string + + // The email address that the custom verification email is sent from. + // + // This member is required. + FromEmailAddress *string + + // The URL that the recipient of the verification email is sent to if his or her + // address is successfully verified. + // + // This member is required. + SuccessRedirectionURL *string + + // The content of the custom verification email. The total size of the email must + // be less than 10 MB. The message body may contain HTML, with some limitations. + // For more information, see [Custom Verification Email Frequently Asked Questions]in the Amazon SES Developer Guide. + // + // [Custom Verification Email Frequently Asked Questions]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom + // + // This member is required. + TemplateContent *string + + // The name of the custom verification email template. + // + // This member is required. + TemplateName *string + + // The subject line of the custom verification email. + // + // This member is required. + TemplateSubject *string + + noSmithyDocumentSerde +} + +type CreateCustomVerificationEmailTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateCustomVerificationEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCustomVerificationEmailTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateCustomVerificationEmailTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCustomVerificationEmailTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateCustomVerificationEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateCustomVerificationEmailTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptFilter.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptFilter.go new file mode 100644 index 00000000..b46dbe5a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptFilter.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new IP address filter. +// +// For information about setting up IP address filters, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-ip-filtering-console-walkthrough.html +func (c *Client) CreateReceiptFilter(ctx context.Context, params *CreateReceiptFilterInput, optFns ...func(*Options)) (*CreateReceiptFilterOutput, error) { + if params == nil { + params = &CreateReceiptFilterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateReceiptFilter", params, optFns, c.addOperationCreateReceiptFilterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateReceiptFilterOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create a new IP address filter. You use IP address +// filters when you receive email with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type CreateReceiptFilterInput struct { + + // A data structure that describes the IP address filter to create, which consists + // of a name, an IP address range, and whether to allow or block mail from it. + // + // This member is required. + Filter *types.ReceiptFilter + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type CreateReceiptFilterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateReceiptFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateReceiptFilter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateReceiptFilter{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateReceiptFilter"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateReceiptFilterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReceiptFilter(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateReceiptFilter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateReceiptFilter", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRule.go new file mode 100644 index 00000000..baba7102 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRule.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a receipt rule. +// +// For information about setting up receipt rules, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) CreateReceiptRule(ctx context.Context, params *CreateReceiptRuleInput, optFns ...func(*Options)) (*CreateReceiptRuleOutput, error) { + if params == nil { + params = &CreateReceiptRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateReceiptRule", params, optFns, c.addOperationCreateReceiptRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateReceiptRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create a receipt rule. You use receipt rules to receive +// email with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type CreateReceiptRuleInput struct { + + // A data structure that contains the specified rule's name, actions, recipients, + // domains, enabled status, scan status, and TLS policy. + // + // This member is required. + Rule *types.ReceiptRule + + // The name of the rule set where the receipt rule is added. + // + // This member is required. + RuleSetName *string + + // The name of an existing rule after which the new rule is placed. If this + // parameter is null, the new rule is inserted at the beginning of the rule list. + After *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type CreateReceiptRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateReceiptRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateReceiptRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateReceiptRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateReceiptRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateReceiptRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReceiptRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateReceiptRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateReceiptRule", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRuleSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRuleSet.go new file mode 100644 index 00000000..e7ee7788 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateReceiptRuleSet.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an empty receipt rule set. +// +// For information about setting up receipt rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html#receiving-email-concepts-rules +func (c *Client) CreateReceiptRuleSet(ctx context.Context, params *CreateReceiptRuleSetInput, optFns ...func(*Options)) (*CreateReceiptRuleSetOutput, error) { + if params == nil { + params = &CreateReceiptRuleSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateReceiptRuleSet", params, optFns, c.addOperationCreateReceiptRuleSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateReceiptRuleSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create an empty receipt rule set. You use receipt rule +// sets to receive email with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type CreateReceiptRuleSetInput struct { + + // The name of the rule set to create. The name must meet the following + // requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or + // dashes (-). + // + // - Start and end with a letter or number. + // + // - Contain 64 characters or fewer. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type CreateReceiptRuleSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateReceiptRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateReceiptRuleSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateReceiptRuleSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReceiptRuleSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateReceiptRuleSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateReceiptRuleSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateTemplate.go new file mode 100644 index 00000000..dae94783 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_CreateTemplate.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an email template. Email templates enable you to send personalized +// email to one or more destinations in a single operation. For more information, +// see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html +func (c *Client) CreateTemplate(ctx context.Context, params *CreateTemplateInput, optFns ...func(*Options)) (*CreateTemplateOutput, error) { + if params == nil { + params = &CreateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTemplate", params, optFns, c.addOperationCreateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to create an email template. For more information, see the [Amazon SES Developer Guide] +// . +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html +type CreateTemplateInput struct { + + // The content of the email, composed of a subject line and either an HTML part or + // a text-only part. + // + // This member is required. + Template *types.Template + + noSmithyDocumentSerde +} + +type CreateTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSet.go new file mode 100644 index 00000000..e809dd1e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSet.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a configuration set. Configuration sets enable you to publish email +// sending events. For information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +func (c *Client) DeleteConfigurationSet(ctx context.Context, params *DeleteConfigurationSetInput, optFns ...func(*Options)) (*DeleteConfigurationSetOutput, error) { + if params == nil { + params = &DeleteConfigurationSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteConfigurationSet", params, optFns, c.addOperationDeleteConfigurationSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteConfigurationSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete a configuration set. Configuration sets enable +// you to publish email sending events. For information about using configuration +// sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type DeleteConfigurationSetInput struct { + + // The name of the configuration set to delete. + // + // This member is required. + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteConfigurationSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteConfigurationSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteConfigurationSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteConfigurationSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteConfigurationSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteConfigurationSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConfigurationSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteConfigurationSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteConfigurationSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetEventDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetEventDestination.go new file mode 100644 index 00000000..ac6a3233 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetEventDestination.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a configuration set event destination. Configuration set event +// destinations are associated with configuration sets, which enable you to publish +// email sending events. For information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +func (c *Client) DeleteConfigurationSetEventDestination(ctx context.Context, params *DeleteConfigurationSetEventDestinationInput, optFns ...func(*Options)) (*DeleteConfigurationSetEventDestinationOutput, error) { + if params == nil { + params = &DeleteConfigurationSetEventDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteConfigurationSetEventDestination", params, optFns, c.addOperationDeleteConfigurationSetEventDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteConfigurationSetEventDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete a configuration set event destination. +// Configuration set event destinations are associated with configuration sets, +// which enable you to publish email sending events. For information about using +// configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type DeleteConfigurationSetEventDestinationInput struct { + + // The name of the configuration set from which to delete the event destination. + // + // This member is required. + ConfigurationSetName *string + + // The name of the event destination to delete. + // + // This member is required. + EventDestinationName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteConfigurationSetEventDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteConfigurationSetEventDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteConfigurationSetEventDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteConfigurationSetEventDestination{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteConfigurationSetEventDestination"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteConfigurationSetEventDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConfigurationSetEventDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteConfigurationSetEventDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteConfigurationSetEventDestination", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetTrackingOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetTrackingOptions.go new file mode 100644 index 00000000..48626a87 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteConfigurationSetTrackingOptions.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an association between a configuration set and a custom domain for open +// and click event tracking. +// +// By default, images and links used for tracking open and click events are hosted +// on domains operated by Amazon SES. You can configure a subdomain of your own to +// handle these events. For information about using custom domains, see the [Amazon SES Developer Guide]. +// +// Deleting this kind of association results in emails sent using the specified +// configuration set to capture open and click events using the standard, Amazon +// SES-operated domains. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/configure-custom-open-click-domains.html +func (c *Client) DeleteConfigurationSetTrackingOptions(ctx context.Context, params *DeleteConfigurationSetTrackingOptionsInput, optFns ...func(*Options)) (*DeleteConfigurationSetTrackingOptionsOutput, error) { + if params == nil { + params = &DeleteConfigurationSetTrackingOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteConfigurationSetTrackingOptions", params, optFns, c.addOperationDeleteConfigurationSetTrackingOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteConfigurationSetTrackingOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete open and click tracking options in a +// configuration set. +type DeleteConfigurationSetTrackingOptionsInput struct { + + // The name of the configuration set. + // + // This member is required. + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteConfigurationSetTrackingOptionsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteConfigurationSetTrackingOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteConfigurationSetTrackingOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteConfigurationSetTrackingOptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteConfigurationSetTrackingOptions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteConfigurationSetTrackingOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConfigurationSetTrackingOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteConfigurationSetTrackingOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteConfigurationSetTrackingOptions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteCustomVerificationEmailTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteCustomVerificationEmailTemplate.go new file mode 100644 index 00000000..cd4ca9a2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteCustomVerificationEmailTemplate.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an existing custom verification email template. +// +// For more information about custom verification email templates, see [Using Custom Verification Email Templates] in the +// Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. +// +// [Using Custom Verification Email Templates]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom +func (c *Client) DeleteCustomVerificationEmailTemplate(ctx context.Context, params *DeleteCustomVerificationEmailTemplateInput, optFns ...func(*Options)) (*DeleteCustomVerificationEmailTemplateOutput, error) { + if params == nil { + params = &DeleteCustomVerificationEmailTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCustomVerificationEmailTemplate", params, optFns, c.addOperationDeleteCustomVerificationEmailTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCustomVerificationEmailTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete an existing custom verification email template. +type DeleteCustomVerificationEmailTemplateInput struct { + + // The name of the custom verification email template to delete. + // + // This member is required. + TemplateName *string + + noSmithyDocumentSerde +} + +type DeleteCustomVerificationEmailTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCustomVerificationEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCustomVerificationEmailTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteCustomVerificationEmailTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomVerificationEmailTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCustomVerificationEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCustomVerificationEmailTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentity.go new file mode 100644 index 00000000..5e26a113 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentity.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified identity (an email address or a domain) from the list of +// verified identities. +// +// You can execute this operation no more than once per second. +func (c *Client) DeleteIdentity(ctx context.Context, params *DeleteIdentityInput, optFns ...func(*Options)) (*DeleteIdentityOutput, error) { + if params == nil { + params = &DeleteIdentityInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIdentity", params, optFns, c.addOperationDeleteIdentityMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIdentityOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete one of your Amazon SES identities (an email +// address or domain). +type DeleteIdentityInput struct { + + // The identity to be removed from the list of identities for the Amazon Web + // Services account. + // + // This member is required. + Identity *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteIdentityOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteIdentity{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteIdentity{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIdentity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteIdentityValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIdentity(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteIdentity(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteIdentity", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentityPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentityPolicy.go new file mode 100644 index 00000000..1fd783d5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteIdentityPolicy.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified sending authorization policy for the given identity (an +// email address or a domain). This operation returns successfully even if a policy +// with the specified name does not exist. +// +// This operation is for the identity owner only. If you have not verified the +// identity, it returns an error. +// +// Sending authorization is a feature that enables an identity owner to authorize +// other senders to use its identities. For information about using sending +// authorization, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +func (c *Client) DeleteIdentityPolicy(ctx context.Context, params *DeleteIdentityPolicyInput, optFns ...func(*Options)) (*DeleteIdentityPolicyOutput, error) { + if params == nil { + params = &DeleteIdentityPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIdentityPolicy", params, optFns, c.addOperationDeleteIdentityPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIdentityPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete a sending authorization policy for an identity. +// Sending authorization is an Amazon SES feature that enables you to authorize +// other senders to use your identities. For information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +type DeleteIdentityPolicyInput struct { + + // The identity that is associated with the policy to delete. You can specify the + // identity by using its name or by using its Amazon Resource Name (ARN). Examples: + // user@example.com , example.com , + // arn:aws:ses:us-east-1:123456789012:identity/example.com . + // + // To successfully call this operation, you must own the identity. + // + // This member is required. + Identity *string + + // The name of the policy to be deleted. + // + // This member is required. + PolicyName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteIdentityPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIdentityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteIdentityPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteIdentityPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIdentityPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteIdentityPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIdentityPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteIdentityPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteIdentityPolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptFilter.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptFilter.go new file mode 100644 index 00000000..1a3a641b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptFilter.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified IP address filter. +// +// For information about managing IP address filters, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-ip-filtering-console-walkthrough.html +func (c *Client) DeleteReceiptFilter(ctx context.Context, params *DeleteReceiptFilterInput, optFns ...func(*Options)) (*DeleteReceiptFilterOutput, error) { + if params == nil { + params = &DeleteReceiptFilterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteReceiptFilter", params, optFns, c.addOperationDeleteReceiptFilterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteReceiptFilterOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete an IP address filter. You use IP address filters +// when you receive email with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type DeleteReceiptFilterInput struct { + + // The name of the IP address filter to delete. + // + // This member is required. + FilterName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteReceiptFilterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteReceiptFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteReceiptFilter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteReceiptFilter{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteReceiptFilter"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteReceiptFilterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteReceiptFilter(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteReceiptFilter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteReceiptFilter", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRule.go new file mode 100644 index 00000000..bb341ebe --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRule.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified receipt rule. +// +// For information about managing receipt rules, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) DeleteReceiptRule(ctx context.Context, params *DeleteReceiptRuleInput, optFns ...func(*Options)) (*DeleteReceiptRuleOutput, error) { + if params == nil { + params = &DeleteReceiptRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteReceiptRule", params, optFns, c.addOperationDeleteReceiptRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteReceiptRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete a receipt rule. You use receipt rules to receive +// email with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type DeleteReceiptRuleInput struct { + + // The name of the receipt rule to delete. + // + // This member is required. + RuleName *string + + // The name of the receipt rule set that contains the receipt rule to delete. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteReceiptRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteReceiptRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteReceiptRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteReceiptRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteReceiptRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteReceiptRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteReceiptRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteReceiptRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteReceiptRule", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRuleSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRuleSet.go new file mode 100644 index 00000000..f7ce7d9b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteReceiptRuleSet.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified receipt rule set and all of the receipt rules it contains. +// +// The currently active rule set cannot be deleted. +// +// For information about managing receipt rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) DeleteReceiptRuleSet(ctx context.Context, params *DeleteReceiptRuleSetInput, optFns ...func(*Options)) (*DeleteReceiptRuleSetOutput, error) { + if params == nil { + params = &DeleteReceiptRuleSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteReceiptRuleSet", params, optFns, c.addOperationDeleteReceiptRuleSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteReceiptRuleSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete a receipt rule set and all of the receipt rules +// it contains. You use receipt rule sets to receive email with Amazon SES. For +// more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type DeleteReceiptRuleSetInput struct { + + // The name of the receipt rule set to delete. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type DeleteReceiptRuleSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteReceiptRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteReceiptRuleSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteReceiptRuleSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteReceiptRuleSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteReceiptRuleSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteReceiptRuleSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteTemplate.go new file mode 100644 index 00000000..434ed708 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteTemplate.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an email template. +// +// You can execute this operation no more than once per second. +func (c *Client) DeleteTemplate(ctx context.Context, params *DeleteTemplateInput, optFns ...func(*Options)) (*DeleteTemplateOutput, error) { + if params == nil { + params = &DeleteTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTemplate", params, optFns, c.addOperationDeleteTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete an email template. For more information, see the [Amazon SES Developer Guide] +// . +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html +type DeleteTemplateInput struct { + + // The name of the template to be deleted. + // + // This member is required. + TemplateName *string + + noSmithyDocumentSerde +} + +type DeleteTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteVerifiedEmailAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteVerifiedEmailAddress.go new file mode 100644 index 00000000..8b952e39 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DeleteVerifiedEmailAddress.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deprecated. Use the DeleteIdentity operation to delete email addresses and +// domains. +func (c *Client) DeleteVerifiedEmailAddress(ctx context.Context, params *DeleteVerifiedEmailAddressInput, optFns ...func(*Options)) (*DeleteVerifiedEmailAddressOutput, error) { + if params == nil { + params = &DeleteVerifiedEmailAddressInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVerifiedEmailAddress", params, optFns, c.addOperationDeleteVerifiedEmailAddressMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVerifiedEmailAddressOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to delete an email address from the list of email +// addresses you have attempted to verify under your Amazon Web Services account. +type DeleteVerifiedEmailAddressInput struct { + + // An email address to be removed from the list of verified addresses. + // + // This member is required. + EmailAddress *string + + noSmithyDocumentSerde +} + +type DeleteVerifiedEmailAddressOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVerifiedEmailAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteVerifiedEmailAddress{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteVerifiedEmailAddress{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVerifiedEmailAddress"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVerifiedEmailAddressValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVerifiedEmailAddress(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVerifiedEmailAddress(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteVerifiedEmailAddress", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeActiveReceiptRuleSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeActiveReceiptRuleSet.go new file mode 100644 index 00000000..27626d2a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeActiveReceiptRuleSet.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the metadata and receipt rules for the receipt rule set that is +// currently active. +// +// For information about setting up receipt rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html#receiving-email-concepts-rules +func (c *Client) DescribeActiveReceiptRuleSet(ctx context.Context, params *DescribeActiveReceiptRuleSetInput, optFns ...func(*Options)) (*DescribeActiveReceiptRuleSetOutput, error) { + if params == nil { + params = &DescribeActiveReceiptRuleSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeActiveReceiptRuleSet", params, optFns, c.addOperationDescribeActiveReceiptRuleSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeActiveReceiptRuleSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the metadata and receipt rules for the receipt +// rule set that is currently active. You use receipt rule sets to receive email +// with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type DescribeActiveReceiptRuleSetInput struct { + noSmithyDocumentSerde +} + +// Represents the metadata and receipt rules for the receipt rule set that is +// currently active. +type DescribeActiveReceiptRuleSetOutput struct { + + // The metadata for the currently active receipt rule set. The metadata consists + // of the rule set name and a timestamp of when the rule set was created. + Metadata *types.ReceiptRuleSetMetadata + + // The receipt rules that belong to the active rule set. + Rules []types.ReceiptRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeActiveReceiptRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeActiveReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeActiveReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeActiveReceiptRuleSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeActiveReceiptRuleSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeActiveReceiptRuleSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeActiveReceiptRuleSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeConfigurationSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeConfigurationSet.go new file mode 100644 index 00000000..15f95a91 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeConfigurationSet.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the details of the specified configuration set. For information about +// using configuration sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +func (c *Client) DescribeConfigurationSet(ctx context.Context, params *DescribeConfigurationSetInput, optFns ...func(*Options)) (*DescribeConfigurationSetOutput, error) { + if params == nil { + params = &DescribeConfigurationSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeConfigurationSet", params, optFns, c.addOperationDescribeConfigurationSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeConfigurationSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the details of a configuration set. +// Configuration sets enable you to publish email sending events. For information +// about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type DescribeConfigurationSetInput struct { + + // The name of the configuration set to describe. + // + // This member is required. + ConfigurationSetName *string + + // A list of configuration set attributes to return. + ConfigurationSetAttributeNames []types.ConfigurationSetAttribute + + noSmithyDocumentSerde +} + +// Represents the details of a configuration set. Configuration sets enable you to +// publish email sending events. For information about using configuration sets, +// see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type DescribeConfigurationSetOutput struct { + + // The configuration set object associated with the specified configuration set. + ConfigurationSet *types.ConfigurationSet + + // Specifies whether messages that use the configuration set are required to use + // Transport Layer Security (TLS). + DeliveryOptions *types.DeliveryOptions + + // A list of event destinations associated with the configuration set. + EventDestinations []types.EventDestination + + // An object that represents the reputation settings for the configuration set. + ReputationOptions *types.ReputationOptions + + // The name of the custom open and click tracking domain associated with the + // configuration set. + TrackingOptions *types.TrackingOptions + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeConfigurationSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeConfigurationSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeConfigurationSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeConfigurationSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeConfigurationSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConfigurationSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeConfigurationSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeConfigurationSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRule.go new file mode 100644 index 00000000..f66eb180 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRule.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the details of the specified receipt rule. +// +// For information about setting up receipt rules, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) DescribeReceiptRule(ctx context.Context, params *DescribeReceiptRuleInput, optFns ...func(*Options)) (*DescribeReceiptRuleOutput, error) { + if params == nil { + params = &DescribeReceiptRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeReceiptRule", params, optFns, c.addOperationDescribeReceiptRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeReceiptRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the details of a receipt rule. You use receipt +// rules to receive email with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type DescribeReceiptRuleInput struct { + + // The name of the receipt rule. + // + // This member is required. + RuleName *string + + // The name of the receipt rule set that the receipt rule belongs to. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// Represents the details of a receipt rule. +type DescribeReceiptRuleOutput struct { + + // A data structure that contains the specified receipt rule's name, actions, + // recipients, domains, enabled status, scan status, and Transport Layer Security + // (TLS) policy. + Rule *types.ReceiptRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeReceiptRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeReceiptRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeReceiptRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReceiptRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeReceiptRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReceiptRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeReceiptRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeReceiptRule", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRuleSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRuleSet.go new file mode 100644 index 00000000..139d4677 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_DescribeReceiptRuleSet.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the details of the specified receipt rule set. +// +// For information about managing receipt rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) DescribeReceiptRuleSet(ctx context.Context, params *DescribeReceiptRuleSetInput, optFns ...func(*Options)) (*DescribeReceiptRuleSetOutput, error) { + if params == nil { + params = &DescribeReceiptRuleSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeReceiptRuleSet", params, optFns, c.addOperationDescribeReceiptRuleSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeReceiptRuleSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the details of a receipt rule set. You use +// receipt rule sets to receive email with Amazon SES. For more information, see +// the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type DescribeReceiptRuleSetInput struct { + + // The name of the receipt rule set to describe. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// Represents the details of the specified receipt rule set. +type DescribeReceiptRuleSetOutput struct { + + // The metadata for the receipt rule set, which consists of the rule set name and + // the timestamp of when the rule set was created. + Metadata *types.ReceiptRuleSetMetadata + + // A list of the receipt rules that belong to the specified receipt rule set. + Rules []types.ReceiptRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeReceiptRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReceiptRuleSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeReceiptRuleSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReceiptRuleSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeReceiptRuleSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeReceiptRuleSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetAccountSendingEnabled.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetAccountSendingEnabled.go new file mode 100644 index 00000000..6a330df8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetAccountSendingEnabled.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the email sending status of the Amazon SES account for the current +// Region. +// +// You can execute this operation no more than once per second. +func (c *Client) GetAccountSendingEnabled(ctx context.Context, params *GetAccountSendingEnabledInput, optFns ...func(*Options)) (*GetAccountSendingEnabledOutput, error) { + if params == nil { + params = &GetAccountSendingEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccountSendingEnabled", params, optFns, c.addOperationGetAccountSendingEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccountSendingEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccountSendingEnabledInput struct { + noSmithyDocumentSerde +} + +// Represents a request to return the email sending status for your Amazon SES +// account in the current Amazon Web Services Region. +type GetAccountSendingEnabledOutput struct { + + // Describes whether email sending is enabled or disabled for your Amazon SES + // account in the current Amazon Web Services Region. + Enabled bool + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccountSendingEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccountSendingEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetAccountSendingEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccountSendingEnabled"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccountSendingEnabled(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAccountSendingEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAccountSendingEnabled", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetCustomVerificationEmailTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetCustomVerificationEmailTemplate.go new file mode 100644 index 00000000..5841db43 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetCustomVerificationEmailTemplate.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the custom email verification template for the template name you +// specify. +// +// For more information about custom verification email templates, see [Using Custom Verification Email Templates] in the +// Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. +// +// [Using Custom Verification Email Templates]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom +func (c *Client) GetCustomVerificationEmailTemplate(ctx context.Context, params *GetCustomVerificationEmailTemplateInput, optFns ...func(*Options)) (*GetCustomVerificationEmailTemplateOutput, error) { + if params == nil { + params = &GetCustomVerificationEmailTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCustomVerificationEmailTemplate", params, optFns, c.addOperationGetCustomVerificationEmailTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCustomVerificationEmailTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to retrieve an existing custom verification email template. +type GetCustomVerificationEmailTemplateInput struct { + + // The name of the custom verification email template to retrieve. + // + // This member is required. + TemplateName *string + + noSmithyDocumentSerde +} + +// The content of the custom verification email template. +type GetCustomVerificationEmailTemplateOutput struct { + + // The URL that the recipient of the verification email is sent to if his or her + // address is not successfully verified. + FailureRedirectionURL *string + + // The email address that the custom verification email is sent from. + FromEmailAddress *string + + // The URL that the recipient of the verification email is sent to if his or her + // address is successfully verified. + SuccessRedirectionURL *string + + // The content of the custom verification email. + TemplateContent *string + + // The name of the custom verification email template. + TemplateName *string + + // The subject line of the custom verification email. + TemplateSubject *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCustomVerificationEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCustomVerificationEmailTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetCustomVerificationEmailTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCustomVerificationEmailTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCustomVerificationEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCustomVerificationEmailTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityDkimAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityDkimAttributes.go new file mode 100644 index 00000000..0ff8b77f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityDkimAttributes.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the current status of Easy DKIM signing for an entity. For domain name +// identities, this operation also returns the DKIM tokens that are required for +// Easy DKIM signing, and whether Amazon SES has successfully verified that these +// tokens have been published. +// +// This operation takes a list of identities as input and returns the following +// information for each: +// +// - Whether Easy DKIM signing is enabled or disabled. +// +// - A set of DKIM tokens that represent the identity. If the identity is an +// email address, the tokens represent the domain of that address. +// +// - Whether Amazon SES has successfully verified the DKIM tokens published in +// the domain's DNS. This information is only returned for domain name identities, +// not for email addresses. +// +// This operation is throttled at one request per second and can only get DKIM +// attributes for up to 100 identities at a time. +// +// For more information about creating DNS records using DKIM tokens, go to the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy-managing.html +func (c *Client) GetIdentityDkimAttributes(ctx context.Context, params *GetIdentityDkimAttributesInput, optFns ...func(*Options)) (*GetIdentityDkimAttributesOutput, error) { + if params == nil { + params = &GetIdentityDkimAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIdentityDkimAttributes", params, optFns, c.addOperationGetIdentityDkimAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIdentityDkimAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request for the status of Amazon SES Easy DKIM signing for an +// identity. For domain identities, this request also returns the DKIM tokens that +// are required for Easy DKIM signing, and whether Amazon SES successfully verified +// that these tokens were published. For more information about Easy DKIM, see the [Amazon SES Developer Guide] +// . +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy.html +type GetIdentityDkimAttributesInput struct { + + // A list of one or more verified identities - email addresses, domains, or both. + // + // This member is required. + Identities []string + + noSmithyDocumentSerde +} + +// Represents the status of Amazon SES Easy DKIM signing for an identity. For +// domain identities, this response also contains the DKIM tokens that are required +// for Easy DKIM signing, and whether Amazon SES successfully verified that these +// tokens were published. +type GetIdentityDkimAttributesOutput struct { + + // The DKIM attributes for an email address or a domain. + // + // This member is required. + DkimAttributes map[string]types.IdentityDkimAttributes + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIdentityDkimAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetIdentityDkimAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetIdentityDkimAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetIdentityDkimAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetIdentityDkimAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIdentityDkimAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetIdentityDkimAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetIdentityDkimAttributes", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityMailFromDomainAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityMailFromDomainAttributes.go new file mode 100644 index 00000000..9811f3b0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityMailFromDomainAttributes.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the custom MAIL FROM attributes for a list of identities (email +// addresses : domains). +// +// This operation is throttled at one request per second and can only get custom +// MAIL FROM attributes for up to 100 identities at a time. +func (c *Client) GetIdentityMailFromDomainAttributes(ctx context.Context, params *GetIdentityMailFromDomainAttributesInput, optFns ...func(*Options)) (*GetIdentityMailFromDomainAttributesOutput, error) { + if params == nil { + params = &GetIdentityMailFromDomainAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIdentityMailFromDomainAttributes", params, optFns, c.addOperationGetIdentityMailFromDomainAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIdentityMailFromDomainAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the Amazon SES custom MAIL FROM attributes for a +// list of identities. For information about using a custom MAIL FROM domain, see +// the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/mail-from.html +type GetIdentityMailFromDomainAttributesInput struct { + + // A list of one or more identities. + // + // This member is required. + Identities []string + + noSmithyDocumentSerde +} + +// Represents the custom MAIL FROM attributes for a list of identities. +type GetIdentityMailFromDomainAttributesOutput struct { + + // A map of identities to custom MAIL FROM attributes. + // + // This member is required. + MailFromDomainAttributes map[string]types.IdentityMailFromDomainAttributes + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIdentityMailFromDomainAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetIdentityMailFromDomainAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetIdentityMailFromDomainAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetIdentityMailFromDomainAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetIdentityMailFromDomainAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIdentityMailFromDomainAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetIdentityMailFromDomainAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetIdentityMailFromDomainAttributes", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityNotificationAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityNotificationAttributes.go new file mode 100644 index 00000000..826ffda9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityNotificationAttributes.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Given a list of verified identities (email addresses and/or domains), returns a +// structure describing identity notification attributes. +// +// This operation is throttled at one request per second and can only get +// notification attributes for up to 100 identities at a time. +// +// For more information about using notifications with Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications.html +func (c *Client) GetIdentityNotificationAttributes(ctx context.Context, params *GetIdentityNotificationAttributesInput, optFns ...func(*Options)) (*GetIdentityNotificationAttributesOutput, error) { + if params == nil { + params = &GetIdentityNotificationAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIdentityNotificationAttributes", params, optFns, c.addOperationGetIdentityNotificationAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIdentityNotificationAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the notification attributes for a list of +// identities you verified with Amazon SES. For information about Amazon SES +// notifications, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications.html +type GetIdentityNotificationAttributesInput struct { + + // A list of one or more identities. You can specify an identity by using its name + // or by using its Amazon Resource Name (ARN). Examples: user@example.com , + // example.com , arn:aws:ses:us-east-1:123456789012:identity/example.com . + // + // This member is required. + Identities []string + + noSmithyDocumentSerde +} + +// Represents the notification attributes for a list of identities. +type GetIdentityNotificationAttributesOutput struct { + + // A map of Identity to IdentityNotificationAttributes. + // + // This member is required. + NotificationAttributes map[string]types.IdentityNotificationAttributes + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIdentityNotificationAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetIdentityNotificationAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetIdentityNotificationAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetIdentityNotificationAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetIdentityNotificationAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIdentityNotificationAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetIdentityNotificationAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetIdentityNotificationAttributes", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityPolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityPolicies.go new file mode 100644 index 00000000..0213f820 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityPolicies.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the requested sending authorization policies for the given identity (an +// email address or a domain). The policies are returned as a map of policy names +// to policy contents. You can retrieve a maximum of 20 policies at a time. +// +// This operation is for the identity owner only. If you have not verified the +// identity, it returns an error. +// +// Sending authorization is a feature that enables an identity owner to authorize +// other senders to use its identities. For information about using sending +// authorization, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +func (c *Client) GetIdentityPolicies(ctx context.Context, params *GetIdentityPoliciesInput, optFns ...func(*Options)) (*GetIdentityPoliciesOutput, error) { + if params == nil { + params = &GetIdentityPoliciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIdentityPolicies", params, optFns, c.addOperationGetIdentityPoliciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIdentityPoliciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the requested sending authorization policies for +// an identity. Sending authorization is an Amazon SES feature that enables you to +// authorize other senders to use your identities. For information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +type GetIdentityPoliciesInput struct { + + // The identity for which the policies are retrieved. You can specify an identity + // by using its name or by using its Amazon Resource Name (ARN). Examples: + // user@example.com , example.com , + // arn:aws:ses:us-east-1:123456789012:identity/example.com . + // + // To successfully call this operation, you must own the identity. + // + // This member is required. + Identity *string + + // A list of the names of policies to be retrieved. You can retrieve a maximum of + // 20 policies at a time. If you do not know the names of the policies that are + // attached to the identity, you can use ListIdentityPolicies . + // + // This member is required. + PolicyNames []string + + noSmithyDocumentSerde +} + +// Represents the requested sending authorization policies. +type GetIdentityPoliciesOutput struct { + + // A map of policy names to policies. + // + // This member is required. + Policies map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIdentityPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetIdentityPolicies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetIdentityPolicies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetIdentityPolicies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetIdentityPoliciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIdentityPolicies(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetIdentityPolicies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetIdentityPolicies", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityVerificationAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityVerificationAttributes.go new file mode 100644 index 00000000..11813ded --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetIdentityVerificationAttributes.go @@ -0,0 +1,365 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "time" +) + +// Given a list of identities (email addresses and/or domains), returns the +// verification status and (for domain identities) the verification token for each +// identity. +// +// The verification status of an email address is "Pending" until the email +// address owner clicks the link within the verification email that Amazon SES sent +// to that address. If the email address owner clicks the link within 24 hours, the +// verification status of the email address changes to "Success". If the link is +// not clicked within 24 hours, the verification status changes to "Failed." In +// that case, to verify the email address, you must restart the verification +// process from the beginning. +// +// For domain identities, the domain's verification status is "Pending" as Amazon +// SES searches for the required TXT record in the DNS settings of the domain. When +// Amazon SES detects the record, the domain's verification status changes to +// "Success". If Amazon SES is unable to detect the record within 72 hours, the +// domain's verification status changes to "Failed." In that case, to verify the +// domain, you must restart the verification process from the beginning. +// +// This operation is throttled at one request per second and can only get +// verification attributes for up to 100 identities at a time. +func (c *Client) GetIdentityVerificationAttributes(ctx context.Context, params *GetIdentityVerificationAttributesInput, optFns ...func(*Options)) (*GetIdentityVerificationAttributesOutput, error) { + if params == nil { + params = &GetIdentityVerificationAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIdentityVerificationAttributes", params, optFns, c.addOperationGetIdentityVerificationAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIdentityVerificationAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return the Amazon SES verification status of a list of +// identities. For domain identities, this request also returns the verification +// token. For information about verifying identities with Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html +type GetIdentityVerificationAttributesInput struct { + + // A list of identities. + // + // This member is required. + Identities []string + + noSmithyDocumentSerde +} + +// The Amazon SES verification status of a list of identities. For domain +// identities, this response also contains the verification token. +type GetIdentityVerificationAttributesOutput struct { + + // A map of Identities to IdentityVerificationAttributes objects. + // + // This member is required. + VerificationAttributes map[string]types.IdentityVerificationAttributes + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIdentityVerificationAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetIdentityVerificationAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetIdentityVerificationAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetIdentityVerificationAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetIdentityVerificationAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIdentityVerificationAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// GetIdentityVerificationAttributesAPIClient is a client that implements the +// GetIdentityVerificationAttributes operation. +type GetIdentityVerificationAttributesAPIClient interface { + GetIdentityVerificationAttributes(context.Context, *GetIdentityVerificationAttributesInput, ...func(*Options)) (*GetIdentityVerificationAttributesOutput, error) +} + +var _ GetIdentityVerificationAttributesAPIClient = (*Client)(nil) + +// IdentityExistsWaiterOptions are waiter options for IdentityExistsWaiter +type IdentityExistsWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // IdentityExistsWaiter will use default minimum delay of 3 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, IdentityExistsWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetIdentityVerificationAttributesInput, *GetIdentityVerificationAttributesOutput, error) (bool, error) +} + +// IdentityExistsWaiter defines the waiters for IdentityExists +type IdentityExistsWaiter struct { + client GetIdentityVerificationAttributesAPIClient + + options IdentityExistsWaiterOptions +} + +// NewIdentityExistsWaiter constructs a IdentityExistsWaiter. +func NewIdentityExistsWaiter(client GetIdentityVerificationAttributesAPIClient, optFns ...func(*IdentityExistsWaiterOptions)) *IdentityExistsWaiter { + options := IdentityExistsWaiterOptions{} + options.MinDelay = 3 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = identityExistsStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &IdentityExistsWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for IdentityExists waiter. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *IdentityExistsWaiter) Wait(ctx context.Context, params *GetIdentityVerificationAttributesInput, maxWaitDur time.Duration, optFns ...func(*IdentityExistsWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for IdentityExists waiter and returns +// the output of the successful operation. The maxWaitDur is the maximum wait +// duration the waiter will wait. The maxWaitDur is required and must be greater +// than zero. +func (w *IdentityExistsWaiter) WaitForOutput(ctx context.Context, params *GetIdentityVerificationAttributesInput, maxWaitDur time.Duration, optFns ...func(*IdentityExistsWaiterOptions)) (*GetIdentityVerificationAttributesOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetIdentityVerificationAttributes(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for IdentityExists waiter") +} + +func identityExistsStateRetryable(ctx context.Context, input *GetIdentityVerificationAttributesInput, output *GetIdentityVerificationAttributesOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("VerificationAttributes.*.VerificationStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "Success" + var match = true + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + if len(listOfValues) == 0 { + match = false + } + for _, v := range listOfValues { + value, ok := v.(string) + if !ok { + return false, fmt.Errorf("waiter comparator expected string value, got %T", pathValue) + } + + if string(value) != expectedValue { + match = false + } + } + + if match { + return false, nil + } + } + + return true, nil +} + +func newServiceMetadataMiddleware_opGetIdentityVerificationAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetIdentityVerificationAttributes", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendQuota.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendQuota.go new file mode 100644 index 00000000..4145c114 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendQuota.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides the sending limits for the Amazon SES account. +// +// You can execute this operation no more than once per second. +func (c *Client) GetSendQuota(ctx context.Context, params *GetSendQuotaInput, optFns ...func(*Options)) (*GetSendQuotaOutput, error) { + if params == nil { + params = &GetSendQuotaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSendQuota", params, optFns, c.addOperationGetSendQuotaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSendQuotaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSendQuotaInput struct { + noSmithyDocumentSerde +} + +// Represents your Amazon SES daily sending quota, maximum send rate, and the +// number of emails you have sent in the last 24 hours. +type GetSendQuotaOutput struct { + + // The maximum number of emails the user is allowed to send in a 24-hour interval. + // A value of -1 signifies an unlimited quota. + Max24HourSend float64 + + // The maximum number of emails that Amazon SES can accept from the user's account + // per second. + // + // The rate at which Amazon SES accepts the user's messages might be less than the + // maximum send rate. + MaxSendRate float64 + + // The number of emails sent during the previous 24 hours. + SentLast24Hours float64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSendQuotaMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSendQuota{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetSendQuota{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSendQuota"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSendQuota(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSendQuota(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSendQuota", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendStatistics.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendStatistics.go new file mode 100644 index 00000000..68d6b46c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetSendStatistics.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides sending statistics for the current Amazon Web Services Region. The +// result is a list of data points, representing the last two weeks of sending +// activity. Each data point in the list contains statistics for a 15-minute period +// of time. +// +// You can execute this operation no more than once per second. +func (c *Client) GetSendStatistics(ctx context.Context, params *GetSendStatisticsInput, optFns ...func(*Options)) (*GetSendStatisticsOutput, error) { + if params == nil { + params = &GetSendStatisticsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSendStatistics", params, optFns, c.addOperationGetSendStatisticsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSendStatisticsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSendStatisticsInput struct { + noSmithyDocumentSerde +} + +// Represents a list of data points. This list contains aggregated data from the +// previous two weeks of your sending activity with Amazon SES. +type GetSendStatisticsOutput struct { + + // A list of data points, each of which represents 15 minutes of activity. + SendDataPoints []types.SendDataPoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSendStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSendStatistics{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetSendStatistics{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSendStatistics"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSendStatistics(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSendStatistics(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSendStatistics", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetTemplate.go new file mode 100644 index 00000000..f3a50af1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_GetTemplate.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Displays the template object (which includes the Subject line, HTML part and +// text part) for the template you specify. +// +// You can execute this operation no more than once per second. +func (c *Client) GetTemplate(ctx context.Context, params *GetTemplateInput, optFns ...func(*Options)) (*GetTemplateOutput, error) { + if params == nil { + params = &GetTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTemplate", params, optFns, c.addOperationGetTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTemplateInput struct { + + // The name of the template to retrieve. + // + // This member is required. + TemplateName *string + + noSmithyDocumentSerde +} + +type GetTemplateOutput struct { + + // The content of the email, composed of a subject line and either an HTML part or + // a text-only part. + Template *types.Template + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListConfigurationSets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListConfigurationSets.go new file mode 100644 index 00000000..0991c3a3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListConfigurationSets.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides a list of the configuration sets associated with your Amazon SES +// account in the current Amazon Web Services Region. For information about using +// configuration sets, see [Monitoring Your Amazon SES Sending Activity]in the Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. This operation +// returns up to 1,000 configuration sets each time it is run. If your Amazon SES +// account has more than 1,000 configuration sets, this operation also returns +// NextToken . You can then execute the ListConfigurationSets operation again, +// passing the NextToken parameter and the value of the NextToken element to +// retrieve additional results. +// +// [Monitoring Your Amazon SES Sending Activity]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +func (c *Client) ListConfigurationSets(ctx context.Context, params *ListConfigurationSetsInput, optFns ...func(*Options)) (*ListConfigurationSetsOutput, error) { + if params == nil { + params = &ListConfigurationSetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListConfigurationSets", params, optFns, c.addOperationListConfigurationSetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListConfigurationSetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to list the configuration sets associated with your Amazon +// Web Services account. Configuration sets enable you to publish email sending +// events. For information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type ListConfigurationSetsInput struct { + + // The number of configuration sets to return. + MaxItems *int32 + + // A token returned from a previous call to ListConfigurationSets to indicate the + // position of the configuration set in the configuration set list. + NextToken *string + + noSmithyDocumentSerde +} + +// A list of configuration sets associated with your Amazon Web Services account. +// Configuration sets enable you to publish email sending events. For information +// about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type ListConfigurationSetsOutput struct { + + // A list of configuration sets. + ConfigurationSets []types.ConfigurationSet + + // A token indicating that there are additional configuration sets available to be + // listed. Pass this token to successive calls of ListConfigurationSets . + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListConfigurationSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListConfigurationSets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListConfigurationSets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListConfigurationSets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListConfigurationSets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListConfigurationSets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListConfigurationSets", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListCustomVerificationEmailTemplates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListCustomVerificationEmailTemplates.go new file mode 100644 index 00000000..a0ebde7d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListCustomVerificationEmailTemplates.go @@ -0,0 +1,255 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the existing custom verification email templates for your account in the +// current Amazon Web Services Region. +// +// For more information about custom verification email templates, see [Using Custom Verification Email Templates] in the +// Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. +// +// [Using Custom Verification Email Templates]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom +func (c *Client) ListCustomVerificationEmailTemplates(ctx context.Context, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) { + if params == nil { + params = &ListCustomVerificationEmailTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCustomVerificationEmailTemplates", params, optFns, c.addOperationListCustomVerificationEmailTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCustomVerificationEmailTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to list the existing custom verification email templates +// for your account. +// +// For more information about custom verification email templates, see [Using Custom Verification Email Templates] in the +// Amazon SES Developer Guide. +// +// [Using Custom Verification Email Templates]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom +type ListCustomVerificationEmailTemplatesInput struct { + + // The maximum number of custom verification email templates to return. This value + // must be at least 1 and less than or equal to 50. If you do not specify a value, + // or if you specify a value less than 1 or greater than 50, the operation returns + // up to 50 results. + MaxResults *int32 + + // An array the contains the name and creation time stamp for each template in + // your Amazon SES account. + NextToken *string + + noSmithyDocumentSerde +} + +// A paginated list of custom verification email templates. +type ListCustomVerificationEmailTemplatesOutput struct { + + // A list of the custom verification email templates that exist in your account. + CustomVerificationEmailTemplates []types.CustomVerificationEmailTemplate + + // A token indicating that there are additional custom verification email + // templates available to be listed. Pass this token to a subsequent call to + // ListTemplates to retrieve the next 50 custom verification email templates. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCustomVerificationEmailTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListCustomVerificationEmailTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListCustomVerificationEmailTemplates{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCustomVerificationEmailTemplates"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCustomVerificationEmailTemplates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCustomVerificationEmailTemplatesAPIClient is a client that implements the +// ListCustomVerificationEmailTemplates operation. +type ListCustomVerificationEmailTemplatesAPIClient interface { + ListCustomVerificationEmailTemplates(context.Context, *ListCustomVerificationEmailTemplatesInput, ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) +} + +var _ ListCustomVerificationEmailTemplatesAPIClient = (*Client)(nil) + +// ListCustomVerificationEmailTemplatesPaginatorOptions is the paginator options +// for ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginatorOptions struct { + // The maximum number of custom verification email templates to return. This value + // must be at least 1 and less than or equal to 50. If you do not specify a value, + // or if you specify a value less than 1 or greater than 50, the operation returns + // up to 50 results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListCustomVerificationEmailTemplatesPaginator is a paginator for +// ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginator struct { + options ListCustomVerificationEmailTemplatesPaginatorOptions + client ListCustomVerificationEmailTemplatesAPIClient + params *ListCustomVerificationEmailTemplatesInput + nextToken *string + firstPage bool +} + +// NewListCustomVerificationEmailTemplatesPaginator returns a new +// ListCustomVerificationEmailTemplatesPaginator +func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator { + if params == nil { + params = &ListCustomVerificationEmailTemplatesInput{} + } + + options := ListCustomVerificationEmailTemplatesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCustomVerificationEmailTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomVerificationEmailTemplatesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCustomVerificationEmailTemplates page. +func (p *ListCustomVerificationEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListCustomVerificationEmailTemplates(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_opListCustomVerificationEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCustomVerificationEmailTemplates", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentities.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentities.go new file mode 100644 index 00000000..78e3694b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentities.go @@ -0,0 +1,250 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list containing all of the identities (email addresses and domains) +// for your Amazon Web Services account in the current Amazon Web Services Region, +// regardless of verification status. +// +// You can execute this operation no more than once per second. +// +// It's recommended that for successive pagination calls of this API, you continue +// to the use the same parameter/value pairs as used in the original call, e.g., if +// you used IdentityType=Domain in the the original call and received a NextToken +// in the response, you should continue providing the IdentityType=Domain +// parameter for further NextToken calls; however, if you didn't provide the +// IdentityType parameter in the original call, then continue to not provide it for +// successive pagination calls. Using this protocol will ensure consistent results. +func (c *Client) ListIdentities(ctx context.Context, params *ListIdentitiesInput, optFns ...func(*Options)) (*ListIdentitiesOutput, error) { + if params == nil { + params = &ListIdentitiesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListIdentities", params, optFns, c.addOperationListIdentitiesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListIdentitiesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return a list of all identities (email addresses and +// domains) that you have attempted to verify under your Amazon Web Services +// account, regardless of verification status. +type ListIdentitiesInput struct { + + // The type of the identities to list. Possible values are "EmailAddress" and + // "Domain". If this parameter is omitted, then all identities are listed. + IdentityType types.IdentityType + + // The maximum number of identities per page. Possible values are 1-1000 inclusive. + MaxItems *int32 + + // The token to use for pagination. + NextToken *string + + noSmithyDocumentSerde +} + +// A list of all identities that you have attempted to verify under your Amazon +// Web Services account, regardless of verification status. +type ListIdentitiesOutput struct { + + // A list of identities. + // + // This member is required. + Identities []string + + // The token used for pagination. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListIdentitiesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListIdentities{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListIdentities{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListIdentities"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIdentities(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListIdentitiesAPIClient is a client that implements the ListIdentities +// operation. +type ListIdentitiesAPIClient interface { + ListIdentities(context.Context, *ListIdentitiesInput, ...func(*Options)) (*ListIdentitiesOutput, error) +} + +var _ ListIdentitiesAPIClient = (*Client)(nil) + +// ListIdentitiesPaginatorOptions is the paginator options for ListIdentities +type ListIdentitiesPaginatorOptions struct { + // The maximum number of identities per page. Possible values are 1-1000 inclusive. + 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 +} + +// ListIdentitiesPaginator is a paginator for ListIdentities +type ListIdentitiesPaginator struct { + options ListIdentitiesPaginatorOptions + client ListIdentitiesAPIClient + params *ListIdentitiesInput + nextToken *string + firstPage bool +} + +// NewListIdentitiesPaginator returns a new ListIdentitiesPaginator +func NewListIdentitiesPaginator(client ListIdentitiesAPIClient, params *ListIdentitiesInput, optFns ...func(*ListIdentitiesPaginatorOptions)) *ListIdentitiesPaginator { + if params == nil { + params = &ListIdentitiesInput{} + } + + options := ListIdentitiesPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListIdentitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIdentitiesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListIdentities page. +func (p *ListIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentitiesOutput, 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.MaxItems = limit + + result, err := p.client.ListIdentities(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_opListIdentities(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListIdentities", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentityPolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentityPolicies.go new file mode 100644 index 00000000..e3129ec6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListIdentityPolicies.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of sending authorization policies that are attached to the given +// identity (an email address or a domain). This operation returns only a list. To +// get the actual policy content, use GetIdentityPolicies . +// +// This operation is for the identity owner only. If you have not verified the +// identity, it returns an error. +// +// Sending authorization is a feature that enables an identity owner to authorize +// other senders to use its identities. For information about using sending +// authorization, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +func (c *Client) ListIdentityPolicies(ctx context.Context, params *ListIdentityPoliciesInput, optFns ...func(*Options)) (*ListIdentityPoliciesOutput, error) { + if params == nil { + params = &ListIdentityPoliciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListIdentityPolicies", params, optFns, c.addOperationListIdentityPoliciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListIdentityPoliciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to return a list of sending authorization policies that +// are attached to an identity. Sending authorization is an Amazon SES feature that +// enables you to authorize other senders to use your identities. For information, +// see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +type ListIdentityPoliciesInput struct { + + // The identity that is associated with the policy for which the policies are + // listed. You can specify an identity by using its name or by using its Amazon + // Resource Name (ARN). Examples: user@example.com , example.com , + // arn:aws:ses:us-east-1:123456789012:identity/example.com . + // + // To successfully call this operation, you must own the identity. + // + // This member is required. + Identity *string + + noSmithyDocumentSerde +} + +// A list of names of sending authorization policies that apply to an identity. +type ListIdentityPoliciesOutput struct { + + // A list of names of policies that apply to the specified identity. + // + // This member is required. + PolicyNames []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListIdentityPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListIdentityPolicies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListIdentityPolicies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListIdentityPolicies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListIdentityPoliciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIdentityPolicies(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListIdentityPolicies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListIdentityPolicies", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptFilters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptFilters.go new file mode 100644 index 00000000..18a56372 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptFilters.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the IP address filters associated with your Amazon Web Services account +// in the current Amazon Web Services Region. +// +// For information about managing IP address filters, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-ip-filtering-console-walkthrough.html +func (c *Client) ListReceiptFilters(ctx context.Context, params *ListReceiptFiltersInput, optFns ...func(*Options)) (*ListReceiptFiltersOutput, error) { + if params == nil { + params = &ListReceiptFiltersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListReceiptFilters", params, optFns, c.addOperationListReceiptFiltersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListReceiptFiltersOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to list the IP address filters that exist under your +// Amazon Web Services account. You use IP address filters when you receive email +// with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type ListReceiptFiltersInput struct { + noSmithyDocumentSerde +} + +// A list of IP address filters that exist under your Amazon Web Services account. +type ListReceiptFiltersOutput struct { + + // A list of IP address filter data structures, which each consist of a name, an + // IP address range, and whether to allow or block mail from it. + Filters []types.ReceiptFilter + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListReceiptFiltersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListReceiptFilters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListReceiptFilters{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListReceiptFilters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceiptFilters(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListReceiptFilters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListReceiptFilters", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptRuleSets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptRuleSets.go new file mode 100644 index 00000000..62f8e7c6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListReceiptRuleSets.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the receipt rule sets that exist under your Amazon Web Services account +// in the current Amazon Web Services Region. If there are additional receipt rule +// sets to be retrieved, you receive a NextToken that you can provide to the next +// call to ListReceiptRuleSets to retrieve the additional entries. +// +// For information about managing receipt rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) ListReceiptRuleSets(ctx context.Context, params *ListReceiptRuleSetsInput, optFns ...func(*Options)) (*ListReceiptRuleSetsOutput, error) { + if params == nil { + params = &ListReceiptRuleSetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListReceiptRuleSets", params, optFns, c.addOperationListReceiptRuleSetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListReceiptRuleSetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to list the receipt rule sets that exist under your Amazon +// Web Services account. You use receipt rule sets to receive email with Amazon +// SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type ListReceiptRuleSetsInput struct { + + // A token returned from a previous call to ListReceiptRuleSets to indicate the + // position in the receipt rule set list. + NextToken *string + + noSmithyDocumentSerde +} + +// A list of receipt rule sets that exist under your Amazon Web Services account. +type ListReceiptRuleSetsOutput struct { + + // A token indicating that there are additional receipt rule sets available to be + // listed. Pass this token to successive calls of ListReceiptRuleSets to retrieve + // up to 100 receipt rule sets at a time. + NextToken *string + + // The metadata for the currently active receipt rule set. The metadata consists + // of the rule set name and the timestamp of when the rule set was created. + RuleSets []types.ReceiptRuleSetMetadata + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListReceiptRuleSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListReceiptRuleSets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListReceiptRuleSets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListReceiptRuleSets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceiptRuleSets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListReceiptRuleSets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListReceiptRuleSets", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListTemplates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListTemplates.go new file mode 100644 index 00000000..0172139e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListTemplates.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the email templates present in your Amazon SES account in the current +// Amazon Web Services Region. +// +// You can execute this operation no more than once per second. +func (c *Client) ListTemplates(ctx context.Context, params *ListTemplatesInput, optFns ...func(*Options)) (*ListTemplatesOutput, error) { + if params == nil { + params = &ListTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTemplates", params, optFns, c.addOperationListTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTemplatesInput struct { + + // The maximum number of templates to return. This value must be at least 1 and + // less than or equal to 100. If more than 100 items are requested, the page size + // will automatically set to 100. If you do not specify a value, 10 is the default + // page size. + MaxItems *int32 + + // A token returned from a previous call to ListTemplates to indicate the position + // in the list of email templates. + NextToken *string + + noSmithyDocumentSerde +} + +type ListTemplatesOutput struct { + + // A token indicating that there are additional email templates available to be + // listed. Pass this token to a subsequent call to ListTemplates to retrieve the + // next set of email templates within your page size. + NextToken *string + + // An array the contains the name and creation time stamp for each template in + // your Amazon SES account. + TemplatesMetadata []types.TemplateMetadata + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListTemplates{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTemplates"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTemplates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTemplates", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListVerifiedEmailAddresses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListVerifiedEmailAddresses.go new file mode 100644 index 00000000..3cb6ae6a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ListVerifiedEmailAddresses.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deprecated. Use the ListIdentities operation to list the email addresses and +// domains associated with your account. +func (c *Client) ListVerifiedEmailAddresses(ctx context.Context, params *ListVerifiedEmailAddressesInput, optFns ...func(*Options)) (*ListVerifiedEmailAddressesOutput, error) { + if params == nil { + params = &ListVerifiedEmailAddressesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVerifiedEmailAddresses", params, optFns, c.addOperationListVerifiedEmailAddressesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVerifiedEmailAddressesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListVerifiedEmailAddressesInput struct { + noSmithyDocumentSerde +} + +// A list of email addresses that you have verified with Amazon SES under your +// Amazon Web Services account. +type ListVerifiedEmailAddressesOutput struct { + + // A list of email addresses that have been verified. + VerifiedEmailAddresses []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVerifiedEmailAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListVerifiedEmailAddresses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListVerifiedEmailAddresses{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListVerifiedEmailAddresses"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVerifiedEmailAddresses(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListVerifiedEmailAddresses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListVerifiedEmailAddresses", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutConfigurationSetDeliveryOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutConfigurationSetDeliveryOptions.go new file mode 100644 index 00000000..9270e69b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutConfigurationSetDeliveryOptions.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds or updates the delivery options for a configuration set. +func (c *Client) PutConfigurationSetDeliveryOptions(ctx context.Context, params *PutConfigurationSetDeliveryOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetDeliveryOptionsOutput, error) { + if params == nil { + params = &PutConfigurationSetDeliveryOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutConfigurationSetDeliveryOptions", params, optFns, c.addOperationPutConfigurationSetDeliveryOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutConfigurationSetDeliveryOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// A request to modify the delivery options for a configuration set. +type PutConfigurationSetDeliveryOptionsInput struct { + + // The name of the configuration set. + // + // This member is required. + ConfigurationSetName *string + + // Specifies whether messages that use the configuration set are required to use + // Transport Layer Security (TLS). + DeliveryOptions *types.DeliveryOptions + + noSmithyDocumentSerde +} + +// An HTTP 200 response if the request succeeds, or an error message if the +// request fails. +type PutConfigurationSetDeliveryOptionsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutConfigurationSetDeliveryOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpPutConfigurationSetDeliveryOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPutConfigurationSetDeliveryOptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutConfigurationSetDeliveryOptions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpPutConfigurationSetDeliveryOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConfigurationSetDeliveryOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutConfigurationSetDeliveryOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutConfigurationSetDeliveryOptions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutIdentityPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutIdentityPolicy.go new file mode 100644 index 00000000..fcfa5a56 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_PutIdentityPolicy.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds or updates a sending authorization policy for the specified identity (an +// email address or a domain). +// +// This operation is for the identity owner only. If you have not verified the +// identity, it returns an error. +// +// Sending authorization is a feature that enables an identity owner to authorize +// other senders to use its identities. For information about using sending +// authorization, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +func (c *Client) PutIdentityPolicy(ctx context.Context, params *PutIdentityPolicyInput, optFns ...func(*Options)) (*PutIdentityPolicyOutput, error) { + if params == nil { + params = &PutIdentityPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutIdentityPolicy", params, optFns, c.addOperationPutIdentityPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutIdentityPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to add or update a sending authorization policy for an +// identity. Sending authorization is an Amazon SES feature that enables you to +// authorize other senders to use your identities. For information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +type PutIdentityPolicyInput struct { + + // The identity to which that the policy applies. You can specify an identity by + // using its name or by using its Amazon Resource Name (ARN). Examples: + // user@example.com , example.com , + // arn:aws:ses:us-east-1:123456789012:identity/example.com . + // + // To successfully call this operation, you must own the identity. + // + // This member is required. + Identity *string + + // The text of the policy in JSON format. The policy cannot exceed 4 KB. + // + // For information about the syntax of sending authorization policies, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-policies.html + // + // This member is required. + Policy *string + + // The name of the policy. + // + // The policy name cannot exceed 64 characters and can only include alphanumeric + // characters, dashes, and underscores. + // + // This member is required. + PolicyName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type PutIdentityPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutIdentityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpPutIdentityPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPutIdentityPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutIdentityPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpPutIdentityPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutIdentityPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutIdentityPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutIdentityPolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ReorderReceiptRuleSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ReorderReceiptRuleSet.go new file mode 100644 index 00000000..dc6f5b19 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_ReorderReceiptRuleSet.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Reorders the receipt rules within a receipt rule set. +// +// All of the rules in the rule set must be represented in this request. That is, +// it is error if the reorder request doesn't explicitly position all of the rules. +// +// For information about managing receipt rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) ReorderReceiptRuleSet(ctx context.Context, params *ReorderReceiptRuleSetInput, optFns ...func(*Options)) (*ReorderReceiptRuleSetOutput, error) { + if params == nil { + params = &ReorderReceiptRuleSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ReorderReceiptRuleSet", params, optFns, c.addOperationReorderReceiptRuleSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ReorderReceiptRuleSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to reorder the receipt rules within a receipt rule set. +// You use receipt rule sets to receive email with Amazon SES. For more +// information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type ReorderReceiptRuleSetInput struct { + + // The specified receipt rule set's receipt rules, in order. + // + // This member is required. + RuleNames []string + + // The name of the receipt rule set to reorder. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type ReorderReceiptRuleSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationReorderReceiptRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpReorderReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpReorderReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ReorderReceiptRuleSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpReorderReceiptRuleSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReorderReceiptRuleSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opReorderReceiptRuleSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ReorderReceiptRuleSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBounce.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBounce.go new file mode 100644 index 00000000..a37bf308 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBounce.go @@ -0,0 +1,179 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Generates and sends a bounce message to the sender of an email you received +// through Amazon SES. You can only use this operation on an email up to 24 hours +// after you receive it. +// +// You cannot use this operation to send generic bounces for mail that was not +// received by Amazon SES. +// +// For information about receiving email through Amazon SES, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email.html +func (c *Client) SendBounce(ctx context.Context, params *SendBounceInput, optFns ...func(*Options)) (*SendBounceOutput, error) { + if params == nil { + params = &SendBounceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendBounce", params, optFns, c.addOperationSendBounceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendBounceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to send a bounce message to the sender of an email you +// received through Amazon SES. +type SendBounceInput struct { + + // The address to use in the "From" header of the bounce message. This must be an + // identity that you have verified with Amazon SES. + // + // This member is required. + BounceSender *string + + // A list of recipients of the bounced message, including the information required + // to create the Delivery Status Notifications (DSNs) for the recipients. You must + // specify at least one BouncedRecipientInfo in the list. + // + // This member is required. + BouncedRecipientInfoList []types.BouncedRecipientInfo + + // The message ID of the message to be bounced. + // + // This member is required. + OriginalMessageId *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to use the address in the "From" header of the bounce. For more information + // about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + BounceSenderArn *string + + // Human-readable text for the bounce message to explain the failure. If not + // specified, the text is auto-generated based on the bounced recipient + // information. + Explanation *string + + // Message-related DSN fields. If not specified, Amazon SES chooses the values. + MessageDsn *types.MessageDsn + + noSmithyDocumentSerde +} + +// Represents a unique message ID. +type SendBounceOutput struct { + + // The message ID of the bounce message. + MessageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendBounceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSendBounce{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendBounce{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendBounce"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendBounceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendBounce(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendBounce(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendBounce", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBulkTemplatedEmail.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBulkTemplatedEmail.go new file mode 100644 index 00000000..f5110c63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendBulkTemplatedEmail.go @@ -0,0 +1,272 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Composes an email message to multiple destinations. The message body is created +// using an email template. +// +// To send email using this operation, your call must meet the following +// requirements: +// +// - The call must refer to an existing email template. You can create email +// templates using CreateTemplate. +// +// - The message must be sent from a verified email address or domain. +// +// - If your account is still in the Amazon SES sandbox, you may send only to +// verified addresses or domains, or to email addresses associated with the Amazon +// SES Mailbox Simulator. For more information, see [Verifying Email Addresses and Domains]in the Amazon SES Developer +// Guide. +// +// - The maximum message size is 10 MB. +// +// - Each Destination parameter must include at least one recipient email +// address. The recipient address can be a To: address, a CC: address, or a BCC: +// address. If a recipient email address is invalid (that is, it is not in the +// format UserName@[SubDomain.]Domain.TopLevelDomain), the entire message is +// rejected, even if the message contains other recipients that are valid. +// +// - The message may not include more than 50 recipients, across the To:, CC: +// and BCC: fields. If you need to send an email message to a larger audience, you +// can divide your recipient list into groups of 50 or fewer, and then call the +// SendBulkTemplatedEmail operation several times to send the message to each +// group. +// +// - The number of destinations you can contact in a single call can be limited +// by your account's maximum sending rate. +// +// [Verifying Email Addresses and Domains]: https://docs.aws.amazon.com/ses/latest/dg/verify-addresses-and-domains.html +func (c *Client) SendBulkTemplatedEmail(ctx context.Context, params *SendBulkTemplatedEmailInput, optFns ...func(*Options)) (*SendBulkTemplatedEmailOutput, error) { + if params == nil { + params = &SendBulkTemplatedEmailInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendBulkTemplatedEmail", params, optFns, c.addOperationSendBulkTemplatedEmailMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendBulkTemplatedEmailOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to send a templated email to multiple destinations using +// Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html +type SendBulkTemplatedEmailInput struct { + + // One or more Destination objects. All of the recipients in a Destination receive + // the same version of the email. You can specify up to 50 Destination objects + // within a Destinations array. + // + // This member is required. + Destinations []types.BulkEmailDestination + + // The email address that is sending the email. This email address must be either + // individually verified with Amazon SES, or from a domain that has been verified + // with Amazon SES. For information about verifying identities, see the [Amazon SES Developer Guide]. + // + // If you are sending on behalf of another user and have been permitted to do so + // by a sending authorization policy, then you must also specify the SourceArn + // parameter. For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // Amazon SES does not support the SMTPUTF8 extension, as described in [RFC6531]. For this + // reason, the email address string must be 7-bit ASCII. If you want to send to or + // from email addresses that contain Unicode characters in the domain part of an + // address, you must encode the domain using Punycode. Punycode is not permitted in + // the local part of the email address (the part before the @ sign) nor in the + // "friendly from" name. If you want to use Unicode characters in the "friendly + // from" name, you must encode the "friendly from" name using MIME encoded-word + // syntax, as described in [Sending raw email using the Amazon SES API]. For more information about Punycode, see [RFC 3492]. + // + // [RFC6531]: https://tools.ietf.org/html/rfc6531 + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + // [Sending raw email using the Amazon SES API]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html + // [RFC 3492]: http://tools.ietf.org/html/rfc3492 + // + // This member is required. + Source *string + + // The template to use when sending this email. + // + // This member is required. + Template *string + + // The name of the configuration set to use when you send an email using + // SendBulkTemplatedEmail . + ConfigurationSetName *string + + // A list of tags, in the form of name/value pairs, to apply to an email that you + // send to a destination using SendBulkTemplatedEmail . + DefaultTags []types.MessageTag + + // A list of replacement values to apply to the template when replacement data is + // not specified in a Destination object. These values act as a default or fallback + // option when no other data is available. + // + // The template data is a JSON object, typically consisting of key-value pairs in + // which the keys correspond to replacement tags in the email template. + DefaultTemplateData *string + + // The reply-to email address(es) for the message. If the recipient replies to the + // message, each reply-to address receives the reply. + ReplyToAddresses []string + + // The email address that bounces and complaints are forwarded to when feedback + // forwarding is enabled. If the message cannot be delivered to the recipient, then + // an error message is returned from the recipient's ISP; this message is forwarded + // to the email address specified by the ReturnPath parameter. The ReturnPath + // parameter is never overwritten. This email address must be either individually + // verified with Amazon SES, or from a domain that has been verified with Amazon + // SES. + ReturnPath *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to use the email address specified in the ReturnPath parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to use feedback@example.com , then you would specify the + // ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the ReturnPath to be feedback@example.com . + // + // For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + ReturnPathArn *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to send for the email address specified in the Source parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to send from user@example.com , then you would specify + // the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the Source to be user@example.com . + // + // For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + SourceArn *string + + // The ARN of the template to use when sending this email. + TemplateArn *string + + noSmithyDocumentSerde +} + +type SendBulkTemplatedEmailOutput struct { + + // One object per intended recipient. Check each response object and retry any + // messages with a failure status. (Note that order of responses will be respective + // to order of destinations in the request.)Receipt rules enable you to specify + // which actions + // + // This member is required. + Status []types.BulkEmailDestinationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendBulkTemplatedEmailMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSendBulkTemplatedEmail{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendBulkTemplatedEmail{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendBulkTemplatedEmail"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendBulkTemplatedEmailValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendBulkTemplatedEmail(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendBulkTemplatedEmail(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendBulkTemplatedEmail", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendCustomVerificationEmail.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendCustomVerificationEmail.go new file mode 100644 index 00000000..4ee8b7ec --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendCustomVerificationEmail.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds an email address to the list of identities for your Amazon SES account in +// the current Amazon Web Services Region and attempts to verify it. As a result of +// executing this operation, a customized verification email is sent to the +// specified address. +// +// To use this operation, you must first create a custom verification email +// template. For more information about creating and using custom verification +// email templates, see [Using Custom Verification Email Templates]in the Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. +// +// [Using Custom Verification Email Templates]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom +func (c *Client) SendCustomVerificationEmail(ctx context.Context, params *SendCustomVerificationEmailInput, optFns ...func(*Options)) (*SendCustomVerificationEmailOutput, error) { + if params == nil { + params = &SendCustomVerificationEmailInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendCustomVerificationEmail", params, optFns, c.addOperationSendCustomVerificationEmailMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendCustomVerificationEmailOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to send a custom verification email to a specified +// recipient. +type SendCustomVerificationEmailInput struct { + + // The email address to verify. + // + // This member is required. + EmailAddress *string + + // The name of the custom verification email template to use when sending the + // verification email. + // + // This member is required. + TemplateName *string + + // Name of a configuration set to use when sending the verification email. + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +// The response received when attempting to send the custom verification email. +type SendCustomVerificationEmailOutput struct { + + // The unique message identifier returned from the SendCustomVerificationEmail + // operation. + MessageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendCustomVerificationEmailMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSendCustomVerificationEmail{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendCustomVerificationEmail{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendCustomVerificationEmail"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendCustomVerificationEmailValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendCustomVerificationEmail(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendCustomVerificationEmail(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendCustomVerificationEmail", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendEmail.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendEmail.go new file mode 100644 index 00000000..e9b588c5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendEmail.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Composes an email message and immediately queues it for sending. To send email +// using this operation, your message must meet the following requirements: +// +// - The message must be sent from a verified email address or domain. If you +// attempt to send email using a non-verified address or domain, the operation +// results in an "Email address not verified" error. +// +// - If your account is still in the Amazon SES sandbox, you may only send to +// verified addresses or domains, or to email addresses associated with the Amazon +// SES Mailbox Simulator. For more information, see [Verifying Email Addresses and Domains]in the Amazon SES Developer +// Guide. +// +// - The maximum message size is 10 MB. +// +// - The message must include at least one recipient email address. The +// recipient address can be a To: address, a CC: address, or a BCC: address. If a +// recipient email address is invalid (that is, it is not in the format +// UserName@[SubDomain.]Domain.TopLevelDomain), the entire message is rejected, +// even if the message contains other recipients that are valid. +// +// - The message may not include more than 50 recipients, across the To:, CC: +// and BCC: fields. If you need to send an email message to a larger audience, you +// can divide your recipient list into groups of 50 or fewer, and then call the +// SendEmail operation several times to send the message to each group. +// +// For every message that you send, the total number of recipients (including each +// recipient in the To:, CC: and BCC: fields) is counted against the maximum number +// of emails you can send in a 24-hour period (your sending quota). For more +// information about sending quotas in Amazon SES, see [Managing Your Amazon SES Sending Limits]in the Amazon SES Developer +// Guide. +// +// [Verifying Email Addresses and Domains]: https://docs.aws.amazon.com/ses/latest/dg/verify-addresses-and-domains.html +// [Managing Your Amazon SES Sending Limits]: https://docs.aws.amazon.com/ses/latest/dg/manage-sending-quotas.html +func (c *Client) SendEmail(ctx context.Context, params *SendEmailInput, optFns ...func(*Options)) (*SendEmailOutput, error) { + if params == nil { + params = &SendEmailInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendEmail", params, optFns, c.addOperationSendEmailMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendEmailOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to send a single formatted email using Amazon SES. For +// more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-formatted.html +type SendEmailInput struct { + + // The destination for this email, composed of To:, CC:, and BCC: fields. + // + // This member is required. + Destination *types.Destination + + // The message to be sent. + // + // This member is required. + Message *types.Message + + // The email address that is sending the email. This email address must be either + // individually verified with Amazon SES, or from a domain that has been verified + // with Amazon SES. For information about verifying identities, see the [Amazon SES Developer Guide]. + // + // If you are sending on behalf of another user and have been permitted to do so + // by a sending authorization policy, then you must also specify the SourceArn + // parameter. For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // Amazon SES does not support the SMTPUTF8 extension, as described in [RFC6531]. For this + // reason, the email address string must be 7-bit ASCII. If you want to send to or + // from email addresses that contain Unicode characters in the domain part of an + // address, you must encode the domain using Punycode. Punycode is not permitted in + // the local part of the email address (the part before the @ sign) nor in the + // "friendly from" name. If you want to use Unicode characters in the "friendly + // from" name, you must encode the "friendly from" name using MIME encoded-word + // syntax, as described in [Sending raw email using the Amazon SES API]. For more information about Punycode, see [RFC 3492]. + // + // [RFC6531]: https://tools.ietf.org/html/rfc6531 + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + // [Sending raw email using the Amazon SES API]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html + // [RFC 3492]: http://tools.ietf.org/html/rfc3492 + // + // This member is required. + Source *string + + // The name of the configuration set to use when you send an email using SendEmail . + ConfigurationSetName *string + + // The reply-to email address(es) for the message. If the recipient replies to the + // message, each reply-to address receives the reply. + ReplyToAddresses []string + + // The email address that bounces and complaints are forwarded to when feedback + // forwarding is enabled. If the message cannot be delivered to the recipient, then + // an error message is returned from the recipient's ISP; this message is forwarded + // to the email address specified by the ReturnPath parameter. The ReturnPath + // parameter is never overwritten. This email address must be either individually + // verified with Amazon SES, or from a domain that has been verified with Amazon + // SES. + ReturnPath *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to use the email address specified in the ReturnPath parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to use feedback@example.com , then you would specify the + // ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the ReturnPath to be feedback@example.com . + // + // For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + ReturnPathArn *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to send for the email address specified in the Source parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to send from user@example.com , then you would specify + // the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the Source to be user@example.com . + // + // For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + SourceArn *string + + // A list of tags, in the form of name/value pairs, to apply to an email that you + // send using SendEmail . Tags correspond to characteristics of the email that you + // define, so that you can publish email sending events. + Tags []types.MessageTag + + noSmithyDocumentSerde +} + +// Represents a unique message ID. +type SendEmailOutput struct { + + // The unique message identifier returned from the SendEmail action. + // + // This member is required. + MessageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendEmailMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSendEmail{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendEmail{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendEmail"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendEmailValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendEmail(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendEmail(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendEmail", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendRawEmail.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendRawEmail.go new file mode 100644 index 00000000..96f70a3d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendRawEmail.go @@ -0,0 +1,340 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Composes an email message and immediately queues it for sending. +// +// This operation is more flexible than the SendEmail operation. When you use the +// SendRawEmail operation, you can specify the headers of the message as well as +// its content. This flexibility is useful, for example, when you need to send a +// multipart MIME email (such a message that contains both a text and an HTML +// version). You can also use this operation to send messages that include +// attachments. +// +// The SendRawEmail operation has the following requirements: +// +// - You can only send email from [verified email addresses or domains]. If you try to send email from an address +// that isn't verified, the operation results in an "Email address not verified" +// error. +// +// - If your account is still in the [Amazon SES sandbox], you can only send email to other verified +// addresses in your account, or to addresses that are associated with the [Amazon SES mailbox simulator]. +// +// - The maximum message size, including attachments, is 10 MB. +// +// - Each message has to include at least one recipient address. A recipient +// address includes any address on the To:, CC:, or BCC: lines. +// +// - If you send a single message to more than one recipient address, and one of +// the recipient addresses isn't in a valid format (that is, it's not in the format +// UserName@[SubDomain.]Domain.TopLevelDomain), Amazon SES rejects the entire +// message, even if the other addresses are valid. +// +// - Each message can include up to 50 recipient addresses across the To:, CC:, +// or BCC: lines. If you need to send a single message to more than 50 recipients, +// you have to split the list of recipient addresses into groups of less than 50 +// recipients, and send separate messages to each group. +// +// - Amazon SES allows you to specify 8-bit Content-Transfer-Encoding for MIME +// message parts. However, if Amazon SES has to modify the contents of your message +// (for example, if you use open and click tracking), 8-bit content isn't +// preserved. For this reason, we highly recommend that you encode all content that +// isn't 7-bit ASCII. For more information, see [MIME Encoding]in the Amazon SES Developer +// Guide. +// +// Additionally, keep the following considerations in mind when using the +// SendRawEmail operation: +// +// - Although you can customize the message headers when using the SendRawEmail +// operation, Amazon SES automatically applies its own Message-ID and Date +// headers; if you passed these headers when creating the message, they are +// overwritten by the values that Amazon SES provides. +// +// - If you are using sending authorization to send on behalf of another user, +// SendRawEmail enables you to specify the cross-account identity for the email's +// Source, From, and Return-Path parameters in one of two ways: you can pass +// optional parameters SourceArn , FromArn , and/or ReturnPathArn , or you can +// include the following X-headers in the header of your raw email: +// +// - X-SES-SOURCE-ARN +// +// - X-SES-FROM-ARN +// +// - X-SES-RETURN-PATH-ARN +// +// Don't include these X-headers in the DKIM signature. Amazon SES removes these +// +// before it sends the email. +// +// If you only specify the SourceIdentityArn parameter, Amazon SES sets the From +// +// and Return-Path addresses to the same identity that you specified. +// +// For more information about sending authorization, see the [Using Sending Authorization with Amazon SES]in the Amazon SES +// +// Developer Guide. +// +// - For every message that you send, the total number of recipients (including +// each recipient in the To:, CC: and BCC: fields) is counted against the maximum +// number of emails you can send in a 24-hour period (your sending quota). For more +// information about sending quotas in Amazon SES, see [Managing Your Amazon SES Sending Limits]in the Amazon SES +// Developer Guide. +// +// [Using Sending Authorization with Amazon SES]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html +// [MIME Encoding]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html#send-email-mime-encoding +// [Amazon SES mailbox simulator]: https://docs.aws.amazon.com/ses/latest/dg/send-an-email-from-console.html +// [Amazon SES sandbox]: https://docs.aws.amazon.com/ses/latest/dg/request-production-access.html +// [verified email addresses or domains]: https://docs.aws.amazon.com/ses/latest/dg/verify-addresses-and-domains.html +// +// [Managing Your Amazon SES Sending Limits]: https://docs.aws.amazon.com/ses/latest/dg/manage-sending-quotas.html +func (c *Client) SendRawEmail(ctx context.Context, params *SendRawEmailInput, optFns ...func(*Options)) (*SendRawEmailOutput, error) { + if params == nil { + params = &SendRawEmailInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendRawEmail", params, optFns, c.addOperationSendRawEmailMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendRawEmailOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to send a single raw email using Amazon SES. For more +// information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html +type SendRawEmailInput struct { + + // The raw email message itself. The message has to meet the following criteria: + // + // - The message has to contain a header and a body, separated by a blank line. + // + // - All of the required header fields must be present in the message. + // + // - Each part of a multipart MIME message must be formatted properly. + // + // - Attachments must be of a content type that Amazon SES supports. For a list + // on unsupported content types, see [Unsupported Attachment Types]in the Amazon SES Developer Guide. + // + // - The entire message must be base64-encoded. + // + // - If any of the MIME parts in your message contain content that is outside of + // the 7-bit ASCII character range, we highly recommend that you encode that + // content. For more information, see [Sending Raw Email]in the Amazon SES Developer Guide. + // + // - Per [RFC 5321], the maximum length of each line of text, including the , must not + // exceed 1,000 characters. + // + // [Sending Raw Email]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html + // [Unsupported Attachment Types]: https://docs.aws.amazon.com/ses/latest/dg/mime-types.html + // [RFC 5321]: https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 + // + // This member is required. + RawMessage *types.RawMessage + + // The name of the configuration set to use when you send an email using + // SendRawEmail . + ConfigurationSetName *string + + // A list of destinations for the message, consisting of To:, CC:, and BCC: + // addresses. + Destinations []string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to specify a particular "From" address in the header of the raw email. + // + // Instead of using this parameter, you can use the X-header X-SES-FROM-ARN in the + // raw message of the email. If you use both the FromArn parameter and the + // corresponding X-header, Amazon SES uses the value of the FromArn parameter. + // + // For information about when to use this parameter, see the description of + // SendRawEmail in this guide, or see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-delegate-sender-tasks-email.html + FromArn *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to use the email address specified in the ReturnPath parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to use feedback@example.com , then you would specify the + // ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the ReturnPath to be feedback@example.com . + // + // Instead of using this parameter, you can use the X-header X-SES-RETURN-PATH-ARN + // in the raw message of the email. If you use both the ReturnPathArn parameter + // and the corresponding X-header, Amazon SES uses the value of the ReturnPathArn + // parameter. + // + // For information about when to use this parameter, see the description of + // SendRawEmail in this guide, or see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-delegate-sender-tasks-email.html + ReturnPathArn *string + + // The identity's email address. If you do not provide a value for this parameter, + // you must specify a "From" address in the raw text of the message. (You can also + // specify both.) + // + // Amazon SES does not support the SMTPUTF8 extension, as described in[RFC6531] . For this + // reason, the email address string must be 7-bit ASCII. If you want to send to or + // from email addresses that contain Unicode characters in the domain part of an + // address, you must encode the domain using Punycode. Punycode is not permitted in + // the local part of the email address (the part before the @ sign) nor in the + // "friendly from" name. If you want to use Unicode characters in the "friendly + // from" name, you must encode the "friendly from" name using MIME encoded-word + // syntax, as described in [Sending raw email using the Amazon SES API]. For more information about Punycode, see [RFC 3492]. + // + // If you specify the Source parameter and have feedback forwarding enabled, then + // bounces and complaints are sent to this email address. This takes precedence + // over any Return-Path header that you might include in the raw text of the + // message. + // + // [RFC6531]: https://tools.ietf.org/html/rfc6531 + // [Sending raw email using the Amazon SES API]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html + // [RFC 3492]: http://tools.ietf.org/html/rfc3492 + Source *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to send for the email address specified in the Source parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to send from user@example.com , then you would specify + // the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the Source to be user@example.com . + // + // Instead of using this parameter, you can use the X-header X-SES-SOURCE-ARN in + // the raw message of the email. If you use both the SourceArn parameter and the + // corresponding X-header, Amazon SES uses the value of the SourceArn parameter. + // + // For information about when to use this parameter, see the description of + // SendRawEmail in this guide, or see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-delegate-sender-tasks-email.html + SourceArn *string + + // A list of tags, in the form of name/value pairs, to apply to an email that you + // send using SendRawEmail . Tags correspond to characteristics of the email that + // you define, so that you can publish email sending events. + Tags []types.MessageTag + + noSmithyDocumentSerde +} + +// Represents a unique message ID. +type SendRawEmailOutput struct { + + // The unique message identifier returned from the SendRawEmail action. + // + // This member is required. + MessageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendRawEmailMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSendRawEmail{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendRawEmail{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendRawEmail"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendRawEmailValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendRawEmail(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendRawEmail(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendRawEmail", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendTemplatedEmail.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendTemplatedEmail.go new file mode 100644 index 00000000..5290db59 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SendTemplatedEmail.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Composes an email message using an email template and immediately queues it for +// sending. +// +// To send email using this operation, your call must meet the following +// requirements: +// +// - The call must refer to an existing email template. You can create email +// templates using the CreateTemplateoperation. +// +// - The message must be sent from a verified email address or domain. +// +// - If your account is still in the Amazon SES sandbox, you may only send to +// verified addresses or domains, or to email addresses associated with the Amazon +// SES Mailbox Simulator. For more information, see [Verifying Email Addresses and Domains]in the Amazon SES Developer +// Guide. +// +// - The maximum message size is 10 MB. +// +// - Calls to the SendTemplatedEmail operation may only include one Destination +// parameter. A destination is a set of recipients that receives the same version +// of the email. The Destination parameter can include up to 50 recipients, +// across the To:, CC: and BCC: fields. +// +// - The Destination parameter must include at least one recipient email address. +// The recipient address can be a To: address, a CC: address, or a BCC: address. If +// a recipient email address is invalid (that is, it is not in the format +// UserName@[SubDomain.]Domain.TopLevelDomain), the entire message is rejected, +// even if the message contains other recipients that are valid. +// +// If your call to the SendTemplatedEmail operation includes all of the required +// parameters, Amazon SES accepts it and returns a Message ID. However, if Amazon +// SES can't render the email because the template contains errors, it doesn't send +// the email. Additionally, because it already accepted the message, Amazon SES +// doesn't return a message stating that it was unable to send the email. +// +// For these reasons, we highly recommend that you set up Amazon SES to send you +// notifications when Rendering Failure events occur. For more information, see [Sending Personalized Email Using the Amazon SES API]in +// the Amazon Simple Email Service Developer Guide. +// +// [Sending Personalized Email Using the Amazon SES API]: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html +// [Verifying Email Addresses and Domains]: https://docs.aws.amazon.com/ses/latest/dg/verify-addresses-and-domains.html +func (c *Client) SendTemplatedEmail(ctx context.Context, params *SendTemplatedEmailInput, optFns ...func(*Options)) (*SendTemplatedEmailOutput, error) { + if params == nil { + params = &SendTemplatedEmailInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendTemplatedEmail", params, optFns, c.addOperationSendTemplatedEmailMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendTemplatedEmailOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to send a templated email using Amazon SES. For more +// information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html +type SendTemplatedEmailInput struct { + + // The destination for this email, composed of To:, CC:, and BCC: fields. A + // Destination can include up to 50 recipients across these three fields. + // + // This member is required. + Destination *types.Destination + + // The email address that is sending the email. This email address must be either + // individually verified with Amazon SES, or from a domain that has been verified + // with Amazon SES. For information about verifying identities, see the [Amazon SES Developer Guide]. + // + // If you are sending on behalf of another user and have been permitted to do so + // by a sending authorization policy, then you must also specify the SourceArn + // parameter. For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // Amazon SES does not support the SMTPUTF8 extension, as described in [RFC6531]. for this + // reason, The email address string must be 7-bit ASCII. If you want to send to or + // from email addresses that contain Unicode characters in the domain part of an + // address, you must encode the domain using Punycode. Punycode is not permitted in + // the local part of the email address (the part before the @ sign) nor in the + // "friendly from" name. If you want to use Unicode characters in the "friendly + // from" name, you must encode the "friendly from" name using MIME encoded-word + // syntax, as described in [Sending raw email using the Amazon SES API]. For more information about Punycode, see [RFC 3492]. + // + // [RFC6531]: https://tools.ietf.org/html/rfc6531 + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + // [Sending raw email using the Amazon SES API]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html + // [RFC 3492]: http://tools.ietf.org/html/rfc3492 + // + // This member is required. + Source *string + + // The template to use when sending this email. + // + // This member is required. + Template *string + + // A list of replacement values to apply to the template. This parameter is a JSON + // object, typically consisting of key-value pairs in which the keys correspond to + // replacement tags in the email template. + // + // This member is required. + TemplateData *string + + // The name of the configuration set to use when you send an email using + // SendTemplatedEmail . + ConfigurationSetName *string + + // The reply-to email address(es) for the message. If the recipient replies to the + // message, each reply-to address receives the reply. + ReplyToAddresses []string + + // The email address that bounces and complaints are forwarded to when feedback + // forwarding is enabled. If the message cannot be delivered to the recipient, then + // an error message is returned from the recipient's ISP; this message is forwarded + // to the email address specified by the ReturnPath parameter. The ReturnPath + // parameter is never overwritten. This email address must be either individually + // verified with Amazon SES, or from a domain that has been verified with Amazon + // SES. + ReturnPath *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to use the email address specified in the ReturnPath parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to use feedback@example.com , then you would specify the + // ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the ReturnPath to be feedback@example.com . + // + // For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + ReturnPathArn *string + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to send for the email address specified in the Source parameter. + // + // For example, if the owner of example.com (which has ARN + // arn:aws:ses:us-east-1:123456789012:identity/example.com ) attaches a policy to + // it that authorizes you to send from user@example.com , then you would specify + // the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com , + // and the Source to be user@example.com . + // + // For more information about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + SourceArn *string + + // A list of tags, in the form of name/value pairs, to apply to an email that you + // send using SendTemplatedEmail . Tags correspond to characteristics of the email + // that you define, so that you can publish email sending events. + Tags []types.MessageTag + + // The ARN of the template to use when sending this email. + TemplateArn *string + + noSmithyDocumentSerde +} + +type SendTemplatedEmailOutput struct { + + // The unique message identifier returned from the SendTemplatedEmail action. + // + // This member is required. + MessageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendTemplatedEmailMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSendTemplatedEmail{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendTemplatedEmail{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendTemplatedEmail"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSendTemplatedEmailValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendTemplatedEmail(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendTemplatedEmail(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendTemplatedEmail", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetActiveReceiptRuleSet.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetActiveReceiptRuleSet.go new file mode 100644 index 00000000..580093d9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetActiveReceiptRuleSet.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sets the specified receipt rule set as the active receipt rule set. +// +// To disable your email-receiving through Amazon SES completely, you can call +// this operation with RuleSetName set to null. +// +// For information about managing receipt rule sets, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) SetActiveReceiptRuleSet(ctx context.Context, params *SetActiveReceiptRuleSetInput, optFns ...func(*Options)) (*SetActiveReceiptRuleSetOutput, error) { + if params == nil { + params = &SetActiveReceiptRuleSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetActiveReceiptRuleSet", params, optFns, c.addOperationSetActiveReceiptRuleSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetActiveReceiptRuleSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to set a receipt rule set as the active receipt rule set. +// You use receipt rule sets to receive email with Amazon SES. For more +// information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type SetActiveReceiptRuleSetInput struct { + + // The name of the receipt rule set to make active. Setting this value to null + // disables all email receiving. + RuleSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type SetActiveReceiptRuleSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetActiveReceiptRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetActiveReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetActiveReceiptRuleSet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetActiveReceiptRuleSet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetActiveReceiptRuleSet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetActiveReceiptRuleSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetActiveReceiptRuleSet", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityDkimEnabled.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityDkimEnabled.go new file mode 100644 index 00000000..1b71a064 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityDkimEnabled.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables or disables Easy DKIM signing of email sent from an identity. If Easy +// DKIM signing is enabled for a domain, then Amazon SES uses DKIM to sign all +// email that it sends from addresses on that domain. If Easy DKIM signing is +// enabled for an email address, then Amazon SES uses DKIM to sign all email it +// sends from that address. +// +// For email addresses (for example, user@example.com ), you can only enable DKIM +// signing if the corresponding domain (in this case, example.com ) has been set up +// to use Easy DKIM. +// +// You can enable DKIM signing for an identity at any time after you start the +// verification process for the identity, even if the verification process isn't +// complete. +// +// You can execute this operation no more than once per second. +// +// For more information about Easy DKIM signing, go to the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy.html +func (c *Client) SetIdentityDkimEnabled(ctx context.Context, params *SetIdentityDkimEnabledInput, optFns ...func(*Options)) (*SetIdentityDkimEnabledOutput, error) { + if params == nil { + params = &SetIdentityDkimEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetIdentityDkimEnabled", params, optFns, c.addOperationSetIdentityDkimEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetIdentityDkimEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to enable or disable Amazon SES Easy DKIM signing for an +// identity. For more information about setting up Easy DKIM, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy.html +type SetIdentityDkimEnabledInput struct { + + // Sets whether DKIM signing is enabled for an identity. Set to true to enable + // DKIM signing for this identity; false to disable it. + // + // This member is required. + DkimEnabled bool + + // The identity for which DKIM signing should be enabled or disabled. + // + // This member is required. + Identity *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type SetIdentityDkimEnabledOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetIdentityDkimEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetIdentityDkimEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetIdentityDkimEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetIdentityDkimEnabled"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSetIdentityDkimEnabledValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetIdentityDkimEnabled(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetIdentityDkimEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetIdentityDkimEnabled", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityFeedbackForwardingEnabled.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityFeedbackForwardingEnabled.go new file mode 100644 index 00000000..4369e152 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityFeedbackForwardingEnabled.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Given an identity (an email address or a domain), enables or disables whether +// Amazon SES forwards bounce and complaint notifications as email. Feedback +// forwarding can only be disabled when Amazon Simple Notification Service (Amazon +// SNS) topics are specified for both bounces and complaints. +// +// Feedback forwarding does not apply to delivery notifications. Delivery +// notifications are only available through Amazon SNS. +// +// You can execute this operation no more than once per second. +// +// For more information about using notifications with Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications.html +func (c *Client) SetIdentityFeedbackForwardingEnabled(ctx context.Context, params *SetIdentityFeedbackForwardingEnabledInput, optFns ...func(*Options)) (*SetIdentityFeedbackForwardingEnabledOutput, error) { + if params == nil { + params = &SetIdentityFeedbackForwardingEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetIdentityFeedbackForwardingEnabled", params, optFns, c.addOperationSetIdentityFeedbackForwardingEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetIdentityFeedbackForwardingEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to enable or disable whether Amazon SES forwards you +// bounce and complaint notifications through email. For information about email +// feedback forwarding, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications-email.html +type SetIdentityFeedbackForwardingEnabledInput struct { + + // Sets whether Amazon SES forwards bounce and complaint notifications as email. + // true specifies that Amazon SES forwards bounce and complaint notifications as + // email, in addition to any Amazon SNS topic publishing otherwise specified. false + // specifies that Amazon SES publishes bounce and complaint notifications only + // through Amazon SNS. This value can only be set to false when Amazon SNS topics + // are set for both Bounce and Complaint notification types. + // + // This member is required. + ForwardingEnabled bool + + // The identity for which to set bounce and complaint notification forwarding. + // Examples: user@example.com , example.com . + // + // This member is required. + Identity *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type SetIdentityFeedbackForwardingEnabledOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetIdentityFeedbackForwardingEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetIdentityFeedbackForwardingEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetIdentityFeedbackForwardingEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetIdentityFeedbackForwardingEnabled"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSetIdentityFeedbackForwardingEnabledValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetIdentityFeedbackForwardingEnabled(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetIdentityFeedbackForwardingEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetIdentityFeedbackForwardingEnabled", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityHeadersInNotificationsEnabled.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityHeadersInNotificationsEnabled.go new file mode 100644 index 00000000..e3bb1213 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityHeadersInNotificationsEnabled.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Given an identity (an email address or a domain), sets whether Amazon SES +// includes the original email headers in the Amazon Simple Notification Service +// (Amazon SNS) notifications of a specified type. +// +// You can execute this operation no more than once per second. +// +// For more information about using notifications with Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications.html +func (c *Client) SetIdentityHeadersInNotificationsEnabled(ctx context.Context, params *SetIdentityHeadersInNotificationsEnabledInput, optFns ...func(*Options)) (*SetIdentityHeadersInNotificationsEnabledOutput, error) { + if params == nil { + params = &SetIdentityHeadersInNotificationsEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetIdentityHeadersInNotificationsEnabled", params, optFns, c.addOperationSetIdentityHeadersInNotificationsEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetIdentityHeadersInNotificationsEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to set whether Amazon SES includes the original email +// headers in the Amazon SNS notifications of a specified type. For information +// about notifications, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications-sns.html +type SetIdentityHeadersInNotificationsEnabledInput struct { + + // Sets whether Amazon SES includes the original email headers in Amazon SNS + // notifications of the specified notification type. A value of true specifies + // that Amazon SES includes headers in notifications, and a value of false + // specifies that Amazon SES does not include headers in notifications. + // + // This value can only be set when NotificationType is already set to use a + // particular Amazon SNS topic. + // + // This member is required. + Enabled bool + + // The identity for which to enable or disable headers in notifications. Examples: + // user@example.com , example.com . + // + // This member is required. + Identity *string + + // The notification type for which to enable or disable headers in notifications. + // + // This member is required. + NotificationType types.NotificationType + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type SetIdentityHeadersInNotificationsEnabledOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetIdentityHeadersInNotificationsEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetIdentityHeadersInNotificationsEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetIdentityHeadersInNotificationsEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetIdentityHeadersInNotificationsEnabled"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSetIdentityHeadersInNotificationsEnabledValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetIdentityHeadersInNotificationsEnabled(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetIdentityHeadersInNotificationsEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetIdentityHeadersInNotificationsEnabled", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityMailFromDomain.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityMailFromDomain.go new file mode 100644 index 00000000..1e4740c9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityMailFromDomain.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables or disables the custom MAIL FROM domain setup for a verified identity +// (an email address or a domain). +// +// To send emails using the specified MAIL FROM domain, you must add an MX record +// to your MAIL FROM domain's DNS settings. To ensure that your emails pass Sender +// Policy Framework (SPF) checks, you must also add or update an SPF record. For +// more information, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/mail-from.html +func (c *Client) SetIdentityMailFromDomain(ctx context.Context, params *SetIdentityMailFromDomainInput, optFns ...func(*Options)) (*SetIdentityMailFromDomainOutput, error) { + if params == nil { + params = &SetIdentityMailFromDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetIdentityMailFromDomain", params, optFns, c.addOperationSetIdentityMailFromDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetIdentityMailFromDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to enable or disable the Amazon SES custom MAIL FROM +// domain setup for a verified identity. For information about using a custom MAIL +// FROM domain, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/mail-from.html +type SetIdentityMailFromDomainInput struct { + + // The verified identity. + // + // This member is required. + Identity *string + + // The action for Amazon SES to take if it cannot successfully read the required + // MX record when you send an email. If you choose UseDefaultValue , Amazon SES + // uses amazonses.com (or a subdomain of that) as the MAIL FROM domain. If you + // choose RejectMessage , Amazon SES returns a MailFromDomainNotVerified error and + // not send the email. + // + // The action specified in BehaviorOnMXFailure is taken when the custom MAIL FROM + // domain setup is in the Pending , Failed , and TemporaryFailure states. + BehaviorOnMXFailure types.BehaviorOnMXFailure + + // The custom MAIL FROM domain for the verified identity to use. The MAIL FROM + // domain must 1) be a subdomain of the verified identity, 2) not be used in a + // "From" address if the MAIL FROM domain is the destination of email feedback + // forwarding (for more information, see the [Amazon SES Developer Guide]), and 3) not be used to receive + // emails. A value of null disables the custom MAIL FROM setting for the identity. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/mail-from.html + MailFromDomain *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type SetIdentityMailFromDomainOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetIdentityMailFromDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetIdentityMailFromDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetIdentityMailFromDomain{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetIdentityMailFromDomain"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSetIdentityMailFromDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetIdentityMailFromDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetIdentityMailFromDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetIdentityMailFromDomain", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityNotificationTopic.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityNotificationTopic.go new file mode 100644 index 00000000..5a54a4d0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetIdentityNotificationTopic.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sets an Amazon Simple Notification Service (Amazon SNS) topic to use when +// delivering notifications. When you use this operation, you specify a verified +// identity, such as an email address or domain. When you send an email that uses +// the chosen identity in the Source field, Amazon SES sends notifications to the +// topic you specified. You can send bounce, complaint, or delivery notifications +// (or any combination of the three) to the Amazon SNS topic that you specify. +// +// You can execute this operation no more than once per second. +// +// For more information about feedback notification, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications.html +func (c *Client) SetIdentityNotificationTopic(ctx context.Context, params *SetIdentityNotificationTopicInput, optFns ...func(*Options)) (*SetIdentityNotificationTopicOutput, error) { + if params == nil { + params = &SetIdentityNotificationTopicInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetIdentityNotificationTopic", params, optFns, c.addOperationSetIdentityNotificationTopicMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetIdentityNotificationTopicOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to specify the Amazon SNS topic to which Amazon SES +// publishes bounce, complaint, or delivery notifications for emails sent with that +// identity as the source. For information about Amazon SES notifications, see the [Amazon SES Developer Guide] +// . +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications-sns.html +type SetIdentityNotificationTopicInput struct { + + // The identity (email address or domain) for the Amazon SNS topic. + // + // You can only specify a verified identity for this parameter. + // + // You can specify an identity by using its name or by using its Amazon Resource + // Name (ARN). The following examples are all valid identities: sender@example.com + // , example.com , arn:aws:ses:us-east-1:123456789012:identity/example.com . + // + // This member is required. + Identity *string + + // The type of notifications that are published to the specified Amazon SNS topic. + // + // This member is required. + NotificationType types.NotificationType + + // The Amazon Resource Name (ARN) of the Amazon SNS topic. If the parameter is + // omitted from the request or a null value is passed, SnsTopic is cleared and + // publishing is disabled. + SnsTopic *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type SetIdentityNotificationTopicOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetIdentityNotificationTopicMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetIdentityNotificationTopic{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetIdentityNotificationTopic{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetIdentityNotificationTopic"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSetIdentityNotificationTopicValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetIdentityNotificationTopic(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetIdentityNotificationTopic(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetIdentityNotificationTopic", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetReceiptRulePosition.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetReceiptRulePosition.go new file mode 100644 index 00000000..72bef36d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_SetReceiptRulePosition.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sets the position of the specified receipt rule in the receipt rule set. +// +// For information about managing receipt rules, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) SetReceiptRulePosition(ctx context.Context, params *SetReceiptRulePositionInput, optFns ...func(*Options)) (*SetReceiptRulePositionOutput, error) { + if params == nil { + params = &SetReceiptRulePositionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetReceiptRulePosition", params, optFns, c.addOperationSetReceiptRulePositionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetReceiptRulePositionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to set the position of a receipt rule in a receipt rule +// set. You use receipt rule sets to receive email with Amazon SES. For more +// information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type SetReceiptRulePositionInput struct { + + // The name of the receipt rule to reposition. + // + // This member is required. + RuleName *string + + // The name of the receipt rule set that contains the receipt rule to reposition. + // + // This member is required. + RuleSetName *string + + // The name of the receipt rule after which to place the specified receipt rule. + After *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type SetReceiptRulePositionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetReceiptRulePositionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetReceiptRulePosition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetReceiptRulePosition{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetReceiptRulePosition"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSetReceiptRulePositionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetReceiptRulePosition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetReceiptRulePosition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetReceiptRulePosition", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_TestRenderTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_TestRenderTemplate.go new file mode 100644 index 00000000..44aa9d0c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_TestRenderTemplate.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a preview of the MIME content of an email when provided with a template +// and a set of replacement data. +// +// You can execute this operation no more than once per second. +func (c *Client) TestRenderTemplate(ctx context.Context, params *TestRenderTemplateInput, optFns ...func(*Options)) (*TestRenderTemplateOutput, error) { + if params == nil { + params = &TestRenderTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TestRenderTemplate", params, optFns, c.addOperationTestRenderTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TestRenderTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TestRenderTemplateInput struct { + + // A list of replacement values to apply to the template. This parameter is a JSON + // object, typically consisting of key-value pairs in which the keys correspond to + // replacement tags in the email template. + // + // This member is required. + TemplateData *string + + // The name of the template to render. + // + // This member is required. + TemplateName *string + + noSmithyDocumentSerde +} + +type TestRenderTemplateOutput struct { + + // The complete MIME message rendered by applying the data in the TemplateData + // parameter to the template specified in the TemplateName parameter. + RenderedTemplate *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTestRenderTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpTestRenderTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpTestRenderTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TestRenderTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpTestRenderTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestRenderTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTestRenderTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TestRenderTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateAccountSendingEnabled.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateAccountSendingEnabled.go new file mode 100644 index 00000000..2f6b8676 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateAccountSendingEnabled.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables or disables email sending across your entire Amazon SES account in the +// current Amazon Web Services Region. You can use this operation in conjunction +// with Amazon CloudWatch alarms to temporarily pause email sending across your +// Amazon SES account in a given Amazon Web Services Region when reputation metrics +// (such as your bounce or complaint rates) reach certain thresholds. +// +// You can execute this operation no more than once per second. +func (c *Client) UpdateAccountSendingEnabled(ctx context.Context, params *UpdateAccountSendingEnabledInput, optFns ...func(*Options)) (*UpdateAccountSendingEnabledOutput, error) { + if params == nil { + params = &UpdateAccountSendingEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAccountSendingEnabled", params, optFns, c.addOperationUpdateAccountSendingEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAccountSendingEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to enable or disable the email sending capabilities for +// your entire Amazon SES account. +type UpdateAccountSendingEnabledInput struct { + + // Describes whether email sending is enabled or disabled for your Amazon SES + // account in the current Amazon Web Services Region. + Enabled bool + + noSmithyDocumentSerde +} + +type UpdateAccountSendingEnabledOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAccountSendingEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateAccountSendingEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateAccountSendingEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAccountSendingEnabled"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccountSendingEnabled(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateAccountSendingEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateAccountSendingEnabled", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetEventDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetEventDestination.go new file mode 100644 index 00000000..226502b4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetEventDestination.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the event destination of a configuration set. Event destinations are +// associated with configuration sets, which enable you to publish email sending +// events to Amazon CloudWatch, Amazon Kinesis Firehose, or Amazon Simple +// Notification Service (Amazon SNS). For information about using configuration +// sets, see [Monitoring Your Amazon SES Sending Activity]in the Amazon SES Developer Guide. +// +// When you create or update an event destination, you must provide one, and only +// one, destination. The destination can be Amazon CloudWatch, Amazon Kinesis +// Firehose, or Amazon Simple Notification Service (Amazon SNS). +// +// You can execute this operation no more than once per second. +// +// [Monitoring Your Amazon SES Sending Activity]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +func (c *Client) UpdateConfigurationSetEventDestination(ctx context.Context, params *UpdateConfigurationSetEventDestinationInput, optFns ...func(*Options)) (*UpdateConfigurationSetEventDestinationOutput, error) { + if params == nil { + params = &UpdateConfigurationSetEventDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateConfigurationSetEventDestination", params, optFns, c.addOperationUpdateConfigurationSetEventDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateConfigurationSetEventDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to update the event destination of a configuration set. +// Configuration sets enable you to publish email sending events. For information +// about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type UpdateConfigurationSetEventDestinationInput struct { + + // The name of the configuration set that contains the event destination. + // + // This member is required. + ConfigurationSetName *string + + // The event destination object. + // + // This member is required. + EventDestination *types.EventDestination + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type UpdateConfigurationSetEventDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateConfigurationSetEventDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateConfigurationSetEventDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateConfigurationSetEventDestination{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateConfigurationSetEventDestination"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateConfigurationSetEventDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfigurationSetEventDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateConfigurationSetEventDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateConfigurationSetEventDestination", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetReputationMetricsEnabled.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetReputationMetricsEnabled.go new file mode 100644 index 00000000..82e97e15 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetReputationMetricsEnabled.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables or disables the publishing of reputation metrics for emails sent using +// a specific configuration set in a given Amazon Web Services Region. Reputation +// metrics include bounce and complaint rates. These metrics are published to +// Amazon CloudWatch. By using CloudWatch, you can create alarms when bounce or +// complaint rates exceed certain thresholds. +// +// You can execute this operation no more than once per second. +func (c *Client) UpdateConfigurationSetReputationMetricsEnabled(ctx context.Context, params *UpdateConfigurationSetReputationMetricsEnabledInput, optFns ...func(*Options)) (*UpdateConfigurationSetReputationMetricsEnabledOutput, error) { + if params == nil { + params = &UpdateConfigurationSetReputationMetricsEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateConfigurationSetReputationMetricsEnabled", params, optFns, c.addOperationUpdateConfigurationSetReputationMetricsEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateConfigurationSetReputationMetricsEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to modify the reputation metric publishing settings for a +// configuration set. +type UpdateConfigurationSetReputationMetricsEnabledInput struct { + + // The name of the configuration set to update. + // + // This member is required. + ConfigurationSetName *string + + // Describes whether or not Amazon SES publishes reputation metrics for the + // configuration set, such as bounce and complaint rates, to Amazon CloudWatch. + // + // This member is required. + Enabled bool + + noSmithyDocumentSerde +} + +type UpdateConfigurationSetReputationMetricsEnabledOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateConfigurationSetReputationMetricsEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateConfigurationSetReputationMetricsEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateConfigurationSetReputationMetricsEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateConfigurationSetReputationMetricsEnabled"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateConfigurationSetReputationMetricsEnabledValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfigurationSetReputationMetricsEnabled(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateConfigurationSetReputationMetricsEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateConfigurationSetReputationMetricsEnabled", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetSendingEnabled.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetSendingEnabled.go new file mode 100644 index 00000000..0cab1527 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetSendingEnabled.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables or disables email sending for messages sent using a specific +// configuration set in a given Amazon Web Services Region. You can use this +// operation in conjunction with Amazon CloudWatch alarms to temporarily pause +// email sending for a configuration set when the reputation metrics for that +// configuration set (such as your bounce on complaint rate) exceed certain +// thresholds. +// +// You can execute this operation no more than once per second. +func (c *Client) UpdateConfigurationSetSendingEnabled(ctx context.Context, params *UpdateConfigurationSetSendingEnabledInput, optFns ...func(*Options)) (*UpdateConfigurationSetSendingEnabledOutput, error) { + if params == nil { + params = &UpdateConfigurationSetSendingEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateConfigurationSetSendingEnabled", params, optFns, c.addOperationUpdateConfigurationSetSendingEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateConfigurationSetSendingEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to enable or disable the email sending capabilities for a +// specific configuration set. +type UpdateConfigurationSetSendingEnabledInput struct { + + // The name of the configuration set to update. + // + // This member is required. + ConfigurationSetName *string + + // Describes whether email sending is enabled or disabled for the configuration + // set. + // + // This member is required. + Enabled bool + + noSmithyDocumentSerde +} + +type UpdateConfigurationSetSendingEnabledOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateConfigurationSetSendingEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateConfigurationSetSendingEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateConfigurationSetSendingEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateConfigurationSetSendingEnabled"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateConfigurationSetSendingEnabledValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfigurationSetSendingEnabled(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateConfigurationSetSendingEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateConfigurationSetSendingEnabled", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetTrackingOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetTrackingOptions.go new file mode 100644 index 00000000..2d1c66f6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateConfigurationSetTrackingOptions.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an association between a configuration set and a custom domain for +// open and click event tracking. +// +// By default, images and links used for tracking open and click events are hosted +// on domains operated by Amazon SES. You can configure a subdomain of your own to +// handle these events. For information about using custom domains, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/configure-custom-open-click-domains.html +func (c *Client) UpdateConfigurationSetTrackingOptions(ctx context.Context, params *UpdateConfigurationSetTrackingOptionsInput, optFns ...func(*Options)) (*UpdateConfigurationSetTrackingOptionsOutput, error) { + if params == nil { + params = &UpdateConfigurationSetTrackingOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateConfigurationSetTrackingOptions", params, optFns, c.addOperationUpdateConfigurationSetTrackingOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateConfigurationSetTrackingOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to update the tracking options for a configuration set. +type UpdateConfigurationSetTrackingOptionsInput struct { + + // The name of the configuration set. + // + // This member is required. + ConfigurationSetName *string + + // A domain that is used to redirect email recipients to an Amazon SES-operated + // domain. This domain captures open and click events generated by Amazon SES + // emails. + // + // For more information, see [Configuring Custom Domains to Handle Open and Click Tracking] in the Amazon SES Developer Guide. + // + // [Configuring Custom Domains to Handle Open and Click Tracking]: https://docs.aws.amazon.com/ses/latest/dg/configure-custom-open-click-domains.html + // + // This member is required. + TrackingOptions *types.TrackingOptions + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type UpdateConfigurationSetTrackingOptionsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateConfigurationSetTrackingOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateConfigurationSetTrackingOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateConfigurationSetTrackingOptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateConfigurationSetTrackingOptions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateConfigurationSetTrackingOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfigurationSetTrackingOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateConfigurationSetTrackingOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateConfigurationSetTrackingOptions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateCustomVerificationEmailTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateCustomVerificationEmailTemplate.go new file mode 100644 index 00000000..641cde2d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateCustomVerificationEmailTemplate.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an existing custom verification email template. +// +// For more information about custom verification email templates, see [Using Custom Verification Email Templates] in the +// Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. +// +// [Using Custom Verification Email Templates]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom +func (c *Client) UpdateCustomVerificationEmailTemplate(ctx context.Context, params *UpdateCustomVerificationEmailTemplateInput, optFns ...func(*Options)) (*UpdateCustomVerificationEmailTemplateOutput, error) { + if params == nil { + params = &UpdateCustomVerificationEmailTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCustomVerificationEmailTemplate", params, optFns, c.addOperationUpdateCustomVerificationEmailTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCustomVerificationEmailTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to update an existing custom verification email template. +type UpdateCustomVerificationEmailTemplateInput struct { + + // The name of the custom verification email template to update. + // + // This member is required. + TemplateName *string + + // The URL that the recipient of the verification email is sent to if his or her + // address is not successfully verified. + FailureRedirectionURL *string + + // The email address that the custom verification email is sent from. + FromEmailAddress *string + + // The URL that the recipient of the verification email is sent to if his or her + // address is successfully verified. + SuccessRedirectionURL *string + + // The content of the custom verification email. The total size of the email must + // be less than 10 MB. The message body may contain HTML, with some limitations. + // For more information, see [Custom Verification Email Frequently Asked Questions]in the Amazon SES Developer Guide. + // + // [Custom Verification Email Frequently Asked Questions]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom + TemplateContent *string + + // The subject line of the custom verification email. + TemplateSubject *string + + noSmithyDocumentSerde +} + +type UpdateCustomVerificationEmailTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCustomVerificationEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateCustomVerificationEmailTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCustomVerificationEmailTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateCustomVerificationEmailTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCustomVerificationEmailTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCustomVerificationEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCustomVerificationEmailTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateReceiptRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateReceiptRule.go new file mode 100644 index 00000000..079650f2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateReceiptRule.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a receipt rule. +// +// For information about managing receipt rules, see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +func (c *Client) UpdateReceiptRule(ctx context.Context, params *UpdateReceiptRuleInput, optFns ...func(*Options)) (*UpdateReceiptRuleOutput, error) { + if params == nil { + params = &UpdateReceiptRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateReceiptRule", params, optFns, c.addOperationUpdateReceiptRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateReceiptRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to update a receipt rule. You use receipt rules to receive +// email with Amazon SES. For more information, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html +type UpdateReceiptRuleInput struct { + + // A data structure that contains the updated receipt rule information. + // + // This member is required. + Rule *types.ReceiptRule + + // The name of the receipt rule set that the receipt rule belongs to. + // + // This member is required. + RuleSetName *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type UpdateReceiptRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateReceiptRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateReceiptRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateReceiptRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateReceiptRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateReceiptRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateReceiptRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateReceiptRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateReceiptRule", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateTemplate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateTemplate.go new file mode 100644 index 00000000..78b7efec --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_UpdateTemplate.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an email template. Email templates enable you to send personalized +// email to one or more destinations in a single operation. For more information, +// see the [Amazon SES Developer Guide]. +// +// You can execute this operation no more than once per second. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html +func (c *Client) UpdateTemplate(ctx context.Context, params *UpdateTemplateInput, optFns ...func(*Options)) (*UpdateTemplateOutput, error) { + if params == nil { + params = &UpdateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateTemplate", params, optFns, c.addOperationUpdateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateTemplateInput struct { + + // The content of the email, composed of a subject line and either an HTML part or + // a text-only part. + // + // This member is required. + Template *types.Template + + noSmithyDocumentSerde +} + +type UpdateTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpUpdateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUpdateTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateTemplate", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainDkim.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainDkim.go new file mode 100644 index 00000000..a202c191 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainDkim.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of DKIM tokens for a domain identity. +// +// When you execute the VerifyDomainDkim operation, the domain that you specify is +// added to the list of identities that are associated with your account. This is +// true even if you haven't already associated the domain with your account by +// using the VerifyDomainIdentity operation. However, you can't send email from +// the domain until you either successfully [verify it]or you successfully [set up DKIM for it]. +// +// You use the tokens that are generated by this operation to create CNAME +// records. When Amazon SES detects that you've added these records to the DNS +// configuration for a domain, you can start sending email from that domain. You +// can start sending email even if you haven't added the TXT record provided by the +// VerifyDomainIdentity operation to the DNS configuration for your domain. All +// email that you send from the domain is authenticated using DKIM. +// +// To create the CNAME records for DKIM authentication, use the following values: +// +// - Name: token._domainkey.example.com +// +// - Type: CNAME +// +// - Value: token.dkim.amazonses.com +// +// In the preceding example, replace token with one of the tokens that are +// generated when you execute this operation. Replace example.com with your domain. +// Repeat this process for each token that's generated by this operation. +// +// You can execute this operation no more than once per second. +// +// [verify it]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#verify-domain-procedure +// [set up DKIM for it]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy.html +func (c *Client) VerifyDomainDkim(ctx context.Context, params *VerifyDomainDkimInput, optFns ...func(*Options)) (*VerifyDomainDkimOutput, error) { + if params == nil { + params = &VerifyDomainDkimInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "VerifyDomainDkim", params, optFns, c.addOperationVerifyDomainDkimMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*VerifyDomainDkimOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to generate the CNAME records needed to set up Easy DKIM +// with Amazon SES. For more information about setting up Easy DKIM, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy.html +type VerifyDomainDkimInput struct { + + // The name of the domain to be verified for Easy DKIM signing. + // + // This member is required. + Domain *string + + noSmithyDocumentSerde +} + +// Returns CNAME records that you must publish to the DNS server of your domain to +// set up Easy DKIM with Amazon SES. +type VerifyDomainDkimOutput struct { + + // A set of character strings that represent the domain's identity. If the + // identity is an email address, the tokens represent the domain of that address. + // + // Using these tokens, you need to create DNS CNAME records that point to DKIM + // public keys that are hosted by Amazon SES. Amazon Web Services eventually + // detects that you've updated your DNS records. This detection process might take + // up to 72 hours. After successful detection, Amazon SES is able to DKIM-sign + // email originating from that domain. (This only applies to domain identities, not + // email address identities.) + // + // For more information about creating DNS records using DKIM tokens, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy.html + // + // This member is required. + DkimTokens []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationVerifyDomainDkimMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpVerifyDomainDkim{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpVerifyDomainDkim{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "VerifyDomainDkim"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpVerifyDomainDkimValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opVerifyDomainDkim(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opVerifyDomainDkim(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "VerifyDomainDkim", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainIdentity.go new file mode 100644 index 00000000..77d4d85c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyDomainIdentity.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds a domain to the list of identities for your Amazon SES account in the +// current Amazon Web Services Region and attempts to verify it. For more +// information about verifying domains, see [Verifying Email Addresses and Domains]in the Amazon SES Developer Guide. +// +// You can execute this operation no more than once per second. +// +// [Verifying Email Addresses and Domains]: https://docs.aws.amazon.com/ses/latest/dg/verify-addresses-and-domains.html +func (c *Client) VerifyDomainIdentity(ctx context.Context, params *VerifyDomainIdentityInput, optFns ...func(*Options)) (*VerifyDomainIdentityOutput, error) { + if params == nil { + params = &VerifyDomainIdentityInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "VerifyDomainIdentity", params, optFns, c.addOperationVerifyDomainIdentityMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*VerifyDomainIdentityOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to begin Amazon SES domain verification and to generate +// the TXT records that you must publish to the DNS server of your domain to +// complete the verification. For information about domain verification, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#verify-domain-procedure +type VerifyDomainIdentityInput struct { + + // The domain to be verified. + // + // This member is required. + Domain *string + + noSmithyDocumentSerde +} + +// Returns a TXT record that you must publish to the DNS server of your domain to +// complete domain verification with Amazon SES. +type VerifyDomainIdentityOutput struct { + + // A TXT record that you must place in the DNS settings of the domain to complete + // domain verification with Amazon SES. + // + // As Amazon SES searches for the TXT record, the domain's verification status is + // "Pending". When Amazon SES detects the record, the domain's verification status + // changes to "Success". If Amazon SES is unable to detect the record within 72 + // hours, the domain's verification status changes to "Failed." In that case, to + // verify the domain, you must restart the verification process from the beginning. + // The domain's verification status also changes to "Success" when it is DKIM + // verified. + // + // This member is required. + VerificationToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationVerifyDomainIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpVerifyDomainIdentity{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpVerifyDomainIdentity{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "VerifyDomainIdentity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpVerifyDomainIdentityValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opVerifyDomainIdentity(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opVerifyDomainIdentity(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "VerifyDomainIdentity", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailAddress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailAddress.go new file mode 100644 index 00000000..5a1f80bc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailAddress.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deprecated. Use the VerifyEmailIdentity operation to verify a new email address. +func (c *Client) VerifyEmailAddress(ctx context.Context, params *VerifyEmailAddressInput, optFns ...func(*Options)) (*VerifyEmailAddressOutput, error) { + if params == nil { + params = &VerifyEmailAddressInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "VerifyEmailAddress", params, optFns, c.addOperationVerifyEmailAddressMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*VerifyEmailAddressOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to begin email address verification with Amazon SES. For +// information about email address verification, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#verify-email-addresses-procedure +type VerifyEmailAddressInput struct { + + // The email address to be verified. + // + // This member is required. + EmailAddress *string + + noSmithyDocumentSerde +} + +type VerifyEmailAddressOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationVerifyEmailAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpVerifyEmailAddress{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpVerifyEmailAddress{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "VerifyEmailAddress"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpVerifyEmailAddressValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opVerifyEmailAddress(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opVerifyEmailAddress(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "VerifyEmailAddress", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailIdentity.go new file mode 100644 index 00000000..188f1dd8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/api_op_VerifyEmailIdentity.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds an email address to the list of identities for your Amazon SES account in +// the current Amazon Web Services Region and attempts to verify it. As a result of +// executing this operation, a verification email is sent to the specified address. +// +// You can execute this operation no more than once per second. +func (c *Client) VerifyEmailIdentity(ctx context.Context, params *VerifyEmailIdentityInput, optFns ...func(*Options)) (*VerifyEmailIdentityOutput, error) { + if params == nil { + params = &VerifyEmailIdentityInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "VerifyEmailIdentity", params, optFns, c.addOperationVerifyEmailIdentityMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*VerifyEmailIdentityOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents a request to begin email address verification with Amazon SES. For +// information about email address verification, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#verify-email-addresses-procedure +type VerifyEmailIdentityInput struct { + + // The email address to be verified. + // + // This member is required. + EmailAddress *string + + noSmithyDocumentSerde +} + +// An empty element returned on a successful request. +type VerifyEmailIdentityOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationVerifyEmailIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpVerifyEmailIdentity{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpVerifyEmailIdentity{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "VerifyEmailIdentity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpVerifyEmailIdentityValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opVerifyEmailIdentity(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opVerifyEmailIdentity(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "VerifyEmailIdentity", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/auth.go new file mode 100644 index 00000000..d8b13cc7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/auth.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "ses") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/deserializers.go new file mode 100644 index 00000000..d2f74317 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/deserializers.go @@ -0,0 +1,17724 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "bytes" + "context" + "encoding/xml" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + smithy "github.com/aws/smithy-go" + smithyxml "github.com/aws/smithy-go/encoding/xml" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strconv" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsAwsquery_deserializeOpCloneReceiptRuleSet struct { +} + +func (*awsAwsquery_deserializeOpCloneReceiptRuleSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCloneReceiptRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCloneReceiptRuleSet(response, &metadata) + } + output := &CloneReceiptRuleSetOutput{} + 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) + t, err = decoder.GetElement("CloneReceiptRuleSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCloneReceiptRuleSetOutput(&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 awsAwsquery_deserializeOpErrorCloneReceiptRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AlreadyExists", errorCode): + return awsAwsquery_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateConfigurationSet struct { +} + +func (*awsAwsquery_deserializeOpCreateConfigurationSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateConfigurationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateConfigurationSet(response, &metadata) + } + output := &CreateConfigurationSetOutput{} + 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) + t, err = decoder.GetElement("CreateConfigurationSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateConfigurationSetOutput(&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 awsAwsquery_deserializeOpErrorCreateConfigurationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetAlreadyExistsException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationSet", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationSetException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateConfigurationSetEventDestination struct { +} + +func (*awsAwsquery_deserializeOpCreateConfigurationSetEventDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateConfigurationSetEventDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateConfigurationSetEventDestination(response, &metadata) + } + output := &CreateConfigurationSetEventDestinationOutput{} + 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) + t, err = decoder.GetElement("CreateConfigurationSetEventDestinationResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateConfigurationSetEventDestinationOutput(&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 awsAwsquery_deserializeOpErrorCreateConfigurationSetEventDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("EventDestinationAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorEventDestinationAlreadyExistsException(response, errorBody) + + case strings.EqualFold("InvalidCloudWatchDestination", errorCode): + return awsAwsquery_deserializeErrorInvalidCloudWatchDestinationException(response, errorBody) + + case strings.EqualFold("InvalidFirehoseDestination", errorCode): + return awsAwsquery_deserializeErrorInvalidFirehoseDestinationException(response, errorBody) + + case strings.EqualFold("InvalidSNSDestination", errorCode): + return awsAwsquery_deserializeErrorInvalidSNSDestinationException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateConfigurationSetTrackingOptions struct { +} + +func (*awsAwsquery_deserializeOpCreateConfigurationSetTrackingOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateConfigurationSetTrackingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateConfigurationSetTrackingOptions(response, &metadata) + } + output := &CreateConfigurationSetTrackingOptionsOutput{} + 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) + t, err = decoder.GetElement("CreateConfigurationSetTrackingOptionsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateConfigurationSetTrackingOptionsOutput(&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 awsAwsquery_deserializeOpErrorCreateConfigurationSetTrackingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("InvalidTrackingOptions", errorCode): + return awsAwsquery_deserializeErrorInvalidTrackingOptionsException(response, errorBody) + + case strings.EqualFold("TrackingOptionsAlreadyExistsException", errorCode): + return awsAwsquery_deserializeErrorTrackingOptionsAlreadyExistsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_deserializeOpCreateCustomVerificationEmailTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateCustomVerificationEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateCustomVerificationEmailTemplate(response, &metadata) + } + output := &CreateCustomVerificationEmailTemplateOutput{} + 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 awsAwsquery_deserializeOpErrorCreateCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CustomVerificationEmailInvalidContent", errorCode): + return awsAwsquery_deserializeErrorCustomVerificationEmailInvalidContentException(response, errorBody) + + case strings.EqualFold("CustomVerificationEmailTemplateAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorCustomVerificationEmailTemplateAlreadyExistsException(response, errorBody) + + case strings.EqualFold("FromEmailAddressNotVerified", errorCode): + return awsAwsquery_deserializeErrorFromEmailAddressNotVerifiedException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateReceiptFilter struct { +} + +func (*awsAwsquery_deserializeOpCreateReceiptFilter) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateReceiptFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateReceiptFilter(response, &metadata) + } + output := &CreateReceiptFilterOutput{} + 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) + t, err = decoder.GetElement("CreateReceiptFilterResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateReceiptFilterOutput(&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 awsAwsquery_deserializeOpErrorCreateReceiptFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AlreadyExists", errorCode): + return awsAwsquery_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateReceiptRule struct { +} + +func (*awsAwsquery_deserializeOpCreateReceiptRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateReceiptRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateReceiptRule(response, &metadata) + } + output := &CreateReceiptRuleOutput{} + 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) + t, err = decoder.GetElement("CreateReceiptRuleResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateReceiptRuleOutput(&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 awsAwsquery_deserializeOpErrorCreateReceiptRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AlreadyExists", errorCode): + return awsAwsquery_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("InvalidLambdaFunction", errorCode): + return awsAwsquery_deserializeErrorInvalidLambdaFunctionException(response, errorBody) + + case strings.EqualFold("InvalidS3Configuration", errorCode): + return awsAwsquery_deserializeErrorInvalidS3ConfigurationException(response, errorBody) + + case strings.EqualFold("InvalidSnsTopic", errorCode): + return awsAwsquery_deserializeErrorInvalidSnsTopicException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("RuleDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleDoesNotExistException(response, errorBody) + + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateReceiptRuleSet struct { +} + +func (*awsAwsquery_deserializeOpCreateReceiptRuleSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateReceiptRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateReceiptRuleSet(response, &metadata) + } + output := &CreateReceiptRuleSetOutput{} + 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) + t, err = decoder.GetElement("CreateReceiptRuleSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateReceiptRuleSetOutput(&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 awsAwsquery_deserializeOpErrorCreateReceiptRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AlreadyExists", errorCode): + return awsAwsquery_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateTemplate struct { +} + +func (*awsAwsquery_deserializeOpCreateTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateTemplate(response, &metadata) + } + output := &CreateTemplateOutput{} + 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) + t, err = decoder.GetElement("CreateTemplateResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateTemplateOutput(&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 awsAwsquery_deserializeOpErrorCreateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AlreadyExists", errorCode): + return awsAwsquery_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("InvalidTemplate", errorCode): + return awsAwsquery_deserializeErrorInvalidTemplateException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteConfigurationSet struct { +} + +func (*awsAwsquery_deserializeOpDeleteConfigurationSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteConfigurationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteConfigurationSet(response, &metadata) + } + output := &DeleteConfigurationSetOutput{} + 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) + t, err = decoder.GetElement("DeleteConfigurationSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteConfigurationSetOutput(&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 awsAwsquery_deserializeOpErrorDeleteConfigurationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteConfigurationSetEventDestination struct { +} + +func (*awsAwsquery_deserializeOpDeleteConfigurationSetEventDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteConfigurationSetEventDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteConfigurationSetEventDestination(response, &metadata) + } + output := &DeleteConfigurationSetEventDestinationOutput{} + 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) + t, err = decoder.GetElement("DeleteConfigurationSetEventDestinationResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteConfigurationSetEventDestinationOutput(&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 awsAwsquery_deserializeOpErrorDeleteConfigurationSetEventDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("EventDestinationDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorEventDestinationDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteConfigurationSetTrackingOptions struct { +} + +func (*awsAwsquery_deserializeOpDeleteConfigurationSetTrackingOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteConfigurationSetTrackingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteConfigurationSetTrackingOptions(response, &metadata) + } + output := &DeleteConfigurationSetTrackingOptionsOutput{} + 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) + t, err = decoder.GetElement("DeleteConfigurationSetTrackingOptionsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteConfigurationSetTrackingOptionsOutput(&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 awsAwsquery_deserializeOpErrorDeleteConfigurationSetTrackingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("TrackingOptionsDoesNotExistException", errorCode): + return awsAwsquery_deserializeErrorTrackingOptionsDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_deserializeOpDeleteCustomVerificationEmailTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteCustomVerificationEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteCustomVerificationEmailTemplate(response, &metadata) + } + output := &DeleteCustomVerificationEmailTemplateOutput{} + 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 awsAwsquery_deserializeOpErrorDeleteCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteIdentity struct { +} + +func (*awsAwsquery_deserializeOpDeleteIdentity) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteIdentity(response, &metadata) + } + output := &DeleteIdentityOutput{} + 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) + t, err = decoder.GetElement("DeleteIdentityResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteIdentityOutput(&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 awsAwsquery_deserializeOpErrorDeleteIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteIdentityPolicy struct { +} + +func (*awsAwsquery_deserializeOpDeleteIdentityPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteIdentityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteIdentityPolicy(response, &metadata) + } + output := &DeleteIdentityPolicyOutput{} + 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) + t, err = decoder.GetElement("DeleteIdentityPolicyResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteIdentityPolicyOutput(&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 awsAwsquery_deserializeOpErrorDeleteIdentityPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteReceiptFilter struct { +} + +func (*awsAwsquery_deserializeOpDeleteReceiptFilter) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteReceiptFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteReceiptFilter(response, &metadata) + } + output := &DeleteReceiptFilterOutput{} + 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) + t, err = decoder.GetElement("DeleteReceiptFilterResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteReceiptFilterOutput(&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 awsAwsquery_deserializeOpErrorDeleteReceiptFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteReceiptRule struct { +} + +func (*awsAwsquery_deserializeOpDeleteReceiptRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteReceiptRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteReceiptRule(response, &metadata) + } + output := &DeleteReceiptRuleOutput{} + 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) + t, err = decoder.GetElement("DeleteReceiptRuleResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteReceiptRuleOutput(&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 awsAwsquery_deserializeOpErrorDeleteReceiptRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteReceiptRuleSet struct { +} + +func (*awsAwsquery_deserializeOpDeleteReceiptRuleSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteReceiptRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteReceiptRuleSet(response, &metadata) + } + output := &DeleteReceiptRuleSetOutput{} + 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) + t, err = decoder.GetElement("DeleteReceiptRuleSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteReceiptRuleSetOutput(&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 awsAwsquery_deserializeOpErrorDeleteReceiptRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CannotDelete", errorCode): + return awsAwsquery_deserializeErrorCannotDeleteException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteTemplate struct { +} + +func (*awsAwsquery_deserializeOpDeleteTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteTemplate(response, &metadata) + } + output := &DeleteTemplateOutput{} + 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) + t, err = decoder.GetElement("DeleteTemplateResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteTemplateOutput(&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 awsAwsquery_deserializeOpErrorDeleteTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteVerifiedEmailAddress struct { +} + +func (*awsAwsquery_deserializeOpDeleteVerifiedEmailAddress) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteVerifiedEmailAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteVerifiedEmailAddress(response, &metadata) + } + output := &DeleteVerifiedEmailAddressOutput{} + 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 awsAwsquery_deserializeOpErrorDeleteVerifiedEmailAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeActiveReceiptRuleSet struct { +} + +func (*awsAwsquery_deserializeOpDescribeActiveReceiptRuleSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeActiveReceiptRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeActiveReceiptRuleSet(response, &metadata) + } + output := &DescribeActiveReceiptRuleSetOutput{} + 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) + t, err = decoder.GetElement("DescribeActiveReceiptRuleSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeActiveReceiptRuleSetOutput(&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 awsAwsquery_deserializeOpErrorDescribeActiveReceiptRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeConfigurationSet struct { +} + +func (*awsAwsquery_deserializeOpDescribeConfigurationSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeConfigurationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeConfigurationSet(response, &metadata) + } + output := &DescribeConfigurationSetOutput{} + 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) + t, err = decoder.GetElement("DescribeConfigurationSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeConfigurationSetOutput(&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 awsAwsquery_deserializeOpErrorDescribeConfigurationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeReceiptRule struct { +} + +func (*awsAwsquery_deserializeOpDescribeReceiptRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeReceiptRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeReceiptRule(response, &metadata) + } + output := &DescribeReceiptRuleOutput{} + 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) + t, err = decoder.GetElement("DescribeReceiptRuleResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeReceiptRuleOutput(&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 awsAwsquery_deserializeOpErrorDescribeReceiptRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("RuleDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleDoesNotExistException(response, errorBody) + + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeReceiptRuleSet struct { +} + +func (*awsAwsquery_deserializeOpDescribeReceiptRuleSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeReceiptRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeReceiptRuleSet(response, &metadata) + } + output := &DescribeReceiptRuleSetOutput{} + 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) + t, err = decoder.GetElement("DescribeReceiptRuleSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeReceiptRuleSetOutput(&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 awsAwsquery_deserializeOpErrorDescribeReceiptRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetAccountSendingEnabled struct { +} + +func (*awsAwsquery_deserializeOpGetAccountSendingEnabled) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetAccountSendingEnabled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetAccountSendingEnabled(response, &metadata) + } + output := &GetAccountSendingEnabledOutput{} + 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) + t, err = decoder.GetElement("GetAccountSendingEnabledResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetAccountSendingEnabledOutput(&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 awsAwsquery_deserializeOpErrorGetAccountSendingEnabled(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_deserializeOpGetCustomVerificationEmailTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetCustomVerificationEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetCustomVerificationEmailTemplate(response, &metadata) + } + output := &GetCustomVerificationEmailTemplateOutput{} + 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) + t, err = decoder.GetElement("GetCustomVerificationEmailTemplateResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetCustomVerificationEmailTemplateOutput(&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 awsAwsquery_deserializeOpErrorGetCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CustomVerificationEmailTemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorCustomVerificationEmailTemplateDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetIdentityDkimAttributes struct { +} + +func (*awsAwsquery_deserializeOpGetIdentityDkimAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetIdentityDkimAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetIdentityDkimAttributes(response, &metadata) + } + output := &GetIdentityDkimAttributesOutput{} + 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) + t, err = decoder.GetElement("GetIdentityDkimAttributesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetIdentityDkimAttributesOutput(&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 awsAwsquery_deserializeOpErrorGetIdentityDkimAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetIdentityMailFromDomainAttributes struct { +} + +func (*awsAwsquery_deserializeOpGetIdentityMailFromDomainAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetIdentityMailFromDomainAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetIdentityMailFromDomainAttributes(response, &metadata) + } + output := &GetIdentityMailFromDomainAttributesOutput{} + 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) + t, err = decoder.GetElement("GetIdentityMailFromDomainAttributesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetIdentityMailFromDomainAttributesOutput(&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 awsAwsquery_deserializeOpErrorGetIdentityMailFromDomainAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetIdentityNotificationAttributes struct { +} + +func (*awsAwsquery_deserializeOpGetIdentityNotificationAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetIdentityNotificationAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetIdentityNotificationAttributes(response, &metadata) + } + output := &GetIdentityNotificationAttributesOutput{} + 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) + t, err = decoder.GetElement("GetIdentityNotificationAttributesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetIdentityNotificationAttributesOutput(&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 awsAwsquery_deserializeOpErrorGetIdentityNotificationAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetIdentityPolicies struct { +} + +func (*awsAwsquery_deserializeOpGetIdentityPolicies) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetIdentityPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetIdentityPolicies(response, &metadata) + } + output := &GetIdentityPoliciesOutput{} + 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) + t, err = decoder.GetElement("GetIdentityPoliciesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetIdentityPoliciesOutput(&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 awsAwsquery_deserializeOpErrorGetIdentityPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetIdentityVerificationAttributes struct { +} + +func (*awsAwsquery_deserializeOpGetIdentityVerificationAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetIdentityVerificationAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetIdentityVerificationAttributes(response, &metadata) + } + output := &GetIdentityVerificationAttributesOutput{} + 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) + t, err = decoder.GetElement("GetIdentityVerificationAttributesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetIdentityVerificationAttributesOutput(&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 awsAwsquery_deserializeOpErrorGetIdentityVerificationAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetSendQuota struct { +} + +func (*awsAwsquery_deserializeOpGetSendQuota) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetSendQuota) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetSendQuota(response, &metadata) + } + output := &GetSendQuotaOutput{} + 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) + t, err = decoder.GetElement("GetSendQuotaResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetSendQuotaOutput(&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 awsAwsquery_deserializeOpErrorGetSendQuota(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetSendStatistics struct { +} + +func (*awsAwsquery_deserializeOpGetSendStatistics) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetSendStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetSendStatistics(response, &metadata) + } + output := &GetSendStatisticsOutput{} + 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) + t, err = decoder.GetElement("GetSendStatisticsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetSendStatisticsOutput(&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 awsAwsquery_deserializeOpErrorGetSendStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetTemplate struct { +} + +func (*awsAwsquery_deserializeOpGetTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetTemplate(response, &metadata) + } + output := &GetTemplateOutput{} + 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) + t, err = decoder.GetElement("GetTemplateResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetTemplateOutput(&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 awsAwsquery_deserializeOpErrorGetTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("TemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorTemplateDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListConfigurationSets struct { +} + +func (*awsAwsquery_deserializeOpListConfigurationSets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListConfigurationSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListConfigurationSets(response, &metadata) + } + output := &ListConfigurationSetsOutput{} + 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) + t, err = decoder.GetElement("ListConfigurationSetsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListConfigurationSetsOutput(&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 awsAwsquery_deserializeOpErrorListConfigurationSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListCustomVerificationEmailTemplates struct { +} + +func (*awsAwsquery_deserializeOpListCustomVerificationEmailTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListCustomVerificationEmailTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListCustomVerificationEmailTemplates(response, &metadata) + } + output := &ListCustomVerificationEmailTemplatesOutput{} + 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) + t, err = decoder.GetElement("ListCustomVerificationEmailTemplatesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListCustomVerificationEmailTemplatesOutput(&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 awsAwsquery_deserializeOpErrorListCustomVerificationEmailTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListIdentities struct { +} + +func (*awsAwsquery_deserializeOpListIdentities) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListIdentities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListIdentities(response, &metadata) + } + output := &ListIdentitiesOutput{} + 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) + t, err = decoder.GetElement("ListIdentitiesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListIdentitiesOutput(&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 awsAwsquery_deserializeOpErrorListIdentities(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListIdentityPolicies struct { +} + +func (*awsAwsquery_deserializeOpListIdentityPolicies) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListIdentityPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListIdentityPolicies(response, &metadata) + } + output := &ListIdentityPoliciesOutput{} + 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) + t, err = decoder.GetElement("ListIdentityPoliciesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListIdentityPoliciesOutput(&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 awsAwsquery_deserializeOpErrorListIdentityPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListReceiptFilters struct { +} + +func (*awsAwsquery_deserializeOpListReceiptFilters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListReceiptFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListReceiptFilters(response, &metadata) + } + output := &ListReceiptFiltersOutput{} + 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) + t, err = decoder.GetElement("ListReceiptFiltersResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListReceiptFiltersOutput(&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 awsAwsquery_deserializeOpErrorListReceiptFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListReceiptRuleSets struct { +} + +func (*awsAwsquery_deserializeOpListReceiptRuleSets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListReceiptRuleSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListReceiptRuleSets(response, &metadata) + } + output := &ListReceiptRuleSetsOutput{} + 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) + t, err = decoder.GetElement("ListReceiptRuleSetsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListReceiptRuleSetsOutput(&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 awsAwsquery_deserializeOpErrorListReceiptRuleSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListTemplates struct { +} + +func (*awsAwsquery_deserializeOpListTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListTemplates(response, &metadata) + } + output := &ListTemplatesOutput{} + 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) + t, err = decoder.GetElement("ListTemplatesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListTemplatesOutput(&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 awsAwsquery_deserializeOpErrorListTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListVerifiedEmailAddresses struct { +} + +func (*awsAwsquery_deserializeOpListVerifiedEmailAddresses) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListVerifiedEmailAddresses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorListVerifiedEmailAddresses(response, &metadata) + } + output := &ListVerifiedEmailAddressesOutput{} + 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) + t, err = decoder.GetElement("ListVerifiedEmailAddressesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListVerifiedEmailAddressesOutput(&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 awsAwsquery_deserializeOpErrorListVerifiedEmailAddresses(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpPutConfigurationSetDeliveryOptions struct { +} + +func (*awsAwsquery_deserializeOpPutConfigurationSetDeliveryOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpPutConfigurationSetDeliveryOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorPutConfigurationSetDeliveryOptions(response, &metadata) + } + output := &PutConfigurationSetDeliveryOptionsOutput{} + 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) + t, err = decoder.GetElement("PutConfigurationSetDeliveryOptionsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentPutConfigurationSetDeliveryOptionsOutput(&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 awsAwsquery_deserializeOpErrorPutConfigurationSetDeliveryOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("InvalidDeliveryOptions", errorCode): + return awsAwsquery_deserializeErrorInvalidDeliveryOptionsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpPutIdentityPolicy struct { +} + +func (*awsAwsquery_deserializeOpPutIdentityPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpPutIdentityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorPutIdentityPolicy(response, &metadata) + } + output := &PutIdentityPolicyOutput{} + 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) + t, err = decoder.GetElement("PutIdentityPolicyResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentPutIdentityPolicyOutput(&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 awsAwsquery_deserializeOpErrorPutIdentityPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidPolicy", errorCode): + return awsAwsquery_deserializeErrorInvalidPolicyException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpReorderReceiptRuleSet struct { +} + +func (*awsAwsquery_deserializeOpReorderReceiptRuleSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpReorderReceiptRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorReorderReceiptRuleSet(response, &metadata) + } + output := &ReorderReceiptRuleSetOutput{} + 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) + t, err = decoder.GetElement("ReorderReceiptRuleSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentReorderReceiptRuleSetOutput(&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 awsAwsquery_deserializeOpErrorReorderReceiptRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("RuleDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleDoesNotExistException(response, errorBody) + + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSendBounce struct { +} + +func (*awsAwsquery_deserializeOpSendBounce) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSendBounce) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSendBounce(response, &metadata) + } + output := &SendBounceOutput{} + 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) + t, err = decoder.GetElement("SendBounceResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSendBounceOutput(&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 awsAwsquery_deserializeOpErrorSendBounce(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("MessageRejected", errorCode): + return awsAwsquery_deserializeErrorMessageRejected(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSendBulkTemplatedEmail struct { +} + +func (*awsAwsquery_deserializeOpSendBulkTemplatedEmail) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSendBulkTemplatedEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSendBulkTemplatedEmail(response, &metadata) + } + output := &SendBulkTemplatedEmailOutput{} + 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) + t, err = decoder.GetElement("SendBulkTemplatedEmailResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSendBulkTemplatedEmailOutput(&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 awsAwsquery_deserializeOpErrorSendBulkTemplatedEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AccountSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorAccountSendingPausedException(response, errorBody) + + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("ConfigurationSetSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetSendingPausedException(response, errorBody) + + case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): + return awsAwsquery_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) + + case strings.EqualFold("MessageRejected", errorCode): + return awsAwsquery_deserializeErrorMessageRejected(response, errorBody) + + case strings.EqualFold("TemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorTemplateDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSendCustomVerificationEmail struct { +} + +func (*awsAwsquery_deserializeOpSendCustomVerificationEmail) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSendCustomVerificationEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSendCustomVerificationEmail(response, &metadata) + } + output := &SendCustomVerificationEmailOutput{} + 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) + t, err = decoder.GetElement("SendCustomVerificationEmailResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSendCustomVerificationEmailOutput(&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 awsAwsquery_deserializeOpErrorSendCustomVerificationEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("CustomVerificationEmailTemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorCustomVerificationEmailTemplateDoesNotExistException(response, errorBody) + + case strings.EqualFold("FromEmailAddressNotVerified", errorCode): + return awsAwsquery_deserializeErrorFromEmailAddressNotVerifiedException(response, errorBody) + + case strings.EqualFold("MessageRejected", errorCode): + return awsAwsquery_deserializeErrorMessageRejected(response, errorBody) + + case strings.EqualFold("ProductionAccessNotGranted", errorCode): + return awsAwsquery_deserializeErrorProductionAccessNotGrantedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSendEmail struct { +} + +func (*awsAwsquery_deserializeOpSendEmail) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSendEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSendEmail(response, &metadata) + } + output := &SendEmailOutput{} + 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) + t, err = decoder.GetElement("SendEmailResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSendEmailOutput(&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 awsAwsquery_deserializeOpErrorSendEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AccountSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorAccountSendingPausedException(response, errorBody) + + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("ConfigurationSetSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetSendingPausedException(response, errorBody) + + case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): + return awsAwsquery_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) + + case strings.EqualFold("MessageRejected", errorCode): + return awsAwsquery_deserializeErrorMessageRejected(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSendRawEmail struct { +} + +func (*awsAwsquery_deserializeOpSendRawEmail) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSendRawEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSendRawEmail(response, &metadata) + } + output := &SendRawEmailOutput{} + 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) + t, err = decoder.GetElement("SendRawEmailResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSendRawEmailOutput(&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 awsAwsquery_deserializeOpErrorSendRawEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AccountSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorAccountSendingPausedException(response, errorBody) + + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("ConfigurationSetSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetSendingPausedException(response, errorBody) + + case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): + return awsAwsquery_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) + + case strings.EqualFold("MessageRejected", errorCode): + return awsAwsquery_deserializeErrorMessageRejected(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSendTemplatedEmail struct { +} + +func (*awsAwsquery_deserializeOpSendTemplatedEmail) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSendTemplatedEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSendTemplatedEmail(response, &metadata) + } + output := &SendTemplatedEmailOutput{} + 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) + t, err = decoder.GetElement("SendTemplatedEmailResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSendTemplatedEmailOutput(&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 awsAwsquery_deserializeOpErrorSendTemplatedEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AccountSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorAccountSendingPausedException(response, errorBody) + + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("ConfigurationSetSendingPausedException", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetSendingPausedException(response, errorBody) + + case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): + return awsAwsquery_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) + + case strings.EqualFold("MessageRejected", errorCode): + return awsAwsquery_deserializeErrorMessageRejected(response, errorBody) + + case strings.EqualFold("TemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorTemplateDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetActiveReceiptRuleSet struct { +} + +func (*awsAwsquery_deserializeOpSetActiveReceiptRuleSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetActiveReceiptRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetActiveReceiptRuleSet(response, &metadata) + } + output := &SetActiveReceiptRuleSetOutput{} + 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) + t, err = decoder.GetElement("SetActiveReceiptRuleSetResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetActiveReceiptRuleSetOutput(&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 awsAwsquery_deserializeOpErrorSetActiveReceiptRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetIdentityDkimEnabled struct { +} + +func (*awsAwsquery_deserializeOpSetIdentityDkimEnabled) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetIdentityDkimEnabled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetIdentityDkimEnabled(response, &metadata) + } + output := &SetIdentityDkimEnabledOutput{} + 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) + t, err = decoder.GetElement("SetIdentityDkimEnabledResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetIdentityDkimEnabledOutput(&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 awsAwsquery_deserializeOpErrorSetIdentityDkimEnabled(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetIdentityFeedbackForwardingEnabled struct { +} + +func (*awsAwsquery_deserializeOpSetIdentityFeedbackForwardingEnabled) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetIdentityFeedbackForwardingEnabled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetIdentityFeedbackForwardingEnabled(response, &metadata) + } + output := &SetIdentityFeedbackForwardingEnabledOutput{} + 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) + t, err = decoder.GetElement("SetIdentityFeedbackForwardingEnabledResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetIdentityFeedbackForwardingEnabledOutput(&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 awsAwsquery_deserializeOpErrorSetIdentityFeedbackForwardingEnabled(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetIdentityHeadersInNotificationsEnabled struct { +} + +func (*awsAwsquery_deserializeOpSetIdentityHeadersInNotificationsEnabled) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetIdentityHeadersInNotificationsEnabled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetIdentityHeadersInNotificationsEnabled(response, &metadata) + } + output := &SetIdentityHeadersInNotificationsEnabledOutput{} + 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) + t, err = decoder.GetElement("SetIdentityHeadersInNotificationsEnabledResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetIdentityHeadersInNotificationsEnabledOutput(&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 awsAwsquery_deserializeOpErrorSetIdentityHeadersInNotificationsEnabled(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetIdentityMailFromDomain struct { +} + +func (*awsAwsquery_deserializeOpSetIdentityMailFromDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetIdentityMailFromDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetIdentityMailFromDomain(response, &metadata) + } + output := &SetIdentityMailFromDomainOutput{} + 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) + t, err = decoder.GetElement("SetIdentityMailFromDomainResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetIdentityMailFromDomainOutput(&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 awsAwsquery_deserializeOpErrorSetIdentityMailFromDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetIdentityNotificationTopic struct { +} + +func (*awsAwsquery_deserializeOpSetIdentityNotificationTopic) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetIdentityNotificationTopic) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetIdentityNotificationTopic(response, &metadata) + } + output := &SetIdentityNotificationTopicOutput{} + 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) + t, err = decoder.GetElement("SetIdentityNotificationTopicResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetIdentityNotificationTopicOutput(&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 awsAwsquery_deserializeOpErrorSetIdentityNotificationTopic(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetReceiptRulePosition struct { +} + +func (*awsAwsquery_deserializeOpSetReceiptRulePosition) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetReceiptRulePosition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetReceiptRulePosition(response, &metadata) + } + output := &SetReceiptRulePositionOutput{} + 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) + t, err = decoder.GetElement("SetReceiptRulePositionResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetReceiptRulePositionOutput(&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 awsAwsquery_deserializeOpErrorSetReceiptRulePosition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("RuleDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleDoesNotExistException(response, errorBody) + + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpTestRenderTemplate struct { +} + +func (*awsAwsquery_deserializeOpTestRenderTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpTestRenderTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorTestRenderTemplate(response, &metadata) + } + output := &TestRenderTemplateOutput{} + 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) + t, err = decoder.GetElement("TestRenderTemplateResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentTestRenderTemplateOutput(&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 awsAwsquery_deserializeOpErrorTestRenderTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidRenderingParameter", errorCode): + return awsAwsquery_deserializeErrorInvalidRenderingParameterException(response, errorBody) + + case strings.EqualFold("MissingRenderingAttribute", errorCode): + return awsAwsquery_deserializeErrorMissingRenderingAttributeException(response, errorBody) + + case strings.EqualFold("TemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorTemplateDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateAccountSendingEnabled struct { +} + +func (*awsAwsquery_deserializeOpUpdateAccountSendingEnabled) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateAccountSendingEnabled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateAccountSendingEnabled(response, &metadata) + } + output := &UpdateAccountSendingEnabledOutput{} + 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 awsAwsquery_deserializeOpErrorUpdateAccountSendingEnabled(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateConfigurationSetEventDestination struct { +} + +func (*awsAwsquery_deserializeOpUpdateConfigurationSetEventDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateConfigurationSetEventDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateConfigurationSetEventDestination(response, &metadata) + } + output := &UpdateConfigurationSetEventDestinationOutput{} + 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) + t, err = decoder.GetElement("UpdateConfigurationSetEventDestinationResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentUpdateConfigurationSetEventDestinationOutput(&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 awsAwsquery_deserializeOpErrorUpdateConfigurationSetEventDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("EventDestinationDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorEventDestinationDoesNotExistException(response, errorBody) + + case strings.EqualFold("InvalidCloudWatchDestination", errorCode): + return awsAwsquery_deserializeErrorInvalidCloudWatchDestinationException(response, errorBody) + + case strings.EqualFold("InvalidFirehoseDestination", errorCode): + return awsAwsquery_deserializeErrorInvalidFirehoseDestinationException(response, errorBody) + + case strings.EqualFold("InvalidSNSDestination", errorCode): + return awsAwsquery_deserializeErrorInvalidSNSDestinationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateConfigurationSetReputationMetricsEnabled struct { +} + +func (*awsAwsquery_deserializeOpUpdateConfigurationSetReputationMetricsEnabled) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateConfigurationSetReputationMetricsEnabled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateConfigurationSetReputationMetricsEnabled(response, &metadata) + } + output := &UpdateConfigurationSetReputationMetricsEnabledOutput{} + 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 awsAwsquery_deserializeOpErrorUpdateConfigurationSetReputationMetricsEnabled(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateConfigurationSetSendingEnabled struct { +} + +func (*awsAwsquery_deserializeOpUpdateConfigurationSetSendingEnabled) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateConfigurationSetSendingEnabled) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateConfigurationSetSendingEnabled(response, &metadata) + } + output := &UpdateConfigurationSetSendingEnabledOutput{} + 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 awsAwsquery_deserializeOpErrorUpdateConfigurationSetSendingEnabled(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateConfigurationSetTrackingOptions struct { +} + +func (*awsAwsquery_deserializeOpUpdateConfigurationSetTrackingOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateConfigurationSetTrackingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateConfigurationSetTrackingOptions(response, &metadata) + } + output := &UpdateConfigurationSetTrackingOptionsOutput{} + 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) + t, err = decoder.GetElement("UpdateConfigurationSetTrackingOptionsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentUpdateConfigurationSetTrackingOptionsOutput(&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 awsAwsquery_deserializeOpErrorUpdateConfigurationSetTrackingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConfigurationSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response, errorBody) + + case strings.EqualFold("InvalidTrackingOptions", errorCode): + return awsAwsquery_deserializeErrorInvalidTrackingOptionsException(response, errorBody) + + case strings.EqualFold("TrackingOptionsDoesNotExistException", errorCode): + return awsAwsquery_deserializeErrorTrackingOptionsDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_deserializeOpUpdateCustomVerificationEmailTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateCustomVerificationEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateCustomVerificationEmailTemplate(response, &metadata) + } + output := &UpdateCustomVerificationEmailTemplateOutput{} + 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 awsAwsquery_deserializeOpErrorUpdateCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CustomVerificationEmailInvalidContent", errorCode): + return awsAwsquery_deserializeErrorCustomVerificationEmailInvalidContentException(response, errorBody) + + case strings.EqualFold("CustomVerificationEmailTemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorCustomVerificationEmailTemplateDoesNotExistException(response, errorBody) + + case strings.EqualFold("FromEmailAddressNotVerified", errorCode): + return awsAwsquery_deserializeErrorFromEmailAddressNotVerifiedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateReceiptRule struct { +} + +func (*awsAwsquery_deserializeOpUpdateReceiptRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateReceiptRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateReceiptRule(response, &metadata) + } + output := &UpdateReceiptRuleOutput{} + 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) + t, err = decoder.GetElement("UpdateReceiptRuleResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentUpdateReceiptRuleOutput(&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 awsAwsquery_deserializeOpErrorUpdateReceiptRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidLambdaFunction", errorCode): + return awsAwsquery_deserializeErrorInvalidLambdaFunctionException(response, errorBody) + + case strings.EqualFold("InvalidS3Configuration", errorCode): + return awsAwsquery_deserializeErrorInvalidS3ConfigurationException(response, errorBody) + + case strings.EqualFold("InvalidSnsTopic", errorCode): + return awsAwsquery_deserializeErrorInvalidSnsTopicException(response, errorBody) + + case strings.EqualFold("LimitExceeded", errorCode): + return awsAwsquery_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("RuleDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleDoesNotExistException(response, errorBody) + + case strings.EqualFold("RuleSetDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpUpdateTemplate struct { +} + +func (*awsAwsquery_deserializeOpUpdateTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpUpdateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorUpdateTemplate(response, &metadata) + } + output := &UpdateTemplateOutput{} + 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) + t, err = decoder.GetElement("UpdateTemplateResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentUpdateTemplateOutput(&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 awsAwsquery_deserializeOpErrorUpdateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidTemplate", errorCode): + return awsAwsquery_deserializeErrorInvalidTemplateException(response, errorBody) + + case strings.EqualFold("TemplateDoesNotExist", errorCode): + return awsAwsquery_deserializeErrorTemplateDoesNotExistException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpVerifyDomainDkim struct { +} + +func (*awsAwsquery_deserializeOpVerifyDomainDkim) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpVerifyDomainDkim) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorVerifyDomainDkim(response, &metadata) + } + output := &VerifyDomainDkimOutput{} + 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) + t, err = decoder.GetElement("VerifyDomainDkimResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentVerifyDomainDkimOutput(&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 awsAwsquery_deserializeOpErrorVerifyDomainDkim(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpVerifyDomainIdentity struct { +} + +func (*awsAwsquery_deserializeOpVerifyDomainIdentity) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpVerifyDomainIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorVerifyDomainIdentity(response, &metadata) + } + output := &VerifyDomainIdentityOutput{} + 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) + t, err = decoder.GetElement("VerifyDomainIdentityResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentVerifyDomainIdentityOutput(&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 awsAwsquery_deserializeOpErrorVerifyDomainIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpVerifyEmailAddress struct { +} + +func (*awsAwsquery_deserializeOpVerifyEmailAddress) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpVerifyEmailAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorVerifyEmailAddress(response, &metadata) + } + output := &VerifyEmailAddressOutput{} + 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 awsAwsquery_deserializeOpErrorVerifyEmailAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpVerifyEmailIdentity struct { +} + +func (*awsAwsquery_deserializeOpVerifyEmailIdentity) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpVerifyEmailIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorVerifyEmailIdentity(response, &metadata) + } + output := &VerifyEmailIdentityOutput{} + 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) + t, err = decoder.GetElement("VerifyEmailIdentityResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentVerifyEmailIdentityOutput(&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 awsAwsquery_deserializeOpErrorVerifyEmailIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsquery_deserializeErrorAccountSendingPausedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccountSendingPausedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentAccountSendingPausedException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AlreadyExistsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentAlreadyExistsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCannotDeleteException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CannotDeleteException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCannotDeleteException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorConfigurationSetAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConfigurationSetAlreadyExistsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentConfigurationSetAlreadyExistsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorConfigurationSetDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConfigurationSetDoesNotExistException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentConfigurationSetDoesNotExistException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorConfigurationSetSendingPausedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConfigurationSetSendingPausedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentConfigurationSetSendingPausedException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCustomVerificationEmailInvalidContentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CustomVerificationEmailInvalidContentException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCustomVerificationEmailInvalidContentException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCustomVerificationEmailTemplateAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CustomVerificationEmailTemplateAlreadyExistsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCustomVerificationEmailTemplateAlreadyExistsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCustomVerificationEmailTemplateDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CustomVerificationEmailTemplateDoesNotExistException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCustomVerificationEmailTemplateDoesNotExistException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorEventDestinationAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EventDestinationAlreadyExistsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentEventDestinationAlreadyExistsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorEventDestinationDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EventDestinationDoesNotExistException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentEventDestinationDoesNotExistException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorFromEmailAddressNotVerifiedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FromEmailAddressNotVerifiedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentFromEmailAddressNotVerifiedException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidCloudWatchDestinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidCloudWatchDestinationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidCloudWatchDestinationException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidConfigurationSetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidConfigurationSetException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidConfigurationSetException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDeliveryOptionsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDeliveryOptionsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDeliveryOptionsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidFirehoseDestinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidFirehoseDestinationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidFirehoseDestinationException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidLambdaFunctionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidLambdaFunctionException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidLambdaFunctionException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidPolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidPolicyException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidPolicyException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidRenderingParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRenderingParameterException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidRenderingParameterException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidS3ConfigurationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidS3ConfigurationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidS3ConfigurationException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidSNSDestinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSNSDestinationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidSNSDestinationException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidSnsTopicException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSnsTopicException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidSnsTopicException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidTemplateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidTemplateException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidTemplateException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidTrackingOptionsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidTrackingOptionsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidTrackingOptionsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LimitExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentLimitExceededException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorMailFromDomainNotVerifiedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.MailFromDomainNotVerifiedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentMailFromDomainNotVerifiedException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorMessageRejected(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.MessageRejected{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentMessageRejected(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorMissingRenderingAttributeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.MissingRenderingAttributeException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentMissingRenderingAttributeException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorProductionAccessNotGrantedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ProductionAccessNotGrantedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentProductionAccessNotGrantedException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorRuleDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RuleDoesNotExistException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRuleDoesNotExistException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorRuleSetDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RuleSetDoesNotExistException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRuleSetDoesNotExistException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTemplateDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TemplateDoesNotExistException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTemplateDoesNotExistException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTrackingOptionsAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrackingOptionsAlreadyExistsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTrackingOptionsAlreadyExistsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTrackingOptionsDoesNotExistException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrackingOptionsDoesNotExistException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTrackingOptionsDoesNotExistException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeDocumentAccountSendingPausedException(v **types.AccountSendingPausedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AccountSendingPausedException + if *v == nil { + sv = &types.AccountSendingPausedException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAddHeaderAction(v **types.AddHeaderAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AddHeaderAction + if *v == nil { + sv = &types.AddHeaderAction{} + } 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("HeaderName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HeaderName = ptr.String(xtv) + } + + case strings.EqualFold("HeaderValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HeaderValue = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAddressList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAddressListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAlreadyExistsException(v **types.AlreadyExistsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AlreadyExistsException + if *v == nil { + sv = &types.AlreadyExistsException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBounceAction(v **types.BounceAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BounceAction + if *v == nil { + sv = &types.BounceAction{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Sender", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Sender = ptr.String(xtv) + } + + case strings.EqualFold("SmtpReplyCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SmtpReplyCode = ptr.String(xtv) + } + + case strings.EqualFold("StatusCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusCode = ptr.String(xtv) + } + + case strings.EqualFold("TopicArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TopicArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBulkEmailDestinationStatus(v **types.BulkEmailDestinationStatus, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BulkEmailDestinationStatus + if *v == nil { + sv = &types.BulkEmailDestinationStatus{} + } 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("Error", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Error = ptr.String(xtv) + } + + case strings.EqualFold("MessageId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MessageId = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.BulkEmailStatus(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 awsAwsquery_deserializeDocumentBulkEmailDestinationStatusList(v *[]types.BulkEmailDestinationStatus, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.BulkEmailDestinationStatus + if *v == nil { + sv = make([]types.BulkEmailDestinationStatus, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.BulkEmailDestinationStatus + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentBulkEmailDestinationStatus(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBulkEmailDestinationStatusListUnwrapped(v *[]types.BulkEmailDestinationStatus, decoder smithyxml.NodeDecoder) error { + var sv []types.BulkEmailDestinationStatus + if *v == nil { + sv = make([]types.BulkEmailDestinationStatus, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.BulkEmailDestinationStatus + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentBulkEmailDestinationStatus(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCannotDeleteException(v **types.CannotDeleteException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CannotDeleteException + if *v == nil { + sv = &types.CannotDeleteException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCloudWatchDestination(v **types.CloudWatchDestination, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CloudWatchDestination + if *v == nil { + sv = &types.CloudWatchDestination{} + } 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("DimensionConfigurations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCloudWatchDimensionConfigurations(&sv.DimensionConfigurations, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCloudWatchDimensionConfiguration(v **types.CloudWatchDimensionConfiguration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CloudWatchDimensionConfiguration + if *v == nil { + sv = &types.CloudWatchDimensionConfiguration{} + } 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("DefaultDimensionValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DefaultDimensionValue = ptr.String(xtv) + } + + case strings.EqualFold("DimensionName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DimensionName = ptr.String(xtv) + } + + case strings.EqualFold("DimensionValueSource", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DimensionValueSource = types.DimensionValueSource(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 awsAwsquery_deserializeDocumentCloudWatchDimensionConfigurations(v *[]types.CloudWatchDimensionConfiguration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.CloudWatchDimensionConfiguration + if *v == nil { + sv = make([]types.CloudWatchDimensionConfiguration, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.CloudWatchDimensionConfiguration + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentCloudWatchDimensionConfiguration(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCloudWatchDimensionConfigurationsUnwrapped(v *[]types.CloudWatchDimensionConfiguration, decoder smithyxml.NodeDecoder) error { + var sv []types.CloudWatchDimensionConfiguration + if *v == nil { + sv = make([]types.CloudWatchDimensionConfiguration, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.CloudWatchDimensionConfiguration + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentCloudWatchDimensionConfiguration(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentConfigurationSet(v **types.ConfigurationSet, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConfigurationSet + if *v == nil { + sv = &types.ConfigurationSet{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentConfigurationSetAlreadyExistsException(v **types.ConfigurationSetAlreadyExistsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConfigurationSetAlreadyExistsException + if *v == nil { + sv = &types.ConfigurationSetAlreadyExistsException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentConfigurationSetDoesNotExistException(v **types.ConfigurationSetDoesNotExistException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConfigurationSetDoesNotExistException + if *v == nil { + sv = &types.ConfigurationSetDoesNotExistException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentConfigurationSets(v *[]types.ConfigurationSet, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ConfigurationSet + if *v == nil { + sv = make([]types.ConfigurationSet, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ConfigurationSet + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentConfigurationSet(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentConfigurationSetsUnwrapped(v *[]types.ConfigurationSet, decoder smithyxml.NodeDecoder) error { + var sv []types.ConfigurationSet + if *v == nil { + sv = make([]types.ConfigurationSet, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ConfigurationSet + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentConfigurationSet(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentConfigurationSetSendingPausedException(v **types.ConfigurationSetSendingPausedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConfigurationSetSendingPausedException + if *v == nil { + sv = &types.ConfigurationSetSendingPausedException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomVerificationEmailInvalidContentException(v **types.CustomVerificationEmailInvalidContentException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomVerificationEmailInvalidContentException + if *v == nil { + sv = &types.CustomVerificationEmailInvalidContentException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomVerificationEmailTemplate(v **types.CustomVerificationEmailTemplate, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomVerificationEmailTemplate + if *v == nil { + sv = &types.CustomVerificationEmailTemplate{} + } 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("FailureRedirectionURL", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FailureRedirectionURL = ptr.String(xtv) + } + + case strings.EqualFold("FromEmailAddress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FromEmailAddress = ptr.String(xtv) + } + + case strings.EqualFold("SuccessRedirectionURL", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SuccessRedirectionURL = ptr.String(xtv) + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + case strings.EqualFold("TemplateSubject", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateSubject = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomVerificationEmailTemplateAlreadyExistsException(v **types.CustomVerificationEmailTemplateAlreadyExistsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomVerificationEmailTemplateAlreadyExistsException + if *v == nil { + sv = &types.CustomVerificationEmailTemplateAlreadyExistsException{} + } 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("CustomVerificationEmailTemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomVerificationEmailTemplateName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomVerificationEmailTemplateDoesNotExistException(v **types.CustomVerificationEmailTemplateDoesNotExistException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomVerificationEmailTemplateDoesNotExistException + if *v == nil { + sv = &types.CustomVerificationEmailTemplateDoesNotExistException{} + } 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("CustomVerificationEmailTemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomVerificationEmailTemplateName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomVerificationEmailTemplates(v *[]types.CustomVerificationEmailTemplate, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.CustomVerificationEmailTemplate + if *v == nil { + sv = make([]types.CustomVerificationEmailTemplate, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.CustomVerificationEmailTemplate + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentCustomVerificationEmailTemplate(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomVerificationEmailTemplatesUnwrapped(v *[]types.CustomVerificationEmailTemplate, decoder smithyxml.NodeDecoder) error { + var sv []types.CustomVerificationEmailTemplate + if *v == nil { + sv = make([]types.CustomVerificationEmailTemplate, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.CustomVerificationEmailTemplate + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentCustomVerificationEmailTemplate(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDeliveryOptions(v **types.DeliveryOptions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DeliveryOptions + if *v == nil { + sv = &types.DeliveryOptions{} + } 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("TlsPolicy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TlsPolicy = types.TlsPolicy(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 awsAwsquery_deserializeDocumentDkimAttributes(v *map[string]types.IdentityDkimAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]types.IdentityDkimAttributes + if *v == nil { + sv = make(map[string]types.IdentityDkimAttributes, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDkimAttributesUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDkimAttributesUnwrapped(v *map[string]types.IdentityDkimAttributes, decoder smithyxml.NodeDecoder) error { + var sv map[string]types.IdentityDkimAttributes + if *v == nil { + sv = make(map[string]types.IdentityDkimAttributes, 0) + } else { + sv = *v + } + + var ek string + var ev types.IdentityDkimAttributes + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + mapVar := ev + destAddr := &mapVar + if err := awsAwsquery_deserializeDocumentIdentityDkimAttributes(&destAddr, nodeDecoder); err != nil { + return err + } + ev = *destAddr + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEventDestination(v **types.EventDestination, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EventDestination + if *v == nil { + sv = &types.EventDestination{} + } 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("CloudWatchDestination", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCloudWatchDestination(&sv.CloudWatchDestination, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Enabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.Enabled = xtv + } + + case strings.EqualFold("KinesisFirehoseDestination", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentKinesisFirehoseDestination(&sv.KinesisFirehoseDestination, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MatchingEventTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventTypes(&sv.MatchingEventTypes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("SNSDestination", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSNSDestination(&sv.SNSDestination, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventDestinationAlreadyExistsException(v **types.EventDestinationAlreadyExistsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EventDestinationAlreadyExistsException + if *v == nil { + sv = &types.EventDestinationAlreadyExistsException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("EventDestinationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EventDestinationName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventDestinationDoesNotExistException(v **types.EventDestinationDoesNotExistException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EventDestinationDoesNotExistException + if *v == nil { + sv = &types.EventDestinationDoesNotExistException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("EventDestinationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EventDestinationName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventDestinations(v *[]types.EventDestination, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.EventDestination + if *v == nil { + sv = make([]types.EventDestination, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.EventDestination + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentEventDestination(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventDestinationsUnwrapped(v *[]types.EventDestination, decoder smithyxml.NodeDecoder) error { + var sv []types.EventDestination + if *v == nil { + sv = make([]types.EventDestination, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.EventDestination + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentEventDestination(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEventTypes(v *[]types.EventType, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.EventType + if *v == nil { + sv = make([]types.EventType, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.EventType + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = types.EventType(xtv) + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventTypesUnwrapped(v *[]types.EventType, decoder smithyxml.NodeDecoder) error { + var sv []types.EventType + if *v == nil { + sv = make([]types.EventType, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.EventType + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = types.EventType(xtv) + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentFromEmailAddressNotVerifiedException(v **types.FromEmailAddressNotVerifiedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.FromEmailAddressNotVerifiedException + if *v == nil { + sv = &types.FromEmailAddressNotVerifiedException{} + } 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("FromEmailAddress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FromEmailAddress = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIdentityDkimAttributes(v **types.IdentityDkimAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IdentityDkimAttributes + if *v == nil { + sv = &types.IdentityDkimAttributes{} + } 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("DkimEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.DkimEnabled = xtv + } + + case strings.EqualFold("DkimTokens", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentVerificationTokenList(&sv.DkimTokens, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DkimVerificationStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DkimVerificationStatus = types.VerificationStatus(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 awsAwsquery_deserializeDocumentIdentityList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIdentityListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentIdentityMailFromDomainAttributes(v **types.IdentityMailFromDomainAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IdentityMailFromDomainAttributes + if *v == nil { + sv = &types.IdentityMailFromDomainAttributes{} + } 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("BehaviorOnMXFailure", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BehaviorOnMXFailure = types.BehaviorOnMXFailure(xtv) + } + + case strings.EqualFold("MailFromDomain", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MailFromDomain = ptr.String(xtv) + } + + case strings.EqualFold("MailFromDomainStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MailFromDomainStatus = types.CustomMailFromStatus(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 awsAwsquery_deserializeDocumentIdentityNotificationAttributes(v **types.IdentityNotificationAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IdentityNotificationAttributes + if *v == nil { + sv = &types.IdentityNotificationAttributes{} + } 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("BounceTopic", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BounceTopic = ptr.String(xtv) + } + + case strings.EqualFold("ComplaintTopic", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ComplaintTopic = ptr.String(xtv) + } + + case strings.EqualFold("DeliveryTopic", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DeliveryTopic = ptr.String(xtv) + } + + case strings.EqualFold("ForwardingEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.ForwardingEnabled = xtv + } + + case strings.EqualFold("HeadersInBounceNotificationsEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.HeadersInBounceNotificationsEnabled = xtv + } + + case strings.EqualFold("HeadersInComplaintNotificationsEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.HeadersInComplaintNotificationsEnabled = xtv + } + + case strings.EqualFold("HeadersInDeliveryNotificationsEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.HeadersInDeliveryNotificationsEnabled = 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 awsAwsquery_deserializeDocumentIdentityVerificationAttributes(v **types.IdentityVerificationAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IdentityVerificationAttributes + if *v == nil { + sv = &types.IdentityVerificationAttributes{} + } 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("VerificationStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VerificationStatus = types.VerificationStatus(xtv) + } + + case strings.EqualFold("VerificationToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VerificationToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidCloudWatchDestinationException(v **types.InvalidCloudWatchDestinationException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidCloudWatchDestinationException + if *v == nil { + sv = &types.InvalidCloudWatchDestinationException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("EventDestinationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EventDestinationName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidConfigurationSetException(v **types.InvalidConfigurationSetException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidConfigurationSetException + if *v == nil { + sv = &types.InvalidConfigurationSetException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDeliveryOptionsException(v **types.InvalidDeliveryOptionsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDeliveryOptionsException + if *v == nil { + sv = &types.InvalidDeliveryOptionsException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidFirehoseDestinationException(v **types.InvalidFirehoseDestinationException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidFirehoseDestinationException + if *v == nil { + sv = &types.InvalidFirehoseDestinationException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("EventDestinationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EventDestinationName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidLambdaFunctionException(v **types.InvalidLambdaFunctionException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidLambdaFunctionException + if *v == nil { + sv = &types.InvalidLambdaFunctionException{} + } 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("FunctionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FunctionArn = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidPolicyException(v **types.InvalidPolicyException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidPolicyException + if *v == nil { + sv = &types.InvalidPolicyException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidRenderingParameterException(v **types.InvalidRenderingParameterException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidRenderingParameterException + if *v == nil { + sv = &types.InvalidRenderingParameterException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidS3ConfigurationException(v **types.InvalidS3ConfigurationException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidS3ConfigurationException + if *v == nil { + sv = &types.InvalidS3ConfigurationException{} + } 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("Bucket", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Bucket = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidSNSDestinationException(v **types.InvalidSNSDestinationException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidSNSDestinationException + if *v == nil { + sv = &types.InvalidSNSDestinationException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("EventDestinationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EventDestinationName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidSnsTopicException(v **types.InvalidSnsTopicException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidSnsTopicException + if *v == nil { + sv = &types.InvalidSnsTopicException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Topic", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Topic = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidTemplateException(v **types.InvalidTemplateException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidTemplateException + if *v == nil { + sv = &types.InvalidTemplateException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidTrackingOptionsException(v **types.InvalidTrackingOptionsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidTrackingOptionsException + if *v == nil { + sv = &types.InvalidTrackingOptionsException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentKinesisFirehoseDestination(v **types.KinesisFirehoseDestination, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.KinesisFirehoseDestination + if *v == nil { + sv = &types.KinesisFirehoseDestination{} + } 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("DeliveryStreamARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DeliveryStreamARN = ptr.String(xtv) + } + + case strings.EqualFold("IAMRoleARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IAMRoleARN = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLambdaAction(v **types.LambdaAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LambdaAction + if *v == nil { + sv = &types.LambdaAction{} + } 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("FunctionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FunctionArn = ptr.String(xtv) + } + + case strings.EqualFold("InvocationType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InvocationType = types.InvocationType(xtv) + } + + case strings.EqualFold("TopicArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TopicArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLimitExceededException(v **types.LimitExceededException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMailFromDomainAttributes(v *map[string]types.IdentityMailFromDomainAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]types.IdentityMailFromDomainAttributes + if *v == nil { + sv = make(map[string]types.IdentityMailFromDomainAttributes, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMailFromDomainAttributesUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMailFromDomainAttributesUnwrapped(v *map[string]types.IdentityMailFromDomainAttributes, decoder smithyxml.NodeDecoder) error { + var sv map[string]types.IdentityMailFromDomainAttributes + if *v == nil { + sv = make(map[string]types.IdentityMailFromDomainAttributes, 0) + } else { + sv = *v + } + + var ek string + var ev types.IdentityMailFromDomainAttributes + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + mapVar := ev + destAddr := &mapVar + if err := awsAwsquery_deserializeDocumentIdentityMailFromDomainAttributes(&destAddr, nodeDecoder); err != nil { + return err + } + ev = *destAddr + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentMailFromDomainNotVerifiedException(v **types.MailFromDomainNotVerifiedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MailFromDomainNotVerifiedException + if *v == nil { + sv = &types.MailFromDomainNotVerifiedException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMessageRejected(v **types.MessageRejected, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MessageRejected + if *v == nil { + sv = &types.MessageRejected{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMissingRenderingAttributeException(v **types.MissingRenderingAttributeException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MissingRenderingAttributeException + if *v == nil { + sv = &types.MissingRenderingAttributeException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentNotificationAttributes(v *map[string]types.IdentityNotificationAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]types.IdentityNotificationAttributes + if *v == nil { + sv = make(map[string]types.IdentityNotificationAttributes, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentNotificationAttributesUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentNotificationAttributesUnwrapped(v *map[string]types.IdentityNotificationAttributes, decoder smithyxml.NodeDecoder) error { + var sv map[string]types.IdentityNotificationAttributes + if *v == nil { + sv = make(map[string]types.IdentityNotificationAttributes, 0) + } else { + sv = *v + } + + var ek string + var ev types.IdentityNotificationAttributes + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + mapVar := ev + destAddr := &mapVar + if err := awsAwsquery_deserializeDocumentIdentityNotificationAttributes(&destAddr, nodeDecoder); err != nil { + return err + } + ev = *destAddr + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPolicyMap(v *map[string]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyMapUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyMapUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + var ek string + var ev string + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ev = xtv + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPolicyNameList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyNameListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentProductionAccessNotGrantedException(v **types.ProductionAccessNotGrantedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ProductionAccessNotGrantedException + if *v == nil { + sv = &types.ProductionAccessNotGrantedException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptAction(v **types.ReceiptAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReceiptAction + if *v == nil { + sv = &types.ReceiptAction{} + } 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("AddHeaderAction", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAddHeaderAction(&sv.AddHeaderAction, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("BounceAction", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBounceAction(&sv.BounceAction, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("LambdaAction", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLambdaAction(&sv.LambdaAction, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("S3Action", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentS3Action(&sv.S3Action, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SNSAction", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSNSAction(&sv.SNSAction, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StopAction", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStopAction(&sv.StopAction, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("WorkmailAction", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentWorkmailAction(&sv.WorkmailAction, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptActionsList(v *[]types.ReceiptAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ReceiptAction + if *v == nil { + sv = make([]types.ReceiptAction, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ReceiptAction + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentReceiptAction(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptActionsListUnwrapped(v *[]types.ReceiptAction, decoder smithyxml.NodeDecoder) error { + var sv []types.ReceiptAction + if *v == nil { + sv = make([]types.ReceiptAction, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ReceiptAction + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentReceiptAction(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReceiptFilter(v **types.ReceiptFilter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReceiptFilter + if *v == nil { + sv = &types.ReceiptFilter{} + } 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("IpFilter", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptIpFilter(&sv.IpFilter, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptFilterList(v *[]types.ReceiptFilter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ReceiptFilter + if *v == nil { + sv = make([]types.ReceiptFilter, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ReceiptFilter + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentReceiptFilter(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptFilterListUnwrapped(v *[]types.ReceiptFilter, decoder smithyxml.NodeDecoder) error { + var sv []types.ReceiptFilter + if *v == nil { + sv = make([]types.ReceiptFilter, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ReceiptFilter + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentReceiptFilter(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReceiptIpFilter(v **types.ReceiptIpFilter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReceiptIpFilter + if *v == nil { + sv = &types.ReceiptIpFilter{} + } 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("Cidr", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Cidr = ptr.String(xtv) + } + + case strings.EqualFold("Policy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Policy = types.ReceiptFilterPolicy(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 awsAwsquery_deserializeDocumentReceiptRule(v **types.ReceiptRule, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReceiptRule + if *v == nil { + sv = &types.ReceiptRule{} + } 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("Actions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptActionsList(&sv.Actions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Enabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.Enabled = xtv + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Recipients", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRecipientsList(&sv.Recipients, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ScanEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.ScanEnabled = xtv + } + + case strings.EqualFold("TlsPolicy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TlsPolicy = types.TlsPolicy(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 awsAwsquery_deserializeDocumentReceiptRuleSetMetadata(v **types.ReceiptRuleSetMetadata, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReceiptRuleSetMetadata + if *v == nil { + sv = &types.ReceiptRuleSetMetadata{} + } 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("CreatedTimestamp", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptRuleSetsLists(v *[]types.ReceiptRuleSetMetadata, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ReceiptRuleSetMetadata + if *v == nil { + sv = make([]types.ReceiptRuleSetMetadata, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ReceiptRuleSetMetadata + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentReceiptRuleSetMetadata(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptRuleSetsListsUnwrapped(v *[]types.ReceiptRuleSetMetadata, decoder smithyxml.NodeDecoder) error { + var sv []types.ReceiptRuleSetMetadata + if *v == nil { + sv = make([]types.ReceiptRuleSetMetadata, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ReceiptRuleSetMetadata + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentReceiptRuleSetMetadata(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReceiptRulesList(v *[]types.ReceiptRule, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ReceiptRule + if *v == nil { + sv = make([]types.ReceiptRule, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ReceiptRule + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentReceiptRule(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReceiptRulesListUnwrapped(v *[]types.ReceiptRule, decoder smithyxml.NodeDecoder) error { + var sv []types.ReceiptRule + if *v == nil { + sv = make([]types.ReceiptRule, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ReceiptRule + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentReceiptRule(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentRecipientsList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRecipientsListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReputationOptions(v **types.ReputationOptions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReputationOptions + if *v == nil { + sv = &types.ReputationOptions{} + } 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("LastFreshStart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LastFreshStart = ptr.Time(t) + } + + case strings.EqualFold("ReputationMetricsEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.ReputationMetricsEnabled = xtv + } + + case strings.EqualFold("SendingEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.SendingEnabled = 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 awsAwsquery_deserializeDocumentRuleDoesNotExistException(v **types.RuleDoesNotExistException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RuleDoesNotExistException + if *v == nil { + sv = &types.RuleDoesNotExistException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRuleSetDoesNotExistException(v **types.RuleSetDoesNotExistException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RuleSetDoesNotExistException + if *v == nil { + sv = &types.RuleSetDoesNotExistException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentS3Action(v **types.S3Action, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.S3Action + if *v == nil { + sv = &types.S3Action{} + } 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("BucketName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BucketName = ptr.String(xtv) + } + + case strings.EqualFold("KmsKeyArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyArn = ptr.String(xtv) + } + + case strings.EqualFold("ObjectKeyPrefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ObjectKeyPrefix = ptr.String(xtv) + } + + case strings.EqualFold("TopicArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TopicArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSendDataPoint(v **types.SendDataPoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SendDataPoint + if *v == nil { + sv = &types.SendDataPoint{} + } 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("Bounces", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Bounces = i64 + } + + case strings.EqualFold("Complaints", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Complaints = i64 + } + + case strings.EqualFold("DeliveryAttempts", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.DeliveryAttempts = i64 + } + + case strings.EqualFold("Rejects", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Rejects = i64 + } + + case strings.EqualFold("Timestamp", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.Timestamp = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSendDataPointList(v *[]types.SendDataPoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.SendDataPoint + if *v == nil { + sv = make([]types.SendDataPoint, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.SendDataPoint + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentSendDataPoint(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSendDataPointListUnwrapped(v *[]types.SendDataPoint, decoder smithyxml.NodeDecoder) error { + var sv []types.SendDataPoint + if *v == nil { + sv = make([]types.SendDataPoint, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.SendDataPoint + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentSendDataPoint(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentSNSAction(v **types.SNSAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SNSAction + if *v == nil { + sv = &types.SNSAction{} + } 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("Encoding", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Encoding = types.SNSActionEncoding(xtv) + } + + case strings.EqualFold("TopicArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TopicArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSNSDestination(v **types.SNSDestination, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SNSDestination + if *v == nil { + sv = &types.SNSDestination{} + } 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("TopicARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TopicARN = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentStopAction(v **types.StopAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.StopAction + if *v == nil { + sv = &types.StopAction{} + } 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("Scope", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Scope = types.StopScope(xtv) + } + + case strings.EqualFold("TopicArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TopicArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTemplate(v **types.Template, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Template + if *v == nil { + sv = &types.Template{} + } 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("HtmlPart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HtmlPart = ptr.String(xtv) + } + + case strings.EqualFold("SubjectPart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubjectPart = ptr.String(xtv) + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + case strings.EqualFold("TextPart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TextPart = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTemplateDoesNotExistException(v **types.TemplateDoesNotExistException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TemplateDoesNotExistException + if *v == nil { + sv = &types.TemplateDoesNotExistException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTemplateMetadata(v **types.TemplateMetadata, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TemplateMetadata + if *v == nil { + sv = &types.TemplateMetadata{} + } 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("CreatedTimestamp", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTemplateMetadataList(v *[]types.TemplateMetadata, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.TemplateMetadata + if *v == nil { + sv = make([]types.TemplateMetadata, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.TemplateMetadata + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTemplateMetadata(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTemplateMetadataListUnwrapped(v *[]types.TemplateMetadata, decoder smithyxml.NodeDecoder) error { + var sv []types.TemplateMetadata + if *v == nil { + sv = make([]types.TemplateMetadata, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.TemplateMetadata + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTemplateMetadata(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTrackingOptions(v **types.TrackingOptions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TrackingOptions + if *v == nil { + sv = &types.TrackingOptions{} + } 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("CustomRedirectDomain", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomRedirectDomain = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTrackingOptionsAlreadyExistsException(v **types.TrackingOptionsAlreadyExistsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TrackingOptionsAlreadyExistsException + if *v == nil { + sv = &types.TrackingOptionsAlreadyExistsException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTrackingOptionsDoesNotExistException(v **types.TrackingOptionsDoesNotExistException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TrackingOptionsDoesNotExistException + if *v == nil { + sv = &types.TrackingOptionsDoesNotExistException{} + } 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("ConfigurationSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConfigurationSetName = ptr.String(xtv) + } + + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentVerificationAttributes(v *map[string]types.IdentityVerificationAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]types.IdentityVerificationAttributes + if *v == nil { + sv = make(map[string]types.IdentityVerificationAttributes, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentVerificationAttributesUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentVerificationAttributesUnwrapped(v *map[string]types.IdentityVerificationAttributes, decoder smithyxml.NodeDecoder) error { + var sv map[string]types.IdentityVerificationAttributes + if *v == nil { + sv = make(map[string]types.IdentityVerificationAttributes, 0) + } else { + sv = *v + } + + var ek string + var ev types.IdentityVerificationAttributes + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + mapVar := ev + destAddr := &mapVar + if err := awsAwsquery_deserializeDocumentIdentityVerificationAttributes(&destAddr, nodeDecoder); err != nil { + return err + } + ev = *destAddr + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentVerificationTokenList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentVerificationTokenListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentWorkmailAction(v **types.WorkmailAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.WorkmailAction + if *v == nil { + sv = &types.WorkmailAction{} + } 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("OrganizationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OrganizationArn = ptr.String(xtv) + } + + case strings.EqualFold("TopicArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TopicArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCloneReceiptRuleSetOutput(v **CloneReceiptRuleSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CloneReceiptRuleSetOutput + if *v == nil { + sv = &CloneReceiptRuleSetOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateConfigurationSetEventDestinationOutput(v **CreateConfigurationSetEventDestinationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateConfigurationSetEventDestinationOutput + if *v == nil { + sv = &CreateConfigurationSetEventDestinationOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateConfigurationSetOutput(v **CreateConfigurationSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateConfigurationSetOutput + if *v == nil { + sv = &CreateConfigurationSetOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateConfigurationSetTrackingOptionsOutput(v **CreateConfigurationSetTrackingOptionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateConfigurationSetTrackingOptionsOutput + if *v == nil { + sv = &CreateConfigurationSetTrackingOptionsOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateReceiptFilterOutput(v **CreateReceiptFilterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateReceiptFilterOutput + if *v == nil { + sv = &CreateReceiptFilterOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateReceiptRuleOutput(v **CreateReceiptRuleOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateReceiptRuleOutput + if *v == nil { + sv = &CreateReceiptRuleOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateReceiptRuleSetOutput(v **CreateReceiptRuleSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateReceiptRuleSetOutput + if *v == nil { + sv = &CreateReceiptRuleSetOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateTemplateOutput(v **CreateTemplateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateTemplateOutput + if *v == nil { + sv = &CreateTemplateOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteConfigurationSetEventDestinationOutput(v **DeleteConfigurationSetEventDestinationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteConfigurationSetEventDestinationOutput + if *v == nil { + sv = &DeleteConfigurationSetEventDestinationOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteConfigurationSetOutput(v **DeleteConfigurationSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteConfigurationSetOutput + if *v == nil { + sv = &DeleteConfigurationSetOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteConfigurationSetTrackingOptionsOutput(v **DeleteConfigurationSetTrackingOptionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteConfigurationSetTrackingOptionsOutput + if *v == nil { + sv = &DeleteConfigurationSetTrackingOptionsOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteIdentityOutput(v **DeleteIdentityOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteIdentityOutput + if *v == nil { + sv = &DeleteIdentityOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteIdentityPolicyOutput(v **DeleteIdentityPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteIdentityPolicyOutput + if *v == nil { + sv = &DeleteIdentityPolicyOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteReceiptFilterOutput(v **DeleteReceiptFilterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteReceiptFilterOutput + if *v == nil { + sv = &DeleteReceiptFilterOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteReceiptRuleOutput(v **DeleteReceiptRuleOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteReceiptRuleOutput + if *v == nil { + sv = &DeleteReceiptRuleOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteReceiptRuleSetOutput(v **DeleteReceiptRuleSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteReceiptRuleSetOutput + if *v == nil { + sv = &DeleteReceiptRuleSetOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteTemplateOutput(v **DeleteTemplateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteTemplateOutput + if *v == nil { + sv = &DeleteTemplateOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeActiveReceiptRuleSetOutput(v **DescribeActiveReceiptRuleSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeActiveReceiptRuleSetOutput + if *v == nil { + sv = &DescribeActiveReceiptRuleSetOutput{} + } 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("Metadata", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptRuleSetMetadata(&sv.Metadata, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Rules", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptRulesList(&sv.Rules, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeConfigurationSetOutput(v **DescribeConfigurationSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeConfigurationSetOutput + if *v == nil { + sv = &DescribeConfigurationSetOutput{} + } 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("ConfigurationSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentConfigurationSet(&sv.ConfigurationSet, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DeliveryOptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDeliveryOptions(&sv.DeliveryOptions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("EventDestinations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventDestinations(&sv.EventDestinations, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReputationOptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReputationOptions(&sv.ReputationOptions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TrackingOptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTrackingOptions(&sv.TrackingOptions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeReceiptRuleOutput(v **DescribeReceiptRuleOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeReceiptRuleOutput + if *v == nil { + sv = &DescribeReceiptRuleOutput{} + } 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("Rule", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptRule(&sv.Rule, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeReceiptRuleSetOutput(v **DescribeReceiptRuleSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeReceiptRuleSetOutput + if *v == nil { + sv = &DescribeReceiptRuleSetOutput{} + } 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("Metadata", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptRuleSetMetadata(&sv.Metadata, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Rules", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptRulesList(&sv.Rules, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetAccountSendingEnabledOutput(v **GetAccountSendingEnabledOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccountSendingEnabledOutput + if *v == nil { + sv = &GetAccountSendingEnabledOutput{} + } 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("Enabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", val) + } + sv.Enabled = 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 awsAwsquery_deserializeOpDocumentGetCustomVerificationEmailTemplateOutput(v **GetCustomVerificationEmailTemplateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetCustomVerificationEmailTemplateOutput + if *v == nil { + sv = &GetCustomVerificationEmailTemplateOutput{} + } 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("FailureRedirectionURL", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FailureRedirectionURL = ptr.String(xtv) + } + + case strings.EqualFold("FromEmailAddress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FromEmailAddress = ptr.String(xtv) + } + + case strings.EqualFold("SuccessRedirectionURL", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SuccessRedirectionURL = ptr.String(xtv) + } + + case strings.EqualFold("TemplateContent", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateContent = ptr.String(xtv) + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + case strings.EqualFold("TemplateSubject", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateSubject = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetIdentityDkimAttributesOutput(v **GetIdentityDkimAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetIdentityDkimAttributesOutput + if *v == nil { + sv = &GetIdentityDkimAttributesOutput{} + } 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("DkimAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDkimAttributes(&sv.DkimAttributes, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetIdentityMailFromDomainAttributesOutput(v **GetIdentityMailFromDomainAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetIdentityMailFromDomainAttributesOutput + if *v == nil { + sv = &GetIdentityMailFromDomainAttributesOutput{} + } 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("MailFromDomainAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMailFromDomainAttributes(&sv.MailFromDomainAttributes, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetIdentityNotificationAttributesOutput(v **GetIdentityNotificationAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetIdentityNotificationAttributesOutput + if *v == nil { + sv = &GetIdentityNotificationAttributesOutput{} + } 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("NotificationAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentNotificationAttributes(&sv.NotificationAttributes, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetIdentityPoliciesOutput(v **GetIdentityPoliciesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetIdentityPoliciesOutput + if *v == nil { + sv = &GetIdentityPoliciesOutput{} + } 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("Policies", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyMap(&sv.Policies, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetIdentityVerificationAttributesOutput(v **GetIdentityVerificationAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetIdentityVerificationAttributesOutput + if *v == nil { + sv = &GetIdentityVerificationAttributesOutput{} + } 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("VerificationAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentVerificationAttributes(&sv.VerificationAttributes, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetSendQuotaOutput(v **GetSendQuotaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetSendQuotaOutput + if *v == nil { + sv = &GetSendQuotaOutput{} + } 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("Max24HourSend", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.Max24HourSend = f64 + } + + case strings.EqualFold("MaxSendRate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxSendRate = f64 + } + + case strings.EqualFold("SentLast24Hours", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.SentLast24Hours = f64 + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetSendStatisticsOutput(v **GetSendStatisticsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetSendStatisticsOutput + if *v == nil { + sv = &GetSendStatisticsOutput{} + } 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("SendDataPoints", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSendDataPointList(&sv.SendDataPoints, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetTemplateOutput(v **GetTemplateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetTemplateOutput + if *v == nil { + sv = &GetTemplateOutput{} + } 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("Template", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTemplate(&sv.Template, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListConfigurationSetsOutput(v **ListConfigurationSetsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListConfigurationSetsOutput + if *v == nil { + sv = &ListConfigurationSetsOutput{} + } 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("ConfigurationSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentConfigurationSets(&sv.ConfigurationSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListCustomVerificationEmailTemplatesOutput(v **ListCustomVerificationEmailTemplatesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListCustomVerificationEmailTemplatesOutput + if *v == nil { + sv = &ListCustomVerificationEmailTemplatesOutput{} + } 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("CustomVerificationEmailTemplates", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCustomVerificationEmailTemplates(&sv.CustomVerificationEmailTemplates, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListIdentitiesOutput(v **ListIdentitiesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListIdentitiesOutput + if *v == nil { + sv = &ListIdentitiesOutput{} + } 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("Identities", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIdentityList(&sv.Identities, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListIdentityPoliciesOutput(v **ListIdentityPoliciesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListIdentityPoliciesOutput + if *v == nil { + sv = &ListIdentityPoliciesOutput{} + } 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("PolicyNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyNameList(&sv.PolicyNames, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListReceiptFiltersOutput(v **ListReceiptFiltersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListReceiptFiltersOutput + if *v == nil { + sv = &ListReceiptFiltersOutput{} + } 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("Filters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptFilterList(&sv.Filters, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListReceiptRuleSetsOutput(v **ListReceiptRuleSetsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListReceiptRuleSetsOutput + if *v == nil { + sv = &ListReceiptRuleSetsOutput{} + } 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("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + case strings.EqualFold("RuleSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReceiptRuleSetsLists(&sv.RuleSets, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListTemplatesOutput(v **ListTemplatesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListTemplatesOutput + if *v == nil { + sv = &ListTemplatesOutput{} + } 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("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + case strings.EqualFold("TemplatesMetadata", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTemplateMetadataList(&sv.TemplatesMetadata, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListVerifiedEmailAddressesOutput(v **ListVerifiedEmailAddressesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListVerifiedEmailAddressesOutput + if *v == nil { + sv = &ListVerifiedEmailAddressesOutput{} + } 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("VerifiedEmailAddresses", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAddressList(&sv.VerifiedEmailAddresses, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentPutConfigurationSetDeliveryOptionsOutput(v **PutConfigurationSetDeliveryOptionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *PutConfigurationSetDeliveryOptionsOutput + if *v == nil { + sv = &PutConfigurationSetDeliveryOptionsOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentPutIdentityPolicyOutput(v **PutIdentityPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *PutIdentityPolicyOutput + if *v == nil { + sv = &PutIdentityPolicyOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentReorderReceiptRuleSetOutput(v **ReorderReceiptRuleSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ReorderReceiptRuleSetOutput + if *v == nil { + sv = &ReorderReceiptRuleSetOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSendBounceOutput(v **SendBounceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SendBounceOutput + if *v == nil { + sv = &SendBounceOutput{} + } 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("MessageId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MessageId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSendBulkTemplatedEmailOutput(v **SendBulkTemplatedEmailOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SendBulkTemplatedEmailOutput + if *v == nil { + sv = &SendBulkTemplatedEmailOutput{} + } 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("Status", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBulkEmailDestinationStatusList(&sv.Status, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSendCustomVerificationEmailOutput(v **SendCustomVerificationEmailOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SendCustomVerificationEmailOutput + if *v == nil { + sv = &SendCustomVerificationEmailOutput{} + } 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("MessageId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MessageId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSendEmailOutput(v **SendEmailOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SendEmailOutput + if *v == nil { + sv = &SendEmailOutput{} + } 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("MessageId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MessageId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSendRawEmailOutput(v **SendRawEmailOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SendRawEmailOutput + if *v == nil { + sv = &SendRawEmailOutput{} + } 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("MessageId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MessageId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSendTemplatedEmailOutput(v **SendTemplatedEmailOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SendTemplatedEmailOutput + if *v == nil { + sv = &SendTemplatedEmailOutput{} + } 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("MessageId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MessageId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetActiveReceiptRuleSetOutput(v **SetActiveReceiptRuleSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetActiveReceiptRuleSetOutput + if *v == nil { + sv = &SetActiveReceiptRuleSetOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetIdentityDkimEnabledOutput(v **SetIdentityDkimEnabledOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetIdentityDkimEnabledOutput + if *v == nil { + sv = &SetIdentityDkimEnabledOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetIdentityFeedbackForwardingEnabledOutput(v **SetIdentityFeedbackForwardingEnabledOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetIdentityFeedbackForwardingEnabledOutput + if *v == nil { + sv = &SetIdentityFeedbackForwardingEnabledOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetIdentityHeadersInNotificationsEnabledOutput(v **SetIdentityHeadersInNotificationsEnabledOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetIdentityHeadersInNotificationsEnabledOutput + if *v == nil { + sv = &SetIdentityHeadersInNotificationsEnabledOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetIdentityMailFromDomainOutput(v **SetIdentityMailFromDomainOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetIdentityMailFromDomainOutput + if *v == nil { + sv = &SetIdentityMailFromDomainOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetIdentityNotificationTopicOutput(v **SetIdentityNotificationTopicOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetIdentityNotificationTopicOutput + if *v == nil { + sv = &SetIdentityNotificationTopicOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetReceiptRulePositionOutput(v **SetReceiptRulePositionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetReceiptRulePositionOutput + if *v == nil { + sv = &SetReceiptRulePositionOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentTestRenderTemplateOutput(v **TestRenderTemplateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *TestRenderTemplateOutput + if *v == nil { + sv = &TestRenderTemplateOutput{} + } 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("RenderedTemplate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RenderedTemplate = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentUpdateConfigurationSetEventDestinationOutput(v **UpdateConfigurationSetEventDestinationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateConfigurationSetEventDestinationOutput + if *v == nil { + sv = &UpdateConfigurationSetEventDestinationOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentUpdateConfigurationSetTrackingOptionsOutput(v **UpdateConfigurationSetTrackingOptionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateConfigurationSetTrackingOptionsOutput + if *v == nil { + sv = &UpdateConfigurationSetTrackingOptionsOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentUpdateReceiptRuleOutput(v **UpdateReceiptRuleOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateReceiptRuleOutput + if *v == nil { + sv = &UpdateReceiptRuleOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentUpdateTemplateOutput(v **UpdateTemplateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateTemplateOutput + if *v == nil { + sv = &UpdateTemplateOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentVerifyDomainDkimOutput(v **VerifyDomainDkimOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *VerifyDomainDkimOutput + if *v == nil { + sv = &VerifyDomainDkimOutput{} + } 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("DkimTokens", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentVerificationTokenList(&sv.DkimTokens, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentVerifyDomainIdentityOutput(v **VerifyDomainIdentityOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *VerifyDomainIdentityOutput + if *v == nil { + sv = &VerifyDomainIdentityOutput{} + } 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("VerificationToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VerificationToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentVerifyEmailIdentityOutput(v **VerifyEmailIdentityOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *VerifyEmailIdentityOutput + if *v == nil { + sv = &VerifyEmailIdentityOutput{} + } 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 { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/doc.go new file mode 100644 index 00000000..6ac45a57 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/doc.go @@ -0,0 +1,30 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package ses provides the API client, operations, and parameter types for Amazon +// Simple Email Service. +// +// # Amazon Simple Email Service +// +// This document contains reference information for the [Amazon Simple Email Service] (Amazon SES) API, version +// 2010-12-01. This document is best used in conjunction with the [Amazon SES Developer Guide]. +// +// For a list of Amazon SES endpoints to use in service requests, see [Regions and Amazon SES] in the [Amazon SES Developer Guide]. +// +// This documentation contains reference information related to the following: +// +// [Amazon SES API Actions] +// +// [Amazon SES API Data Types] +// +// [Common Parameters] +// +// [Common Errors] +// +// [Regions and Amazon SES]: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html +// [Common Errors]: https://docs.aws.amazon.com/ses/latest/APIReference/CommonErrors.html +// [Amazon SES API Data Types]: https://docs.aws.amazon.com/ses/latest/APIReference/API_Types.html +// [Amazon Simple Email Service]: https://aws.amazon.com/ses/ +// [Amazon SES API Actions]: https://docs.aws.amazon.com/ses/latest/APIReference/API_Operations.html +// [Common Parameters]: https://docs.aws.amazon.com/ses/latest/APIReference/CommonParameters.html +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html +package ses diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/endpoints.go new file mode 100644 index 00000000..339e51e4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/endpoints.go @@ -0,0 +1,516 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/ses/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "ses" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SES") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SES", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://email-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if true == _PartitionResult.SupportsFIPS { + uriString := func() string { + var out strings.Builder + out.WriteString("https://email-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://email.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://email.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/generated.json new file mode 100644 index 00000000..4da1ae66 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/generated.json @@ -0,0 +1,104 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/jmespath/go-jmespath": "v0.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CloneReceiptRuleSet.go", + "api_op_CreateConfigurationSet.go", + "api_op_CreateConfigurationSetEventDestination.go", + "api_op_CreateConfigurationSetTrackingOptions.go", + "api_op_CreateCustomVerificationEmailTemplate.go", + "api_op_CreateReceiptFilter.go", + "api_op_CreateReceiptRule.go", + "api_op_CreateReceiptRuleSet.go", + "api_op_CreateTemplate.go", + "api_op_DeleteConfigurationSet.go", + "api_op_DeleteConfigurationSetEventDestination.go", + "api_op_DeleteConfigurationSetTrackingOptions.go", + "api_op_DeleteCustomVerificationEmailTemplate.go", + "api_op_DeleteIdentity.go", + "api_op_DeleteIdentityPolicy.go", + "api_op_DeleteReceiptFilter.go", + "api_op_DeleteReceiptRule.go", + "api_op_DeleteReceiptRuleSet.go", + "api_op_DeleteTemplate.go", + "api_op_DeleteVerifiedEmailAddress.go", + "api_op_DescribeActiveReceiptRuleSet.go", + "api_op_DescribeConfigurationSet.go", + "api_op_DescribeReceiptRule.go", + "api_op_DescribeReceiptRuleSet.go", + "api_op_GetAccountSendingEnabled.go", + "api_op_GetCustomVerificationEmailTemplate.go", + "api_op_GetIdentityDkimAttributes.go", + "api_op_GetIdentityMailFromDomainAttributes.go", + "api_op_GetIdentityNotificationAttributes.go", + "api_op_GetIdentityPolicies.go", + "api_op_GetIdentityVerificationAttributes.go", + "api_op_GetSendQuota.go", + "api_op_GetSendStatistics.go", + "api_op_GetTemplate.go", + "api_op_ListConfigurationSets.go", + "api_op_ListCustomVerificationEmailTemplates.go", + "api_op_ListIdentities.go", + "api_op_ListIdentityPolicies.go", + "api_op_ListReceiptFilters.go", + "api_op_ListReceiptRuleSets.go", + "api_op_ListTemplates.go", + "api_op_ListVerifiedEmailAddresses.go", + "api_op_PutConfigurationSetDeliveryOptions.go", + "api_op_PutIdentityPolicy.go", + "api_op_ReorderReceiptRuleSet.go", + "api_op_SendBounce.go", + "api_op_SendBulkTemplatedEmail.go", + "api_op_SendCustomVerificationEmail.go", + "api_op_SendEmail.go", + "api_op_SendRawEmail.go", + "api_op_SendTemplatedEmail.go", + "api_op_SetActiveReceiptRuleSet.go", + "api_op_SetIdentityDkimEnabled.go", + "api_op_SetIdentityFeedbackForwardingEnabled.go", + "api_op_SetIdentityHeadersInNotificationsEnabled.go", + "api_op_SetIdentityMailFromDomain.go", + "api_op_SetIdentityNotificationTopic.go", + "api_op_SetReceiptRulePosition.go", + "api_op_TestRenderTemplate.go", + "api_op_UpdateAccountSendingEnabled.go", + "api_op_UpdateConfigurationSetEventDestination.go", + "api_op_UpdateConfigurationSetReputationMetricsEnabled.go", + "api_op_UpdateConfigurationSetSendingEnabled.go", + "api_op_UpdateConfigurationSetTrackingOptions.go", + "api_op_UpdateCustomVerificationEmailTemplate.go", + "api_op_UpdateReceiptRule.go", + "api_op_UpdateTemplate.go", + "api_op_VerifyDomainDkim.go", + "api_op_VerifyDomainIdentity.go", + "api_op_VerifyEmailAddress.go", + "api_op_VerifyEmailIdentity.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/ses", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/go_module_metadata.go new file mode 100644 index 00000000..813e605b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package ses + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.22.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/internal/endpoints/endpoints.go new file mode 100644 index 00000000..1880cc41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/internal/endpoints/endpoints.go @@ -0,0 +1,477 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver SES endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "email.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "email-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "email.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.ca-central-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "fips-ca-central-1", + }: endpoints.Endpoint{ + Hostname: "email-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "email-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-2", + }: endpoints.Endpoint{ + Hostname: "email-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-1", + }: endpoints.Endpoint{ + Hostname: "email-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "email-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.us-east-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.us-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.us-west-2.amazonaws.com", + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "email.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "email-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "email.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "email.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "email.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "email.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "email.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "email.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "email-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "email.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "email-fips.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "email-fips.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.us-gov-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "email-fips.us-gov-west-1.amazonaws.com", + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/options.go new file mode 100644 index 00000000..a641f33d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/options.go @@ -0,0 +1,224 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/serializers.go new file mode 100644 index 00000000..486f6ba7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/serializers.go @@ -0,0 +1,6689 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/query" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsquery_serializeOpCloneReceiptRuleSet struct { +} + +func (*awsAwsquery_serializeOpCloneReceiptRuleSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCloneReceiptRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CloneReceiptRuleSetInput) + _ = 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("CloneReceiptRuleSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCloneReceiptRuleSetInput(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 awsAwsquery_serializeOpCreateConfigurationSet struct { +} + +func (*awsAwsquery_serializeOpCreateConfigurationSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateConfigurationSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateConfigurationSetInput) + _ = 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("CreateConfigurationSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateConfigurationSetInput(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 awsAwsquery_serializeOpCreateConfigurationSetEventDestination struct { +} + +func (*awsAwsquery_serializeOpCreateConfigurationSetEventDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateConfigurationSetEventDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateConfigurationSetEventDestinationInput) + _ = 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("CreateConfigurationSetEventDestination") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateConfigurationSetEventDestinationInput(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 awsAwsquery_serializeOpCreateConfigurationSetTrackingOptions struct { +} + +func (*awsAwsquery_serializeOpCreateConfigurationSetTrackingOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateConfigurationSetTrackingOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateConfigurationSetTrackingOptionsInput) + _ = 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("CreateConfigurationSetTrackingOptions") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateConfigurationSetTrackingOptionsInput(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 awsAwsquery_serializeOpCreateCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_serializeOpCreateCustomVerificationEmailTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateCustomVerificationEmailTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateCustomVerificationEmailTemplateInput) + _ = 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("CreateCustomVerificationEmailTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateCustomVerificationEmailTemplateInput(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 awsAwsquery_serializeOpCreateReceiptFilter struct { +} + +func (*awsAwsquery_serializeOpCreateReceiptFilter) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateReceiptFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateReceiptFilterInput) + _ = 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("CreateReceiptFilter") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateReceiptFilterInput(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 awsAwsquery_serializeOpCreateReceiptRule struct { +} + +func (*awsAwsquery_serializeOpCreateReceiptRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateReceiptRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateReceiptRuleInput) + _ = 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("CreateReceiptRule") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateReceiptRuleInput(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 awsAwsquery_serializeOpCreateReceiptRuleSet struct { +} + +func (*awsAwsquery_serializeOpCreateReceiptRuleSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateReceiptRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateReceiptRuleSetInput) + _ = 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("CreateReceiptRuleSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateReceiptRuleSetInput(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 awsAwsquery_serializeOpCreateTemplate struct { +} + +func (*awsAwsquery_serializeOpCreateTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTemplateInput) + _ = 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("CreateTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateTemplateInput(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 awsAwsquery_serializeOpDeleteConfigurationSet struct { +} + +func (*awsAwsquery_serializeOpDeleteConfigurationSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteConfigurationSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteConfigurationSetInput) + _ = 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("DeleteConfigurationSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteConfigurationSetInput(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 awsAwsquery_serializeOpDeleteConfigurationSetEventDestination struct { +} + +func (*awsAwsquery_serializeOpDeleteConfigurationSetEventDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteConfigurationSetEventDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteConfigurationSetEventDestinationInput) + _ = 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("DeleteConfigurationSetEventDestination") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteConfigurationSetEventDestinationInput(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 awsAwsquery_serializeOpDeleteConfigurationSetTrackingOptions struct { +} + +func (*awsAwsquery_serializeOpDeleteConfigurationSetTrackingOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteConfigurationSetTrackingOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteConfigurationSetTrackingOptionsInput) + _ = 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("DeleteConfigurationSetTrackingOptions") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteConfigurationSetTrackingOptionsInput(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 awsAwsquery_serializeOpDeleteCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_serializeOpDeleteCustomVerificationEmailTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteCustomVerificationEmailTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteCustomVerificationEmailTemplateInput) + _ = 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("DeleteCustomVerificationEmailTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteCustomVerificationEmailTemplateInput(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 awsAwsquery_serializeOpDeleteIdentity struct { +} + +func (*awsAwsquery_serializeOpDeleteIdentity) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteIdentityInput) + _ = 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("DeleteIdentity") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteIdentityInput(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 awsAwsquery_serializeOpDeleteIdentityPolicy struct { +} + +func (*awsAwsquery_serializeOpDeleteIdentityPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteIdentityPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteIdentityPolicyInput) + _ = 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("DeleteIdentityPolicy") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteIdentityPolicyInput(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 awsAwsquery_serializeOpDeleteReceiptFilter struct { +} + +func (*awsAwsquery_serializeOpDeleteReceiptFilter) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteReceiptFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteReceiptFilterInput) + _ = 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("DeleteReceiptFilter") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteReceiptFilterInput(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 awsAwsquery_serializeOpDeleteReceiptRule struct { +} + +func (*awsAwsquery_serializeOpDeleteReceiptRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteReceiptRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteReceiptRuleInput) + _ = 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("DeleteReceiptRule") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteReceiptRuleInput(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 awsAwsquery_serializeOpDeleteReceiptRuleSet struct { +} + +func (*awsAwsquery_serializeOpDeleteReceiptRuleSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteReceiptRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteReceiptRuleSetInput) + _ = 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("DeleteReceiptRuleSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteReceiptRuleSetInput(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 awsAwsquery_serializeOpDeleteTemplate struct { +} + +func (*awsAwsquery_serializeOpDeleteTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteTemplateInput) + _ = 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("DeleteTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteTemplateInput(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 awsAwsquery_serializeOpDeleteVerifiedEmailAddress struct { +} + +func (*awsAwsquery_serializeOpDeleteVerifiedEmailAddress) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteVerifiedEmailAddress) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVerifiedEmailAddressInput) + _ = 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("DeleteVerifiedEmailAddress") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteVerifiedEmailAddressInput(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 awsAwsquery_serializeOpDescribeActiveReceiptRuleSet struct { +} + +func (*awsAwsquery_serializeOpDescribeActiveReceiptRuleSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeActiveReceiptRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeActiveReceiptRuleSetInput) + _ = 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("DescribeActiveReceiptRuleSet") + body.Key("Version").String("2010-12-01") + + 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 awsAwsquery_serializeOpDescribeConfigurationSet struct { +} + +func (*awsAwsquery_serializeOpDescribeConfigurationSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeConfigurationSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeConfigurationSetInput) + _ = 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("DescribeConfigurationSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDescribeConfigurationSetInput(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 awsAwsquery_serializeOpDescribeReceiptRule struct { +} + +func (*awsAwsquery_serializeOpDescribeReceiptRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeReceiptRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeReceiptRuleInput) + _ = 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("DescribeReceiptRule") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDescribeReceiptRuleInput(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 awsAwsquery_serializeOpDescribeReceiptRuleSet struct { +} + +func (*awsAwsquery_serializeOpDescribeReceiptRuleSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeReceiptRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeReceiptRuleSetInput) + _ = 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("DescribeReceiptRuleSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentDescribeReceiptRuleSetInput(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 awsAwsquery_serializeOpGetAccountSendingEnabled struct { +} + +func (*awsAwsquery_serializeOpGetAccountSendingEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetAccountSendingEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAccountSendingEnabledInput) + _ = 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("GetAccountSendingEnabled") + body.Key("Version").String("2010-12-01") + + 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 awsAwsquery_serializeOpGetCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_serializeOpGetCustomVerificationEmailTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetCustomVerificationEmailTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCustomVerificationEmailTemplateInput) + _ = 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("GetCustomVerificationEmailTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentGetCustomVerificationEmailTemplateInput(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 awsAwsquery_serializeOpGetIdentityDkimAttributes struct { +} + +func (*awsAwsquery_serializeOpGetIdentityDkimAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetIdentityDkimAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIdentityDkimAttributesInput) + _ = 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("GetIdentityDkimAttributes") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentGetIdentityDkimAttributesInput(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 awsAwsquery_serializeOpGetIdentityMailFromDomainAttributes struct { +} + +func (*awsAwsquery_serializeOpGetIdentityMailFromDomainAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetIdentityMailFromDomainAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIdentityMailFromDomainAttributesInput) + _ = 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("GetIdentityMailFromDomainAttributes") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentGetIdentityMailFromDomainAttributesInput(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 awsAwsquery_serializeOpGetIdentityNotificationAttributes struct { +} + +func (*awsAwsquery_serializeOpGetIdentityNotificationAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetIdentityNotificationAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIdentityNotificationAttributesInput) + _ = 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("GetIdentityNotificationAttributes") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentGetIdentityNotificationAttributesInput(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 awsAwsquery_serializeOpGetIdentityPolicies struct { +} + +func (*awsAwsquery_serializeOpGetIdentityPolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetIdentityPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIdentityPoliciesInput) + _ = 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("GetIdentityPolicies") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentGetIdentityPoliciesInput(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 awsAwsquery_serializeOpGetIdentityVerificationAttributes struct { +} + +func (*awsAwsquery_serializeOpGetIdentityVerificationAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetIdentityVerificationAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIdentityVerificationAttributesInput) + _ = 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("GetIdentityVerificationAttributes") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentGetIdentityVerificationAttributesInput(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 awsAwsquery_serializeOpGetSendQuota struct { +} + +func (*awsAwsquery_serializeOpGetSendQuota) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetSendQuota) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSendQuotaInput) + _ = 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("GetSendQuota") + body.Key("Version").String("2010-12-01") + + 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 awsAwsquery_serializeOpGetSendStatistics struct { +} + +func (*awsAwsquery_serializeOpGetSendStatistics) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetSendStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSendStatisticsInput) + _ = 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("GetSendStatistics") + body.Key("Version").String("2010-12-01") + + 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 awsAwsquery_serializeOpGetTemplate struct { +} + +func (*awsAwsquery_serializeOpGetTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTemplateInput) + _ = 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("GetTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentGetTemplateInput(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 awsAwsquery_serializeOpListConfigurationSets struct { +} + +func (*awsAwsquery_serializeOpListConfigurationSets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListConfigurationSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListConfigurationSetsInput) + _ = 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("ListConfigurationSets") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentListConfigurationSetsInput(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 awsAwsquery_serializeOpListCustomVerificationEmailTemplates struct { +} + +func (*awsAwsquery_serializeOpListCustomVerificationEmailTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListCustomVerificationEmailTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCustomVerificationEmailTemplatesInput) + _ = 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("ListCustomVerificationEmailTemplates") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentListCustomVerificationEmailTemplatesInput(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 awsAwsquery_serializeOpListIdentities struct { +} + +func (*awsAwsquery_serializeOpListIdentities) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListIdentities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListIdentitiesInput) + _ = 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("ListIdentities") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentListIdentitiesInput(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 awsAwsquery_serializeOpListIdentityPolicies struct { +} + +func (*awsAwsquery_serializeOpListIdentityPolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListIdentityPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListIdentityPoliciesInput) + _ = 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("ListIdentityPolicies") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentListIdentityPoliciesInput(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 awsAwsquery_serializeOpListReceiptFilters struct { +} + +func (*awsAwsquery_serializeOpListReceiptFilters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListReceiptFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListReceiptFiltersInput) + _ = 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("ListReceiptFilters") + body.Key("Version").String("2010-12-01") + + 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 awsAwsquery_serializeOpListReceiptRuleSets struct { +} + +func (*awsAwsquery_serializeOpListReceiptRuleSets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListReceiptRuleSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListReceiptRuleSetsInput) + _ = 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("ListReceiptRuleSets") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentListReceiptRuleSetsInput(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 awsAwsquery_serializeOpListTemplates struct { +} + +func (*awsAwsquery_serializeOpListTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTemplatesInput) + _ = 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("ListTemplates") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentListTemplatesInput(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 awsAwsquery_serializeOpListVerifiedEmailAddresses struct { +} + +func (*awsAwsquery_serializeOpListVerifiedEmailAddresses) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListVerifiedEmailAddresses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListVerifiedEmailAddressesInput) + _ = 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("ListVerifiedEmailAddresses") + body.Key("Version").String("2010-12-01") + + 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 awsAwsquery_serializeOpPutConfigurationSetDeliveryOptions struct { +} + +func (*awsAwsquery_serializeOpPutConfigurationSetDeliveryOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpPutConfigurationSetDeliveryOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutConfigurationSetDeliveryOptionsInput) + _ = 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("PutConfigurationSetDeliveryOptions") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentPutConfigurationSetDeliveryOptionsInput(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 awsAwsquery_serializeOpPutIdentityPolicy struct { +} + +func (*awsAwsquery_serializeOpPutIdentityPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpPutIdentityPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutIdentityPolicyInput) + _ = 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("PutIdentityPolicy") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentPutIdentityPolicyInput(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 awsAwsquery_serializeOpReorderReceiptRuleSet struct { +} + +func (*awsAwsquery_serializeOpReorderReceiptRuleSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpReorderReceiptRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ReorderReceiptRuleSetInput) + _ = 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("ReorderReceiptRuleSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentReorderReceiptRuleSetInput(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 awsAwsquery_serializeOpSendBounce struct { +} + +func (*awsAwsquery_serializeOpSendBounce) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSendBounce) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendBounceInput) + _ = 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("SendBounce") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSendBounceInput(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 awsAwsquery_serializeOpSendBulkTemplatedEmail struct { +} + +func (*awsAwsquery_serializeOpSendBulkTemplatedEmail) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSendBulkTemplatedEmail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendBulkTemplatedEmailInput) + _ = 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("SendBulkTemplatedEmail") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSendBulkTemplatedEmailInput(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 awsAwsquery_serializeOpSendCustomVerificationEmail struct { +} + +func (*awsAwsquery_serializeOpSendCustomVerificationEmail) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSendCustomVerificationEmail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendCustomVerificationEmailInput) + _ = 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("SendCustomVerificationEmail") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSendCustomVerificationEmailInput(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 awsAwsquery_serializeOpSendEmail struct { +} + +func (*awsAwsquery_serializeOpSendEmail) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSendEmail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendEmailInput) + _ = 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("SendEmail") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSendEmailInput(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 awsAwsquery_serializeOpSendRawEmail struct { +} + +func (*awsAwsquery_serializeOpSendRawEmail) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSendRawEmail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendRawEmailInput) + _ = 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("SendRawEmail") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSendRawEmailInput(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 awsAwsquery_serializeOpSendTemplatedEmail struct { +} + +func (*awsAwsquery_serializeOpSendTemplatedEmail) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSendTemplatedEmail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendTemplatedEmailInput) + _ = 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("SendTemplatedEmail") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSendTemplatedEmailInput(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 awsAwsquery_serializeOpSetActiveReceiptRuleSet struct { +} + +func (*awsAwsquery_serializeOpSetActiveReceiptRuleSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetActiveReceiptRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetActiveReceiptRuleSetInput) + _ = 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("SetActiveReceiptRuleSet") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSetActiveReceiptRuleSetInput(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 awsAwsquery_serializeOpSetIdentityDkimEnabled struct { +} + +func (*awsAwsquery_serializeOpSetIdentityDkimEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetIdentityDkimEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetIdentityDkimEnabledInput) + _ = 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("SetIdentityDkimEnabled") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSetIdentityDkimEnabledInput(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 awsAwsquery_serializeOpSetIdentityFeedbackForwardingEnabled struct { +} + +func (*awsAwsquery_serializeOpSetIdentityFeedbackForwardingEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetIdentityFeedbackForwardingEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetIdentityFeedbackForwardingEnabledInput) + _ = 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("SetIdentityFeedbackForwardingEnabled") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSetIdentityFeedbackForwardingEnabledInput(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 awsAwsquery_serializeOpSetIdentityHeadersInNotificationsEnabled struct { +} + +func (*awsAwsquery_serializeOpSetIdentityHeadersInNotificationsEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetIdentityHeadersInNotificationsEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetIdentityHeadersInNotificationsEnabledInput) + _ = 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("SetIdentityHeadersInNotificationsEnabled") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSetIdentityHeadersInNotificationsEnabledInput(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 awsAwsquery_serializeOpSetIdentityMailFromDomain struct { +} + +func (*awsAwsquery_serializeOpSetIdentityMailFromDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetIdentityMailFromDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetIdentityMailFromDomainInput) + _ = 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("SetIdentityMailFromDomain") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSetIdentityMailFromDomainInput(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 awsAwsquery_serializeOpSetIdentityNotificationTopic struct { +} + +func (*awsAwsquery_serializeOpSetIdentityNotificationTopic) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetIdentityNotificationTopic) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetIdentityNotificationTopicInput) + _ = 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("SetIdentityNotificationTopic") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSetIdentityNotificationTopicInput(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 awsAwsquery_serializeOpSetReceiptRulePosition struct { +} + +func (*awsAwsquery_serializeOpSetReceiptRulePosition) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetReceiptRulePosition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetReceiptRulePositionInput) + _ = 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("SetReceiptRulePosition") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentSetReceiptRulePositionInput(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 awsAwsquery_serializeOpTestRenderTemplate struct { +} + +func (*awsAwsquery_serializeOpTestRenderTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpTestRenderTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TestRenderTemplateInput) + _ = 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("TestRenderTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentTestRenderTemplateInput(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 awsAwsquery_serializeOpUpdateAccountSendingEnabled struct { +} + +func (*awsAwsquery_serializeOpUpdateAccountSendingEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateAccountSendingEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAccountSendingEnabledInput) + _ = 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("UpdateAccountSendingEnabled") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateAccountSendingEnabledInput(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 awsAwsquery_serializeOpUpdateConfigurationSetEventDestination struct { +} + +func (*awsAwsquery_serializeOpUpdateConfigurationSetEventDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateConfigurationSetEventDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateConfigurationSetEventDestinationInput) + _ = 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("UpdateConfigurationSetEventDestination") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateConfigurationSetEventDestinationInput(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 awsAwsquery_serializeOpUpdateConfigurationSetReputationMetricsEnabled struct { +} + +func (*awsAwsquery_serializeOpUpdateConfigurationSetReputationMetricsEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateConfigurationSetReputationMetricsEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateConfigurationSetReputationMetricsEnabledInput) + _ = 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("UpdateConfigurationSetReputationMetricsEnabled") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateConfigurationSetReputationMetricsEnabledInput(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 awsAwsquery_serializeOpUpdateConfigurationSetSendingEnabled struct { +} + +func (*awsAwsquery_serializeOpUpdateConfigurationSetSendingEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateConfigurationSetSendingEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateConfigurationSetSendingEnabledInput) + _ = 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("UpdateConfigurationSetSendingEnabled") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateConfigurationSetSendingEnabledInput(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 awsAwsquery_serializeOpUpdateConfigurationSetTrackingOptions struct { +} + +func (*awsAwsquery_serializeOpUpdateConfigurationSetTrackingOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateConfigurationSetTrackingOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateConfigurationSetTrackingOptionsInput) + _ = 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("UpdateConfigurationSetTrackingOptions") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateConfigurationSetTrackingOptionsInput(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 awsAwsquery_serializeOpUpdateCustomVerificationEmailTemplate struct { +} + +func (*awsAwsquery_serializeOpUpdateCustomVerificationEmailTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateCustomVerificationEmailTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateCustomVerificationEmailTemplateInput) + _ = 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("UpdateCustomVerificationEmailTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateCustomVerificationEmailTemplateInput(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 awsAwsquery_serializeOpUpdateReceiptRule struct { +} + +func (*awsAwsquery_serializeOpUpdateReceiptRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateReceiptRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateReceiptRuleInput) + _ = 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("UpdateReceiptRule") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateReceiptRuleInput(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 awsAwsquery_serializeOpUpdateTemplate struct { +} + +func (*awsAwsquery_serializeOpUpdateTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpUpdateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateTemplateInput) + _ = 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("UpdateTemplate") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentUpdateTemplateInput(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 awsAwsquery_serializeOpVerifyDomainDkim struct { +} + +func (*awsAwsquery_serializeOpVerifyDomainDkim) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpVerifyDomainDkim) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*VerifyDomainDkimInput) + _ = 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("VerifyDomainDkim") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentVerifyDomainDkimInput(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 awsAwsquery_serializeOpVerifyDomainIdentity struct { +} + +func (*awsAwsquery_serializeOpVerifyDomainIdentity) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpVerifyDomainIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*VerifyDomainIdentityInput) + _ = 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("VerifyDomainIdentity") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentVerifyDomainIdentityInput(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 awsAwsquery_serializeOpVerifyEmailAddress struct { +} + +func (*awsAwsquery_serializeOpVerifyEmailAddress) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpVerifyEmailAddress) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*VerifyEmailAddressInput) + _ = 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("VerifyEmailAddress") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentVerifyEmailAddressInput(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 awsAwsquery_serializeOpVerifyEmailIdentity struct { +} + +func (*awsAwsquery_serializeOpVerifyEmailIdentity) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpVerifyEmailIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*VerifyEmailIdentityInput) + _ = 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("VerifyEmailIdentity") + body.Key("Version").String("2010-12-01") + + if err := awsAwsquery_serializeOpDocumentVerifyEmailIdentityInput(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) +} +func awsAwsquery_serializeDocumentAddHeaderAction(v *types.AddHeaderAction, value query.Value) error { + object := value.Object() + _ = object + + if v.HeaderName != nil { + objectKey := object.Key("HeaderName") + objectKey.String(*v.HeaderName) + } + + if v.HeaderValue != nil { + objectKey := object.Key("HeaderValue") + objectKey.String(*v.HeaderValue) + } + + return nil +} + +func awsAwsquery_serializeDocumentAddressList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentBody(v *types.Body, value query.Value) error { + object := value.Object() + _ = object + + if v.Html != nil { + objectKey := object.Key("Html") + if err := awsAwsquery_serializeDocumentContent(v.Html, objectKey); err != nil { + return err + } + } + + if v.Text != nil { + objectKey := object.Key("Text") + if err := awsAwsquery_serializeDocumentContent(v.Text, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentBounceAction(v *types.BounceAction, value query.Value) error { + object := value.Object() + _ = object + + if v.Message != nil { + objectKey := object.Key("Message") + objectKey.String(*v.Message) + } + + if v.Sender != nil { + objectKey := object.Key("Sender") + objectKey.String(*v.Sender) + } + + if v.SmtpReplyCode != nil { + objectKey := object.Key("SmtpReplyCode") + objectKey.String(*v.SmtpReplyCode) + } + + if v.StatusCode != nil { + objectKey := object.Key("StatusCode") + objectKey.String(*v.StatusCode) + } + + if v.TopicArn != nil { + objectKey := object.Key("TopicArn") + objectKey.String(*v.TopicArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentBouncedRecipientInfo(v *types.BouncedRecipientInfo, value query.Value) error { + object := value.Object() + _ = object + + if len(v.BounceType) > 0 { + objectKey := object.Key("BounceType") + objectKey.String(string(v.BounceType)) + } + + if v.Recipient != nil { + objectKey := object.Key("Recipient") + objectKey.String(*v.Recipient) + } + + if v.RecipientArn != nil { + objectKey := object.Key("RecipientArn") + objectKey.String(*v.RecipientArn) + } + + if v.RecipientDsnFields != nil { + objectKey := object.Key("RecipientDsnFields") + if err := awsAwsquery_serializeDocumentRecipientDsnFields(v.RecipientDsnFields, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentBouncedRecipientInfoList(v []types.BouncedRecipientInfo, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentBouncedRecipientInfo(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentBulkEmailDestination(v *types.BulkEmailDestination, value query.Value) error { + object := value.Object() + _ = object + + if v.Destination != nil { + objectKey := object.Key("Destination") + if err := awsAwsquery_serializeDocumentDestination(v.Destination, objectKey); err != nil { + return err + } + } + + if v.ReplacementTags != nil { + objectKey := object.Key("ReplacementTags") + if err := awsAwsquery_serializeDocumentMessageTagList(v.ReplacementTags, objectKey); err != nil { + return err + } + } + + if v.ReplacementTemplateData != nil { + objectKey := object.Key("ReplacementTemplateData") + objectKey.String(*v.ReplacementTemplateData) + } + + return nil +} + +func awsAwsquery_serializeDocumentBulkEmailDestinationList(v []types.BulkEmailDestination, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentBulkEmailDestination(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentCloudWatchDestination(v *types.CloudWatchDestination, value query.Value) error { + object := value.Object() + _ = object + + if v.DimensionConfigurations != nil { + objectKey := object.Key("DimensionConfigurations") + if err := awsAwsquery_serializeDocumentCloudWatchDimensionConfigurations(v.DimensionConfigurations, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentCloudWatchDimensionConfiguration(v *types.CloudWatchDimensionConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.DefaultDimensionValue != nil { + objectKey := object.Key("DefaultDimensionValue") + objectKey.String(*v.DefaultDimensionValue) + } + + if v.DimensionName != nil { + objectKey := object.Key("DimensionName") + objectKey.String(*v.DimensionName) + } + + if len(v.DimensionValueSource) > 0 { + objectKey := object.Key("DimensionValueSource") + objectKey.String(string(v.DimensionValueSource)) + } + + return nil +} + +func awsAwsquery_serializeDocumentCloudWatchDimensionConfigurations(v []types.CloudWatchDimensionConfiguration, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentCloudWatchDimensionConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentConfigurationSet(v *types.ConfigurationSet, value query.Value) error { + object := value.Object() + _ = object + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + return nil +} + +func awsAwsquery_serializeDocumentConfigurationSetAttributeList(v []types.ConfigurationSetAttribute, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsquery_serializeDocumentContent(v *types.Content, value query.Value) error { + object := value.Object() + _ = object + + if v.Charset != nil { + objectKey := object.Key("Charset") + objectKey.String(*v.Charset) + } + + if v.Data != nil { + objectKey := object.Key("Data") + objectKey.String(*v.Data) + } + + return nil +} + +func awsAwsquery_serializeDocumentDeliveryOptions(v *types.DeliveryOptions, value query.Value) error { + object := value.Object() + _ = object + + if len(v.TlsPolicy) > 0 { + objectKey := object.Key("TlsPolicy") + objectKey.String(string(v.TlsPolicy)) + } + + return nil +} + +func awsAwsquery_serializeDocumentDestination(v *types.Destination, value query.Value) error { + object := value.Object() + _ = object + + if v.BccAddresses != nil { + objectKey := object.Key("BccAddresses") + if err := awsAwsquery_serializeDocumentAddressList(v.BccAddresses, objectKey); err != nil { + return err + } + } + + if v.CcAddresses != nil { + objectKey := object.Key("CcAddresses") + if err := awsAwsquery_serializeDocumentAddressList(v.CcAddresses, objectKey); err != nil { + return err + } + } + + if v.ToAddresses != nil { + objectKey := object.Key("ToAddresses") + if err := awsAwsquery_serializeDocumentAddressList(v.ToAddresses, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentEventDestination(v *types.EventDestination, value query.Value) error { + object := value.Object() + _ = object + + if v.CloudWatchDestination != nil { + objectKey := object.Key("CloudWatchDestination") + if err := awsAwsquery_serializeDocumentCloudWatchDestination(v.CloudWatchDestination, objectKey); err != nil { + return err + } + } + + if v.Enabled { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + if v.KinesisFirehoseDestination != nil { + objectKey := object.Key("KinesisFirehoseDestination") + if err := awsAwsquery_serializeDocumentKinesisFirehoseDestination(v.KinesisFirehoseDestination, objectKey); err != nil { + return err + } + } + + if v.MatchingEventTypes != nil { + objectKey := object.Key("MatchingEventTypes") + if err := awsAwsquery_serializeDocumentEventTypes(v.MatchingEventTypes, objectKey); err != nil { + return err + } + } + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.SNSDestination != nil { + objectKey := object.Key("SNSDestination") + if err := awsAwsquery_serializeDocumentSNSDestination(v.SNSDestination, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentEventTypes(v []types.EventType, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsquery_serializeDocumentExtensionField(v *types.ExtensionField, value query.Value) error { + object := value.Object() + _ = object + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentExtensionFieldList(v []types.ExtensionField, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentExtensionField(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentIdentityList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentKinesisFirehoseDestination(v *types.KinesisFirehoseDestination, value query.Value) error { + object := value.Object() + _ = object + + if v.DeliveryStreamARN != nil { + objectKey := object.Key("DeliveryStreamARN") + objectKey.String(*v.DeliveryStreamARN) + } + + if v.IAMRoleARN != nil { + objectKey := object.Key("IAMRoleARN") + objectKey.String(*v.IAMRoleARN) + } + + return nil +} + +func awsAwsquery_serializeDocumentLambdaAction(v *types.LambdaAction, value query.Value) error { + object := value.Object() + _ = object + + if v.FunctionArn != nil { + objectKey := object.Key("FunctionArn") + objectKey.String(*v.FunctionArn) + } + + if len(v.InvocationType) > 0 { + objectKey := object.Key("InvocationType") + objectKey.String(string(v.InvocationType)) + } + + if v.TopicArn != nil { + objectKey := object.Key("TopicArn") + objectKey.String(*v.TopicArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentMessage(v *types.Message, value query.Value) error { + object := value.Object() + _ = object + + if v.Body != nil { + objectKey := object.Key("Body") + if err := awsAwsquery_serializeDocumentBody(v.Body, objectKey); err != nil { + return err + } + } + + if v.Subject != nil { + objectKey := object.Key("Subject") + if err := awsAwsquery_serializeDocumentContent(v.Subject, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentMessageDsn(v *types.MessageDsn, value query.Value) error { + object := value.Object() + _ = object + + if v.ArrivalDate != nil { + objectKey := object.Key("ArrivalDate") + objectKey.String(smithytime.FormatDateTime(*v.ArrivalDate)) + } + + if v.ExtensionFields != nil { + objectKey := object.Key("ExtensionFields") + if err := awsAwsquery_serializeDocumentExtensionFieldList(v.ExtensionFields, objectKey); err != nil { + return err + } + } + + if v.ReportingMta != nil { + objectKey := object.Key("ReportingMta") + objectKey.String(*v.ReportingMta) + } + + return nil +} + +func awsAwsquery_serializeDocumentMessageTag(v *types.MessageTag, value query.Value) error { + object := value.Object() + _ = object + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentMessageTagList(v []types.MessageTag, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentMessageTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentPolicyNameList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentRawMessage(v *types.RawMessage, value query.Value) error { + object := value.Object() + _ = object + + if v.Data != nil { + objectKey := object.Key("Data") + objectKey.Base64EncodeBytes(v.Data) + } + + return nil +} + +func awsAwsquery_serializeDocumentReceiptAction(v *types.ReceiptAction, value query.Value) error { + object := value.Object() + _ = object + + if v.AddHeaderAction != nil { + objectKey := object.Key("AddHeaderAction") + if err := awsAwsquery_serializeDocumentAddHeaderAction(v.AddHeaderAction, objectKey); err != nil { + return err + } + } + + if v.BounceAction != nil { + objectKey := object.Key("BounceAction") + if err := awsAwsquery_serializeDocumentBounceAction(v.BounceAction, objectKey); err != nil { + return err + } + } + + if v.LambdaAction != nil { + objectKey := object.Key("LambdaAction") + if err := awsAwsquery_serializeDocumentLambdaAction(v.LambdaAction, objectKey); err != nil { + return err + } + } + + if v.S3Action != nil { + objectKey := object.Key("S3Action") + if err := awsAwsquery_serializeDocumentS3Action(v.S3Action, objectKey); err != nil { + return err + } + } + + if v.SNSAction != nil { + objectKey := object.Key("SNSAction") + if err := awsAwsquery_serializeDocumentSNSAction(v.SNSAction, objectKey); err != nil { + return err + } + } + + if v.StopAction != nil { + objectKey := object.Key("StopAction") + if err := awsAwsquery_serializeDocumentStopAction(v.StopAction, objectKey); err != nil { + return err + } + } + + if v.WorkmailAction != nil { + objectKey := object.Key("WorkmailAction") + if err := awsAwsquery_serializeDocumentWorkmailAction(v.WorkmailAction, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentReceiptActionsList(v []types.ReceiptAction, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentReceiptAction(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentReceiptFilter(v *types.ReceiptFilter, value query.Value) error { + object := value.Object() + _ = object + + if v.IpFilter != nil { + objectKey := object.Key("IpFilter") + if err := awsAwsquery_serializeDocumentReceiptIpFilter(v.IpFilter, objectKey); err != nil { + return err + } + } + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + return nil +} + +func awsAwsquery_serializeDocumentReceiptIpFilter(v *types.ReceiptIpFilter, value query.Value) error { + object := value.Object() + _ = object + + if v.Cidr != nil { + objectKey := object.Key("Cidr") + objectKey.String(*v.Cidr) + } + + if len(v.Policy) > 0 { + objectKey := object.Key("Policy") + objectKey.String(string(v.Policy)) + } + + return nil +} + +func awsAwsquery_serializeDocumentReceiptRule(v *types.ReceiptRule, value query.Value) error { + object := value.Object() + _ = object + + if v.Actions != nil { + objectKey := object.Key("Actions") + if err := awsAwsquery_serializeDocumentReceiptActionsList(v.Actions, objectKey); err != nil { + return err + } + } + + if v.Enabled { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Recipients != nil { + objectKey := object.Key("Recipients") + if err := awsAwsquery_serializeDocumentRecipientsList(v.Recipients, objectKey); err != nil { + return err + } + } + + if v.ScanEnabled { + objectKey := object.Key("ScanEnabled") + objectKey.Boolean(v.ScanEnabled) + } + + if len(v.TlsPolicy) > 0 { + objectKey := object.Key("TlsPolicy") + objectKey.String(string(v.TlsPolicy)) + } + + return nil +} + +func awsAwsquery_serializeDocumentReceiptRuleNamesList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentRecipientDsnFields(v *types.RecipientDsnFields, value query.Value) error { + object := value.Object() + _ = object + + if len(v.Action) > 0 { + objectKey := object.Key("Action") + objectKey.String(string(v.Action)) + } + + if v.DiagnosticCode != nil { + objectKey := object.Key("DiagnosticCode") + objectKey.String(*v.DiagnosticCode) + } + + if v.ExtensionFields != nil { + objectKey := object.Key("ExtensionFields") + if err := awsAwsquery_serializeDocumentExtensionFieldList(v.ExtensionFields, objectKey); err != nil { + return err + } + } + + if v.FinalRecipient != nil { + objectKey := object.Key("FinalRecipient") + objectKey.String(*v.FinalRecipient) + } + + if v.LastAttemptDate != nil { + objectKey := object.Key("LastAttemptDate") + objectKey.String(smithytime.FormatDateTime(*v.LastAttemptDate)) + } + + if v.RemoteMta != nil { + objectKey := object.Key("RemoteMta") + objectKey.String(*v.RemoteMta) + } + + if v.Status != nil { + objectKey := object.Key("Status") + objectKey.String(*v.Status) + } + + return nil +} + +func awsAwsquery_serializeDocumentRecipientsList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentS3Action(v *types.S3Action, value query.Value) error { + object := value.Object() + _ = object + + if v.BucketName != nil { + objectKey := object.Key("BucketName") + objectKey.String(*v.BucketName) + } + + if v.KmsKeyArn != nil { + objectKey := object.Key("KmsKeyArn") + objectKey.String(*v.KmsKeyArn) + } + + if v.ObjectKeyPrefix != nil { + objectKey := object.Key("ObjectKeyPrefix") + objectKey.String(*v.ObjectKeyPrefix) + } + + if v.TopicArn != nil { + objectKey := object.Key("TopicArn") + objectKey.String(*v.TopicArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentSNSAction(v *types.SNSAction, value query.Value) error { + object := value.Object() + _ = object + + if len(v.Encoding) > 0 { + objectKey := object.Key("Encoding") + objectKey.String(string(v.Encoding)) + } + + if v.TopicArn != nil { + objectKey := object.Key("TopicArn") + objectKey.String(*v.TopicArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentSNSDestination(v *types.SNSDestination, value query.Value) error { + object := value.Object() + _ = object + + if v.TopicARN != nil { + objectKey := object.Key("TopicARN") + objectKey.String(*v.TopicARN) + } + + return nil +} + +func awsAwsquery_serializeDocumentStopAction(v *types.StopAction, value query.Value) error { + object := value.Object() + _ = object + + if len(v.Scope) > 0 { + objectKey := object.Key("Scope") + objectKey.String(string(v.Scope)) + } + + if v.TopicArn != nil { + objectKey := object.Key("TopicArn") + objectKey.String(*v.TopicArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentTemplate(v *types.Template, value query.Value) error { + object := value.Object() + _ = object + + if v.HtmlPart != nil { + objectKey := object.Key("HtmlPart") + objectKey.String(*v.HtmlPart) + } + + if v.SubjectPart != nil { + objectKey := object.Key("SubjectPart") + objectKey.String(*v.SubjectPart) + } + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + if v.TextPart != nil { + objectKey := object.Key("TextPart") + objectKey.String(*v.TextPart) + } + + return nil +} + +func awsAwsquery_serializeDocumentTrackingOptions(v *types.TrackingOptions, value query.Value) error { + object := value.Object() + _ = object + + if v.CustomRedirectDomain != nil { + objectKey := object.Key("CustomRedirectDomain") + objectKey.String(*v.CustomRedirectDomain) + } + + return nil +} + +func awsAwsquery_serializeDocumentWorkmailAction(v *types.WorkmailAction, value query.Value) error { + object := value.Object() + _ = object + + if v.OrganizationArn != nil { + objectKey := object.Key("OrganizationArn") + objectKey.String(*v.OrganizationArn) + } + + if v.TopicArn != nil { + objectKey := object.Key("TopicArn") + objectKey.String(*v.TopicArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCloneReceiptRuleSetInput(v *CloneReceiptRuleSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.OriginalRuleSetName != nil { + objectKey := object.Key("OriginalRuleSetName") + objectKey.String(*v.OriginalRuleSetName) + } + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateConfigurationSetEventDestinationInput(v *CreateConfigurationSetEventDestinationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.EventDestination != nil { + objectKey := object.Key("EventDestination") + if err := awsAwsquery_serializeDocumentEventDestination(v.EventDestination, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateConfigurationSetInput(v *CreateConfigurationSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSet != nil { + objectKey := object.Key("ConfigurationSet") + if err := awsAwsquery_serializeDocumentConfigurationSet(v.ConfigurationSet, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateConfigurationSetTrackingOptionsInput(v *CreateConfigurationSetTrackingOptionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.TrackingOptions != nil { + objectKey := object.Key("TrackingOptions") + if err := awsAwsquery_serializeDocumentTrackingOptions(v.TrackingOptions, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateCustomVerificationEmailTemplateInput(v *CreateCustomVerificationEmailTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.FailureRedirectionURL != nil { + objectKey := object.Key("FailureRedirectionURL") + objectKey.String(*v.FailureRedirectionURL) + } + + if v.FromEmailAddress != nil { + objectKey := object.Key("FromEmailAddress") + objectKey.String(*v.FromEmailAddress) + } + + if v.SuccessRedirectionURL != nil { + objectKey := object.Key("SuccessRedirectionURL") + objectKey.String(*v.SuccessRedirectionURL) + } + + if v.TemplateContent != nil { + objectKey := object.Key("TemplateContent") + objectKey.String(*v.TemplateContent) + } + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + if v.TemplateSubject != nil { + objectKey := object.Key("TemplateSubject") + objectKey.String(*v.TemplateSubject) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateReceiptFilterInput(v *CreateReceiptFilterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filter != nil { + objectKey := object.Key("Filter") + if err := awsAwsquery_serializeDocumentReceiptFilter(v.Filter, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateReceiptRuleInput(v *CreateReceiptRuleInput, value query.Value) error { + object := value.Object() + _ = object + + if v.After != nil { + objectKey := object.Key("After") + objectKey.String(*v.After) + } + + if v.Rule != nil { + objectKey := object.Key("Rule") + if err := awsAwsquery_serializeDocumentReceiptRule(v.Rule, objectKey); err != nil { + return err + } + } + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateReceiptRuleSetInput(v *CreateReceiptRuleSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateTemplateInput(v *CreateTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Template != nil { + objectKey := object.Key("Template") + if err := awsAwsquery_serializeDocumentTemplate(v.Template, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteConfigurationSetEventDestinationInput(v *DeleteConfigurationSetEventDestinationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.EventDestinationName != nil { + objectKey := object.Key("EventDestinationName") + objectKey.String(*v.EventDestinationName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteConfigurationSetInput(v *DeleteConfigurationSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteConfigurationSetTrackingOptionsInput(v *DeleteConfigurationSetTrackingOptionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteCustomVerificationEmailTemplateInput(v *DeleteCustomVerificationEmailTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteIdentityInput(v *DeleteIdentityInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteIdentityPolicyInput(v *DeleteIdentityPolicyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + if v.PolicyName != nil { + objectKey := object.Key("PolicyName") + objectKey.String(*v.PolicyName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteReceiptFilterInput(v *DeleteReceiptFilterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.FilterName != nil { + objectKey := object.Key("FilterName") + objectKey.String(*v.FilterName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteReceiptRuleInput(v *DeleteReceiptRuleInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RuleName != nil { + objectKey := object.Key("RuleName") + objectKey.String(*v.RuleName) + } + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteReceiptRuleSetInput(v *DeleteReceiptRuleSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteTemplateInput(v *DeleteTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteVerifiedEmailAddressInput(v *DeleteVerifiedEmailAddressInput, value query.Value) error { + object := value.Object() + _ = object + + if v.EmailAddress != nil { + objectKey := object.Key("EmailAddress") + objectKey.String(*v.EmailAddress) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeActiveReceiptRuleSetInput(v *DescribeActiveReceiptRuleSetInput, value query.Value) error { + object := value.Object() + _ = object + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeConfigurationSetInput(v *DescribeConfigurationSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetAttributeNames != nil { + objectKey := object.Key("ConfigurationSetAttributeNames") + if err := awsAwsquery_serializeDocumentConfigurationSetAttributeList(v.ConfigurationSetAttributeNames, objectKey); err != nil { + return err + } + } + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeReceiptRuleInput(v *DescribeReceiptRuleInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RuleName != nil { + objectKey := object.Key("RuleName") + objectKey.String(*v.RuleName) + } + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeReceiptRuleSetInput(v *DescribeReceiptRuleSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetCustomVerificationEmailTemplateInput(v *GetCustomVerificationEmailTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetIdentityDkimAttributesInput(v *GetIdentityDkimAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identities != nil { + objectKey := object.Key("Identities") + if err := awsAwsquery_serializeDocumentIdentityList(v.Identities, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetIdentityMailFromDomainAttributesInput(v *GetIdentityMailFromDomainAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identities != nil { + objectKey := object.Key("Identities") + if err := awsAwsquery_serializeDocumentIdentityList(v.Identities, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetIdentityNotificationAttributesInput(v *GetIdentityNotificationAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identities != nil { + objectKey := object.Key("Identities") + if err := awsAwsquery_serializeDocumentIdentityList(v.Identities, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetIdentityPoliciesInput(v *GetIdentityPoliciesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + if v.PolicyNames != nil { + objectKey := object.Key("PolicyNames") + if err := awsAwsquery_serializeDocumentPolicyNameList(v.PolicyNames, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetIdentityVerificationAttributesInput(v *GetIdentityVerificationAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identities != nil { + objectKey := object.Key("Identities") + if err := awsAwsquery_serializeDocumentIdentityList(v.Identities, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetTemplateInput(v *GetTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentListConfigurationSetsInput(v *ListConfigurationSetsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.MaxItems != nil { + objectKey := object.Key("MaxItems") + objectKey.Integer(*v.MaxItems) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentListCustomVerificationEmailTemplatesInput(v *ListCustomVerificationEmailTemplatesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentListIdentitiesInput(v *ListIdentitiesInput, value query.Value) error { + object := value.Object() + _ = object + + if len(v.IdentityType) > 0 { + objectKey := object.Key("IdentityType") + objectKey.String(string(v.IdentityType)) + } + + if v.MaxItems != nil { + objectKey := object.Key("MaxItems") + objectKey.Integer(*v.MaxItems) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentListIdentityPoliciesInput(v *ListIdentityPoliciesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentListReceiptFiltersInput(v *ListReceiptFiltersInput, value query.Value) error { + object := value.Object() + _ = object + + return nil +} + +func awsAwsquery_serializeOpDocumentListReceiptRuleSetsInput(v *ListReceiptRuleSetsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentListTemplatesInput(v *ListTemplatesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.MaxItems != nil { + objectKey := object.Key("MaxItems") + objectKey.Integer(*v.MaxItems) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentPutConfigurationSetDeliveryOptionsInput(v *PutConfigurationSetDeliveryOptionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.DeliveryOptions != nil { + objectKey := object.Key("DeliveryOptions") + if err := awsAwsquery_serializeDocumentDeliveryOptions(v.DeliveryOptions, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentPutIdentityPolicyInput(v *PutIdentityPolicyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + if v.Policy != nil { + objectKey := object.Key("Policy") + objectKey.String(*v.Policy) + } + + if v.PolicyName != nil { + objectKey := object.Key("PolicyName") + objectKey.String(*v.PolicyName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentReorderReceiptRuleSetInput(v *ReorderReceiptRuleSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RuleNames != nil { + objectKey := object.Key("RuleNames") + if err := awsAwsquery_serializeDocumentReceiptRuleNamesList(v.RuleNames, objectKey); err != nil { + return err + } + } + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSendBounceInput(v *SendBounceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BouncedRecipientInfoList != nil { + objectKey := object.Key("BouncedRecipientInfoList") + if err := awsAwsquery_serializeDocumentBouncedRecipientInfoList(v.BouncedRecipientInfoList, objectKey); err != nil { + return err + } + } + + if v.BounceSender != nil { + objectKey := object.Key("BounceSender") + objectKey.String(*v.BounceSender) + } + + if v.BounceSenderArn != nil { + objectKey := object.Key("BounceSenderArn") + objectKey.String(*v.BounceSenderArn) + } + + if v.Explanation != nil { + objectKey := object.Key("Explanation") + objectKey.String(*v.Explanation) + } + + if v.MessageDsn != nil { + objectKey := object.Key("MessageDsn") + if err := awsAwsquery_serializeDocumentMessageDsn(v.MessageDsn, objectKey); err != nil { + return err + } + } + + if v.OriginalMessageId != nil { + objectKey := object.Key("OriginalMessageId") + objectKey.String(*v.OriginalMessageId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSendBulkTemplatedEmailInput(v *SendBulkTemplatedEmailInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.DefaultTags != nil { + objectKey := object.Key("DefaultTags") + if err := awsAwsquery_serializeDocumentMessageTagList(v.DefaultTags, objectKey); err != nil { + return err + } + } + + if v.DefaultTemplateData != nil { + objectKey := object.Key("DefaultTemplateData") + objectKey.String(*v.DefaultTemplateData) + } + + if v.Destinations != nil { + objectKey := object.Key("Destinations") + if err := awsAwsquery_serializeDocumentBulkEmailDestinationList(v.Destinations, objectKey); err != nil { + return err + } + } + + if v.ReplyToAddresses != nil { + objectKey := object.Key("ReplyToAddresses") + if err := awsAwsquery_serializeDocumentAddressList(v.ReplyToAddresses, objectKey); err != nil { + return err + } + } + + if v.ReturnPath != nil { + objectKey := object.Key("ReturnPath") + objectKey.String(*v.ReturnPath) + } + + if v.ReturnPathArn != nil { + objectKey := object.Key("ReturnPathArn") + objectKey.String(*v.ReturnPathArn) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + if v.SourceArn != nil { + objectKey := object.Key("SourceArn") + objectKey.String(*v.SourceArn) + } + + if v.Template != nil { + objectKey := object.Key("Template") + objectKey.String(*v.Template) + } + + if v.TemplateArn != nil { + objectKey := object.Key("TemplateArn") + objectKey.String(*v.TemplateArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSendCustomVerificationEmailInput(v *SendCustomVerificationEmailInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.EmailAddress != nil { + objectKey := object.Key("EmailAddress") + objectKey.String(*v.EmailAddress) + } + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSendEmailInput(v *SendEmailInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.Destination != nil { + objectKey := object.Key("Destination") + if err := awsAwsquery_serializeDocumentDestination(v.Destination, objectKey); err != nil { + return err + } + } + + if v.Message != nil { + objectKey := object.Key("Message") + if err := awsAwsquery_serializeDocumentMessage(v.Message, objectKey); err != nil { + return err + } + } + + if v.ReplyToAddresses != nil { + objectKey := object.Key("ReplyToAddresses") + if err := awsAwsquery_serializeDocumentAddressList(v.ReplyToAddresses, objectKey); err != nil { + return err + } + } + + if v.ReturnPath != nil { + objectKey := object.Key("ReturnPath") + objectKey.String(*v.ReturnPath) + } + + if v.ReturnPathArn != nil { + objectKey := object.Key("ReturnPathArn") + objectKey.String(*v.ReturnPathArn) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + if v.SourceArn != nil { + objectKey := object.Key("SourceArn") + objectKey.String(*v.SourceArn) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentMessageTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSendRawEmailInput(v *SendRawEmailInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.Destinations != nil { + objectKey := object.Key("Destinations") + if err := awsAwsquery_serializeDocumentAddressList(v.Destinations, objectKey); err != nil { + return err + } + } + + if v.FromArn != nil { + objectKey := object.Key("FromArn") + objectKey.String(*v.FromArn) + } + + if v.RawMessage != nil { + objectKey := object.Key("RawMessage") + if err := awsAwsquery_serializeDocumentRawMessage(v.RawMessage, objectKey); err != nil { + return err + } + } + + if v.ReturnPathArn != nil { + objectKey := object.Key("ReturnPathArn") + objectKey.String(*v.ReturnPathArn) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + if v.SourceArn != nil { + objectKey := object.Key("SourceArn") + objectKey.String(*v.SourceArn) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentMessageTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSendTemplatedEmailInput(v *SendTemplatedEmailInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.Destination != nil { + objectKey := object.Key("Destination") + if err := awsAwsquery_serializeDocumentDestination(v.Destination, objectKey); err != nil { + return err + } + } + + if v.ReplyToAddresses != nil { + objectKey := object.Key("ReplyToAddresses") + if err := awsAwsquery_serializeDocumentAddressList(v.ReplyToAddresses, objectKey); err != nil { + return err + } + } + + if v.ReturnPath != nil { + objectKey := object.Key("ReturnPath") + objectKey.String(*v.ReturnPath) + } + + if v.ReturnPathArn != nil { + objectKey := object.Key("ReturnPathArn") + objectKey.String(*v.ReturnPathArn) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + if v.SourceArn != nil { + objectKey := object.Key("SourceArn") + objectKey.String(*v.SourceArn) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentMessageTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.Template != nil { + objectKey := object.Key("Template") + objectKey.String(*v.Template) + } + + if v.TemplateArn != nil { + objectKey := object.Key("TemplateArn") + objectKey.String(*v.TemplateArn) + } + + if v.TemplateData != nil { + objectKey := object.Key("TemplateData") + objectKey.String(*v.TemplateData) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetActiveReceiptRuleSetInput(v *SetActiveReceiptRuleSetInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetIdentityDkimEnabledInput(v *SetIdentityDkimEnabledInput, value query.Value) error { + object := value.Object() + _ = object + + { + objectKey := object.Key("DkimEnabled") + objectKey.Boolean(v.DkimEnabled) + } + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetIdentityFeedbackForwardingEnabledInput(v *SetIdentityFeedbackForwardingEnabledInput, value query.Value) error { + object := value.Object() + _ = object + + { + objectKey := object.Key("ForwardingEnabled") + objectKey.Boolean(v.ForwardingEnabled) + } + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetIdentityHeadersInNotificationsEnabledInput(v *SetIdentityHeadersInNotificationsEnabledInput, value query.Value) error { + object := value.Object() + _ = object + + { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + if len(v.NotificationType) > 0 { + objectKey := object.Key("NotificationType") + objectKey.String(string(v.NotificationType)) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetIdentityMailFromDomainInput(v *SetIdentityMailFromDomainInput, value query.Value) error { + object := value.Object() + _ = object + + if len(v.BehaviorOnMXFailure) > 0 { + objectKey := object.Key("BehaviorOnMXFailure") + objectKey.String(string(v.BehaviorOnMXFailure)) + } + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + if v.MailFromDomain != nil { + objectKey := object.Key("MailFromDomain") + objectKey.String(*v.MailFromDomain) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetIdentityNotificationTopicInput(v *SetIdentityNotificationTopicInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Identity != nil { + objectKey := object.Key("Identity") + objectKey.String(*v.Identity) + } + + if len(v.NotificationType) > 0 { + objectKey := object.Key("NotificationType") + objectKey.String(string(v.NotificationType)) + } + + if v.SnsTopic != nil { + objectKey := object.Key("SnsTopic") + objectKey.String(*v.SnsTopic) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetReceiptRulePositionInput(v *SetReceiptRulePositionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.After != nil { + objectKey := object.Key("After") + objectKey.String(*v.After) + } + + if v.RuleName != nil { + objectKey := object.Key("RuleName") + objectKey.String(*v.RuleName) + } + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentTestRenderTemplateInput(v *TestRenderTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TemplateData != nil { + objectKey := object.Key("TemplateData") + objectKey.String(*v.TemplateData) + } + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateAccountSendingEnabledInput(v *UpdateAccountSendingEnabledInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Enabled { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateConfigurationSetEventDestinationInput(v *UpdateConfigurationSetEventDestinationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.EventDestination != nil { + objectKey := object.Key("EventDestination") + if err := awsAwsquery_serializeDocumentEventDestination(v.EventDestination, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateConfigurationSetReputationMetricsEnabledInput(v *UpdateConfigurationSetReputationMetricsEnabledInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateConfigurationSetSendingEnabledInput(v *UpdateConfigurationSetSendingEnabledInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateConfigurationSetTrackingOptionsInput(v *UpdateConfigurationSetTrackingOptionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConfigurationSetName != nil { + objectKey := object.Key("ConfigurationSetName") + objectKey.String(*v.ConfigurationSetName) + } + + if v.TrackingOptions != nil { + objectKey := object.Key("TrackingOptions") + if err := awsAwsquery_serializeDocumentTrackingOptions(v.TrackingOptions, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateCustomVerificationEmailTemplateInput(v *UpdateCustomVerificationEmailTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.FailureRedirectionURL != nil { + objectKey := object.Key("FailureRedirectionURL") + objectKey.String(*v.FailureRedirectionURL) + } + + if v.FromEmailAddress != nil { + objectKey := object.Key("FromEmailAddress") + objectKey.String(*v.FromEmailAddress) + } + + if v.SuccessRedirectionURL != nil { + objectKey := object.Key("SuccessRedirectionURL") + objectKey.String(*v.SuccessRedirectionURL) + } + + if v.TemplateContent != nil { + objectKey := object.Key("TemplateContent") + objectKey.String(*v.TemplateContent) + } + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + if v.TemplateSubject != nil { + objectKey := object.Key("TemplateSubject") + objectKey.String(*v.TemplateSubject) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateReceiptRuleInput(v *UpdateReceiptRuleInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Rule != nil { + objectKey := object.Key("Rule") + if err := awsAwsquery_serializeDocumentReceiptRule(v.Rule, objectKey); err != nil { + return err + } + } + + if v.RuleSetName != nil { + objectKey := object.Key("RuleSetName") + objectKey.String(*v.RuleSetName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentUpdateTemplateInput(v *UpdateTemplateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Template != nil { + objectKey := object.Key("Template") + if err := awsAwsquery_serializeDocumentTemplate(v.Template, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentVerifyDomainDkimInput(v *VerifyDomainDkimInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentVerifyDomainIdentityInput(v *VerifyDomainIdentityInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentVerifyEmailAddressInput(v *VerifyEmailAddressInput, value query.Value) error { + object := value.Object() + _ = object + + if v.EmailAddress != nil { + objectKey := object.Key("EmailAddress") + objectKey.String(*v.EmailAddress) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentVerifyEmailIdentityInput(v *VerifyEmailIdentityInput, value query.Value) error { + object := value.Object() + _ = object + + if v.EmailAddress != nil { + objectKey := object.Key("EmailAddress") + objectKey.String(*v.EmailAddress) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/enums.go new file mode 100644 index 00000000..f3e62226 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/enums.go @@ -0,0 +1,373 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type BehaviorOnMXFailure string + +// Enum values for BehaviorOnMXFailure +const ( + BehaviorOnMXFailureUseDefaultValue BehaviorOnMXFailure = "UseDefaultValue" + BehaviorOnMXFailureRejectMessage BehaviorOnMXFailure = "RejectMessage" +) + +// Values returns all known values for BehaviorOnMXFailure. Note that this can be +// expanded in the future, and 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 (BehaviorOnMXFailure) Values() []BehaviorOnMXFailure { + return []BehaviorOnMXFailure{ + "UseDefaultValue", + "RejectMessage", + } +} + +type BounceType string + +// Enum values for BounceType +const ( + BounceTypeDoesNotExist BounceType = "DoesNotExist" + BounceTypeMessageTooLarge BounceType = "MessageTooLarge" + BounceTypeExceededQuota BounceType = "ExceededQuota" + BounceTypeContentRejected BounceType = "ContentRejected" + BounceTypeUndefined BounceType = "Undefined" + BounceTypeTemporaryFailure BounceType = "TemporaryFailure" +) + +// Values returns all known values for BounceType. Note that this can be expanded +// in the future, and 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 (BounceType) Values() []BounceType { + return []BounceType{ + "DoesNotExist", + "MessageTooLarge", + "ExceededQuota", + "ContentRejected", + "Undefined", + "TemporaryFailure", + } +} + +type BulkEmailStatus string + +// Enum values for BulkEmailStatus +const ( + BulkEmailStatusSuccess BulkEmailStatus = "Success" + BulkEmailStatusMessageRejected BulkEmailStatus = "MessageRejected" + BulkEmailStatusMailFromDomainNotVerified BulkEmailStatus = "MailFromDomainNotVerified" + BulkEmailStatusConfigurationSetDoesNotExist BulkEmailStatus = "ConfigurationSetDoesNotExist" + BulkEmailStatusTemplateDoesNotExist BulkEmailStatus = "TemplateDoesNotExist" + BulkEmailStatusAccountSuspended BulkEmailStatus = "AccountSuspended" + BulkEmailStatusAccountThrottled BulkEmailStatus = "AccountThrottled" + BulkEmailStatusAccountDailyQuotaExceeded BulkEmailStatus = "AccountDailyQuotaExceeded" + BulkEmailStatusInvalidSendingPoolName BulkEmailStatus = "InvalidSendingPoolName" + BulkEmailStatusAccountSendingPaused BulkEmailStatus = "AccountSendingPaused" + BulkEmailStatusConfigurationSetSendingPaused BulkEmailStatus = "ConfigurationSetSendingPaused" + BulkEmailStatusInvalidParameterValue BulkEmailStatus = "InvalidParameterValue" + BulkEmailStatusTransientFailure BulkEmailStatus = "TransientFailure" + BulkEmailStatusFailed BulkEmailStatus = "Failed" +) + +// Values returns all known values for BulkEmailStatus. Note that this can be +// expanded in the future, and 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 (BulkEmailStatus) Values() []BulkEmailStatus { + return []BulkEmailStatus{ + "Success", + "MessageRejected", + "MailFromDomainNotVerified", + "ConfigurationSetDoesNotExist", + "TemplateDoesNotExist", + "AccountSuspended", + "AccountThrottled", + "AccountDailyQuotaExceeded", + "InvalidSendingPoolName", + "AccountSendingPaused", + "ConfigurationSetSendingPaused", + "InvalidParameterValue", + "TransientFailure", + "Failed", + } +} + +type ConfigurationSetAttribute string + +// Enum values for ConfigurationSetAttribute +const ( + ConfigurationSetAttributeEventDestinations ConfigurationSetAttribute = "eventDestinations" + ConfigurationSetAttributeTrackingOptions ConfigurationSetAttribute = "trackingOptions" + ConfigurationSetAttributeDeliveryOptions ConfigurationSetAttribute = "deliveryOptions" + ConfigurationSetAttributeReputationOptions ConfigurationSetAttribute = "reputationOptions" +) + +// Values returns all known values for ConfigurationSetAttribute. Note that this +// can be expanded in the future, and 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 (ConfigurationSetAttribute) Values() []ConfigurationSetAttribute { + return []ConfigurationSetAttribute{ + "eventDestinations", + "trackingOptions", + "deliveryOptions", + "reputationOptions", + } +} + +type CustomMailFromStatus string + +// Enum values for CustomMailFromStatus +const ( + CustomMailFromStatusPending CustomMailFromStatus = "Pending" + CustomMailFromStatusSuccess CustomMailFromStatus = "Success" + CustomMailFromStatusFailed CustomMailFromStatus = "Failed" + CustomMailFromStatusTemporaryFailure CustomMailFromStatus = "TemporaryFailure" +) + +// Values returns all known values for CustomMailFromStatus. Note that this can be +// expanded in the future, and 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 (CustomMailFromStatus) Values() []CustomMailFromStatus { + return []CustomMailFromStatus{ + "Pending", + "Success", + "Failed", + "TemporaryFailure", + } +} + +type DimensionValueSource string + +// Enum values for DimensionValueSource +const ( + DimensionValueSourceMessageTag DimensionValueSource = "messageTag" + DimensionValueSourceEmailHeader DimensionValueSource = "emailHeader" + DimensionValueSourceLinkTag DimensionValueSource = "linkTag" +) + +// Values returns all known values for DimensionValueSource. Note that this can be +// expanded in the future, and 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 (DimensionValueSource) Values() []DimensionValueSource { + return []DimensionValueSource{ + "messageTag", + "emailHeader", + "linkTag", + } +} + +type DsnAction string + +// Enum values for DsnAction +const ( + DsnActionFailed DsnAction = "failed" + DsnActionDelayed DsnAction = "delayed" + DsnActionDelivered DsnAction = "delivered" + DsnActionRelayed DsnAction = "relayed" + DsnActionExpanded DsnAction = "expanded" +) + +// Values returns all known values for DsnAction. Note that this can be expanded +// in the future, and 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 (DsnAction) Values() []DsnAction { + return []DsnAction{ + "failed", + "delayed", + "delivered", + "relayed", + "expanded", + } +} + +type EventType string + +// Enum values for EventType +const ( + EventTypeSend EventType = "send" + EventTypeReject EventType = "reject" + EventTypeBounce EventType = "bounce" + EventTypeComplaint EventType = "complaint" + EventTypeDelivery EventType = "delivery" + EventTypeOpen EventType = "open" + EventTypeClick EventType = "click" + EventTypeRenderingFailure EventType = "renderingFailure" +) + +// Values returns all known values for EventType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EventType) Values() []EventType { + return []EventType{ + "send", + "reject", + "bounce", + "complaint", + "delivery", + "open", + "click", + "renderingFailure", + } +} + +type IdentityType string + +// Enum values for IdentityType +const ( + IdentityTypeEmailAddress IdentityType = "EmailAddress" + IdentityTypeDomain IdentityType = "Domain" +) + +// Values returns all known values for IdentityType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (IdentityType) Values() []IdentityType { + return []IdentityType{ + "EmailAddress", + "Domain", + } +} + +type InvocationType string + +// Enum values for InvocationType +const ( + InvocationTypeEvent InvocationType = "Event" + InvocationTypeRequestResponse InvocationType = "RequestResponse" +) + +// Values returns all known values for InvocationType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (InvocationType) Values() []InvocationType { + return []InvocationType{ + "Event", + "RequestResponse", + } +} + +type NotificationType string + +// Enum values for NotificationType +const ( + NotificationTypeBounce NotificationType = "Bounce" + NotificationTypeComplaint NotificationType = "Complaint" + NotificationTypeDelivery NotificationType = "Delivery" +) + +// Values returns all known values for NotificationType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NotificationType) Values() []NotificationType { + return []NotificationType{ + "Bounce", + "Complaint", + "Delivery", + } +} + +type ReceiptFilterPolicy string + +// Enum values for ReceiptFilterPolicy +const ( + ReceiptFilterPolicyBlock ReceiptFilterPolicy = "Block" + ReceiptFilterPolicyAllow ReceiptFilterPolicy = "Allow" +) + +// Values returns all known values for ReceiptFilterPolicy. Note that this can be +// expanded in the future, and 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 (ReceiptFilterPolicy) Values() []ReceiptFilterPolicy { + return []ReceiptFilterPolicy{ + "Block", + "Allow", + } +} + +type SNSActionEncoding string + +// Enum values for SNSActionEncoding +const ( + SNSActionEncodingUtf8 SNSActionEncoding = "UTF-8" + SNSActionEncodingBase64 SNSActionEncoding = "Base64" +) + +// Values returns all known values for SNSActionEncoding. Note that this can be +// expanded in the future, and 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 (SNSActionEncoding) Values() []SNSActionEncoding { + return []SNSActionEncoding{ + "UTF-8", + "Base64", + } +} + +type StopScope string + +// Enum values for StopScope +const ( + StopScopeRuleSet StopScope = "RuleSet" +) + +// Values returns all known values for StopScope. Note that this can be expanded +// in the future, and 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 (StopScope) Values() []StopScope { + return []StopScope{ + "RuleSet", + } +} + +type TlsPolicy string + +// Enum values for TlsPolicy +const ( + TlsPolicyRequire TlsPolicy = "Require" + TlsPolicyOptional TlsPolicy = "Optional" +) + +// Values returns all known values for TlsPolicy. Note that this can be expanded +// in the future, and 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 (TlsPolicy) Values() []TlsPolicy { + return []TlsPolicy{ + "Require", + "Optional", + } +} + +type VerificationStatus string + +// Enum values for VerificationStatus +const ( + VerificationStatusPending VerificationStatus = "Pending" + VerificationStatusSuccess VerificationStatus = "Success" + VerificationStatusFailed VerificationStatus = "Failed" + VerificationStatusTemporaryFailure VerificationStatus = "TemporaryFailure" + VerificationStatusNotStarted VerificationStatus = "NotStarted" +) + +// Values returns all known values for VerificationStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (VerificationStatus) Values() []VerificationStatus { + return []VerificationStatus{ + "Pending", + "Success", + "Failed", + "TemporaryFailure", + "NotStarted", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/errors.go new file mode 100644 index 00000000..e807173f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/errors.go @@ -0,0 +1,1027 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Indicates that email sending is disabled for your entire Amazon SES account. +// +// You can enable or disable email sending for your Amazon SES account using UpdateAccountSendingEnabled. +type AccountSendingPausedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccountSendingPausedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccountSendingPausedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccountSendingPausedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccountSendingPausedException" + } + return *e.ErrorCodeOverride +} +func (e *AccountSendingPausedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a resource could not be created because of a naming conflict. +type AlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + Name *string + + noSmithyDocumentSerde +} + +func (e *AlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *AlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the delete operation could not be completed. +type CannotDeleteException struct { + Message *string + + ErrorCodeOverride *string + + Name *string + + noSmithyDocumentSerde +} + +func (e *CannotDeleteException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CannotDeleteException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CannotDeleteException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CannotDelete" + } + return *e.ErrorCodeOverride +} +func (e *CannotDeleteException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the configuration set could not be created because of a naming +// conflict. +type ConfigurationSetAlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +func (e *ConfigurationSetAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConfigurationSetAlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConfigurationSetAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConfigurationSetAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *ConfigurationSetAlreadyExistsException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the configuration set does not exist. +type ConfigurationSetDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +func (e *ConfigurationSetDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConfigurationSetDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConfigurationSetDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConfigurationSetDoesNotExist" + } + return *e.ErrorCodeOverride +} +func (e *ConfigurationSetDoesNotExistException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that email sending is disabled for the configuration set. +// +// You can enable or disable email sending for a configuration set using UpdateConfigurationSetSendingEnabled. +type ConfigurationSetSendingPausedException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +func (e *ConfigurationSetSendingPausedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConfigurationSetSendingPausedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConfigurationSetSendingPausedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConfigurationSetSendingPausedException" + } + return *e.ErrorCodeOverride +} +func (e *ConfigurationSetSendingPausedException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that custom verification email template provided content is invalid. +type CustomVerificationEmailInvalidContentException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CustomVerificationEmailInvalidContentException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CustomVerificationEmailInvalidContentException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CustomVerificationEmailInvalidContentException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CustomVerificationEmailInvalidContent" + } + return *e.ErrorCodeOverride +} +func (e *CustomVerificationEmailInvalidContentException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that a custom verification email template with the name you specified +// already exists. +type CustomVerificationEmailTemplateAlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + CustomVerificationEmailTemplateName *string + + noSmithyDocumentSerde +} + +func (e *CustomVerificationEmailTemplateAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CustomVerificationEmailTemplateAlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CustomVerificationEmailTemplateAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CustomVerificationEmailTemplateAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *CustomVerificationEmailTemplateAlreadyExistsException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that a custom verification email template with the name you specified +// does not exist. +type CustomVerificationEmailTemplateDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + CustomVerificationEmailTemplateName *string + + noSmithyDocumentSerde +} + +func (e *CustomVerificationEmailTemplateDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CustomVerificationEmailTemplateDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CustomVerificationEmailTemplateDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CustomVerificationEmailTemplateDoesNotExist" + } + return *e.ErrorCodeOverride +} +func (e *CustomVerificationEmailTemplateDoesNotExistException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the event destination could not be created because of a naming +// conflict. +type EventDestinationAlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + EventDestinationName *string + + noSmithyDocumentSerde +} + +func (e *EventDestinationAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EventDestinationAlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EventDestinationAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EventDestinationAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *EventDestinationAlreadyExistsException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the event destination does not exist. +type EventDestinationDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + EventDestinationName *string + + noSmithyDocumentSerde +} + +func (e *EventDestinationDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EventDestinationDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EventDestinationDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EventDestinationDoesNotExist" + } + return *e.ErrorCodeOverride +} +func (e *EventDestinationDoesNotExistException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the sender address specified for a custom verification email is +// not verified, and is therefore not eligible to send the custom verification +// email. +type FromEmailAddressNotVerifiedException struct { + Message *string + + ErrorCodeOverride *string + + FromEmailAddress *string + + noSmithyDocumentSerde +} + +func (e *FromEmailAddressNotVerifiedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *FromEmailAddressNotVerifiedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *FromEmailAddressNotVerifiedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "FromEmailAddressNotVerified" + } + return *e.ErrorCodeOverride +} +func (e *FromEmailAddressNotVerifiedException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the Amazon CloudWatch destination is invalid. See the error +// message for details. +type InvalidCloudWatchDestinationException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + EventDestinationName *string + + noSmithyDocumentSerde +} + +func (e *InvalidCloudWatchDestinationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidCloudWatchDestinationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidCloudWatchDestinationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidCloudWatchDestination" + } + return *e.ErrorCodeOverride +} +func (e *InvalidCloudWatchDestinationException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the configuration set is invalid. See the error message for +// details. +type InvalidConfigurationSetException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidConfigurationSetException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidConfigurationSetException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidConfigurationSetException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidConfigurationSet" + } + return *e.ErrorCodeOverride +} +func (e *InvalidConfigurationSetException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that provided delivery option is invalid. +type InvalidDeliveryOptionsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDeliveryOptionsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDeliveryOptionsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDeliveryOptionsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDeliveryOptions" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDeliveryOptionsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the Amazon Kinesis Firehose destination is invalid. See the +// error message for details. +type InvalidFirehoseDestinationException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + EventDestinationName *string + + noSmithyDocumentSerde +} + +func (e *InvalidFirehoseDestinationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidFirehoseDestinationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidFirehoseDestinationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidFirehoseDestination" + } + return *e.ErrorCodeOverride +} +func (e *InvalidFirehoseDestinationException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the provided Amazon Web Services Lambda function is invalid, or +// that Amazon SES could not execute the provided function, possibly due to +// permissions issues. For information about giving permissions, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html +type InvalidLambdaFunctionException struct { + Message *string + + ErrorCodeOverride *string + + FunctionArn *string + + noSmithyDocumentSerde +} + +func (e *InvalidLambdaFunctionException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidLambdaFunctionException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidLambdaFunctionException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidLambdaFunction" + } + return *e.ErrorCodeOverride +} +func (e *InvalidLambdaFunctionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the provided policy is invalid. Check the error stack for more +// information about what caused the error. +type InvalidPolicyException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidPolicyException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidPolicyException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidPolicyException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidPolicy" + } + return *e.ErrorCodeOverride +} +func (e *InvalidPolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that one or more of the replacement values you provided is invalid. +// This error may occur when the TemplateData object contains invalid JSON. +type InvalidRenderingParameterException struct { + Message *string + + ErrorCodeOverride *string + + TemplateName *string + + noSmithyDocumentSerde +} + +func (e *InvalidRenderingParameterException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRenderingParameterException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRenderingParameterException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRenderingParameter" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRenderingParameterException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the provided Amazon S3 bucket or Amazon Web Services KMS +// encryption key is invalid, or that Amazon SES could not publish to the bucket, +// possibly due to permissions issues. For information about giving permissions, +// see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html +type InvalidS3ConfigurationException struct { + Message *string + + ErrorCodeOverride *string + + Bucket *string + + noSmithyDocumentSerde +} + +func (e *InvalidS3ConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidS3ConfigurationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidS3ConfigurationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidS3Configuration" + } + return *e.ErrorCodeOverride +} +func (e *InvalidS3ConfigurationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the Amazon Simple Notification Service (Amazon SNS) destination +// is invalid. See the error message for details. +type InvalidSNSDestinationException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + EventDestinationName *string + + noSmithyDocumentSerde +} + +func (e *InvalidSNSDestinationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSNSDestinationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSNSDestinationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSNSDestination" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSNSDestinationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the provided Amazon SNS topic is invalid, or that Amazon SES +// could not publish to the topic, possibly due to permissions issues. For +// information about giving permissions, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-permissions.html +type InvalidSnsTopicException struct { + Message *string + + ErrorCodeOverride *string + + Topic *string + + noSmithyDocumentSerde +} + +func (e *InvalidSnsTopicException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSnsTopicException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSnsTopicException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSnsTopic" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSnsTopicException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the template that you specified could not be rendered. This +// issue may occur when a template refers to a partial that does not exist. +type InvalidTemplateException struct { + Message *string + + ErrorCodeOverride *string + + TemplateName *string + + noSmithyDocumentSerde +} + +func (e *InvalidTemplateException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidTemplateException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidTemplateException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidTemplate" + } + return *e.ErrorCodeOverride +} +func (e *InvalidTemplateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the custom domain to be used for open and click tracking +// redirects is invalid. This error appears most often in the following situations: +// +// - When the tracking domain you specified is not verified in Amazon SES. +// +// - When the tracking domain you specified is not a valid domain or subdomain. +type InvalidTrackingOptionsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidTrackingOptionsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidTrackingOptionsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidTrackingOptionsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidTrackingOptions" + } + return *e.ErrorCodeOverride +} +func (e *InvalidTrackingOptionsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a resource could not be created because of service limits. For a +// list of Amazon SES limits, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html +type LimitExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *LimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *LimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "LimitExceeded" + } + return *e.ErrorCodeOverride +} +func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the message could not be sent because Amazon SES could not read +// +// the MX record required to use the specified MAIL FROM domain. For information +// about editing the custom MAIL FROM domain settings for an identity, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mail-from-edit.html +type MailFromDomainNotVerifiedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *MailFromDomainNotVerifiedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *MailFromDomainNotVerifiedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *MailFromDomainNotVerifiedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MailFromDomainNotVerifiedException" + } + return *e.ErrorCodeOverride +} +func (e *MailFromDomainNotVerifiedException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the action failed, and the message could not be sent. Check the +// error stack for more information about what caused the error. +type MessageRejected struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *MessageRejected) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *MessageRejected) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *MessageRejected) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MessageRejected" + } + return *e.ErrorCodeOverride +} +func (e *MessageRejected) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that one or more of the replacement values for the specified template +// was not specified. Ensure that the TemplateData object contains references to +// all of the replacement tags in the specified template. +type MissingRenderingAttributeException struct { + Message *string + + ErrorCodeOverride *string + + TemplateName *string + + noSmithyDocumentSerde +} + +func (e *MissingRenderingAttributeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *MissingRenderingAttributeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *MissingRenderingAttributeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MissingRenderingAttribute" + } + return *e.ErrorCodeOverride +} +func (e *MissingRenderingAttributeException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the account has not been granted production access. +type ProductionAccessNotGrantedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ProductionAccessNotGrantedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ProductionAccessNotGrantedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ProductionAccessNotGrantedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ProductionAccessNotGranted" + } + return *e.ErrorCodeOverride +} +func (e *ProductionAccessNotGrantedException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the provided receipt rule does not exist. +type RuleDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + Name *string + + noSmithyDocumentSerde +} + +func (e *RuleDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RuleDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RuleDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RuleDoesNotExist" + } + return *e.ErrorCodeOverride +} +func (e *RuleDoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the provided receipt rule set does not exist. +type RuleSetDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + Name *string + + noSmithyDocumentSerde +} + +func (e *RuleSetDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RuleSetDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RuleSetDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RuleSetDoesNotExist" + } + return *e.ErrorCodeOverride +} +func (e *RuleSetDoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the Template object you specified does not exist in your Amazon +// SES account. +type TemplateDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + TemplateName *string + + noSmithyDocumentSerde +} + +func (e *TemplateDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TemplateDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TemplateDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TemplateDoesNotExist" + } + return *e.ErrorCodeOverride +} +func (e *TemplateDoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the configuration set you specified already contains a +// TrackingOptions object. +type TrackingOptionsAlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +func (e *TrackingOptionsAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TrackingOptionsAlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TrackingOptionsAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TrackingOptionsAlreadyExistsException" + } + return *e.ErrorCodeOverride +} +func (e *TrackingOptionsAlreadyExistsException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Indicates that the TrackingOptions object you specified does not exist. +type TrackingOptionsDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + ConfigurationSetName *string + + noSmithyDocumentSerde +} + +func (e *TrackingOptionsDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TrackingOptionsDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TrackingOptionsDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TrackingOptionsDoesNotExistException" + } + return *e.ErrorCodeOverride +} +func (e *TrackingOptionsDoesNotExistException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/types.go new file mode 100644 index 00000000..33c7a3b5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/types/types.go @@ -0,0 +1,1355 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// When included in a receipt rule, this action adds a header to the received +// email. +// +// For information about adding a header using a receipt rule, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-add-header.html +type AddHeaderAction struct { + + // The name of the header to add to the incoming message. The name must contain at + // least one character, and can contain up to 50 characters. It consists of + // alphanumeric (a–z, A–Z, 0–9) characters and dashes. + // + // This member is required. + HeaderName *string + + // The content to include in the header. This value can contain up to 2048 + // characters. It can't contain newline ( \n ) or carriage return ( \r ) characters. + // + // This member is required. + HeaderValue *string + + noSmithyDocumentSerde +} + +// Represents the body of the message. You can specify text, HTML, or both. If you +// use both, then the message should display correctly in the widest variety of +// email clients. +type Body struct { + + // The content of the message, in HTML format. Use this for email clients that can + // process HTML. You can include clickable links, formatted text, and much more in + // an HTML message. + Html *Content + + // The content of the message, in text format. Use this for text-based email + // clients, or clients on high-latency networks (such as mobile devices). + Text *Content + + noSmithyDocumentSerde +} + +// When included in a receipt rule, this action rejects the received email by +// returning a bounce response to the sender and, optionally, publishes a +// notification to Amazon Simple Notification Service (Amazon SNS). +// +// For information about sending a bounce message in response to a received email, +// see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-bounce.html +type BounceAction struct { + + // Human-readable text to include in the bounce message. + // + // This member is required. + Message *string + + // The email address of the sender of the bounced email. This is the address from + // which the bounce message is sent. + // + // This member is required. + Sender *string + + // The SMTP reply code, as defined by [RFC 5321]. + // + // [RFC 5321]: https://tools.ietf.org/html/rfc5321 + // + // This member is required. + SmtpReplyCode *string + + // The SMTP enhanced status code, as defined by [RFC 3463]. + // + // [RFC 3463]: https://tools.ietf.org/html/rfc3463 + StatusCode *string + + // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the + // bounce action is taken. You can find the ARN of a topic by using the [ListTopics]operation + // in Amazon SNS. + // + // For more information about Amazon SNS topics, see the [Amazon SNS Developer Guide]. + // + // [ListTopics]: https://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html + // [Amazon SNS Developer Guide]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html + TopicArn *string + + noSmithyDocumentSerde +} + +// Recipient-related information to include in the Delivery Status Notification +// (DSN) when an email that Amazon SES receives on your behalf bounces. +// +// For information about receiving email through Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email.html +type BouncedRecipientInfo struct { + + // The email address of the recipient of the bounced email. + // + // This member is required. + Recipient *string + + // The reason for the bounce. You must provide either this parameter or + // RecipientDsnFields . + BounceType BounceType + + // This parameter is used only for sending authorization. It is the ARN of the + // identity that is associated with the sending authorization policy that permits + // you to receive email for the recipient of the bounced email. For more + // information about sending authorization, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html + RecipientArn *string + + // Recipient-related DSN fields, most of which would normally be filled in + // automatically when provided with a BounceType . You must provide either this + // parameter or BounceType . + RecipientDsnFields *RecipientDsnFields + + noSmithyDocumentSerde +} + +// An array that contains one or more Destinations, as well as the tags and +// replacement data associated with each of those Destinations. +type BulkEmailDestination struct { + + // Represents the destination of the message, consisting of To:, CC:, and BCC: + // fields. + // + // Amazon SES does not support the SMTPUTF8 extension, as described in [RFC6531]. For this + // reason, the email address string must be 7-bit ASCII. If you want to send to or + // from email addresses that contain Unicode characters in the domain part of an + // address, you must encode the domain using Punycode. Punycode is not permitted in + // the local part of the email address (the part before the @ sign) nor in the + // "friendly from" name. If you want to use Unicode characters in the "friendly + // from" name, you must encode the "friendly from" name using MIME encoded-word + // syntax, as described in [Sending raw email using the Amazon SES API]. For more information about Punycode, see [RFC 3492]. + // + // [RFC6531]: https://tools.ietf.org/html/rfc6531 + // [Sending raw email using the Amazon SES API]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html + // [RFC 3492]: http://tools.ietf.org/html/rfc3492 + // + // This member is required. + Destination *Destination + + // A list of tags, in the form of name/value pairs, to apply to an email that you + // send using SendBulkTemplatedEmail . Tags correspond to characteristics of the + // email that you define, so that you can publish email sending events. + ReplacementTags []MessageTag + + // A list of replacement values to apply to the template. This parameter is a JSON + // object, typically consisting of key-value pairs in which the keys correspond to + // replacement tags in the email template. + ReplacementTemplateData *string + + noSmithyDocumentSerde +} + +// An object that contains the response from the SendBulkTemplatedEmail operation. +type BulkEmailDestinationStatus struct { + + // A description of an error that prevented a message being sent using the + // SendBulkTemplatedEmail operation. + Error *string + + // The unique message identifier returned from the SendBulkTemplatedEmail + // operation. + MessageId *string + + // The status of a message sent using the SendBulkTemplatedEmail operation. + // + // Possible values for this parameter include: + // + // - Success : Amazon SES accepted the message, and attempts to deliver it to the + // recipients. + // + // - MessageRejected : The message was rejected because it contained a virus. + // + // - MailFromDomainNotVerified : The sender's email address or domain was not + // verified. + // + // - ConfigurationSetDoesNotExist : The configuration set you specified does not + // exist. + // + // - TemplateDoesNotExist : The template you specified does not exist. + // + // - AccountSuspended : Your account has been shut down because of issues related + // to your email sending practices. + // + // - AccountThrottled : The number of emails you can send has been reduced + // because your account has exceeded its allocated sending limit. + // + // - AccountDailyQuotaExceeded : You have reached or exceeded the maximum number + // of emails you can send from your account in a 24-hour period. + // + // - InvalidSendingPoolName : The configuration set you specified refers to an IP + // pool that does not exist. + // + // - AccountSendingPaused : Email sending for the Amazon SES account was disabled + // using the UpdateAccountSendingEnabledoperation. + // + // - ConfigurationSetSendingPaused : Email sending for this configuration set was + // disabled using the UpdateConfigurationSetSendingEnabledoperation. + // + // - InvalidParameterValue : One or more of the parameters you specified when + // calling this operation was invalid. See the error message for additional + // information. + // + // - TransientFailure : Amazon SES was unable to process your request because of + // a temporary issue. + // + // - Failed : Amazon SES was unable to process your request. See the error + // message for additional information. + Status BulkEmailStatus + + noSmithyDocumentSerde +} + +// Contains information associated with an Amazon CloudWatch event destination to +// which email sending events are published. +// +// Event destinations, such as Amazon CloudWatch, are associated with +// configuration sets, which enable you to publish email sending events. For +// information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type CloudWatchDestination struct { + + // A list of dimensions upon which to categorize your emails when you publish + // email sending events to Amazon CloudWatch. + // + // This member is required. + DimensionConfigurations []CloudWatchDimensionConfiguration + + noSmithyDocumentSerde +} + +// Contains the dimension configuration to use when you publish email sending +// events to Amazon CloudWatch. +// +// For information about publishing email sending events to Amazon CloudWatch, see +// the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type CloudWatchDimensionConfiguration struct { + + // The default value of the dimension that is published to Amazon CloudWatch if + // you do not provide the value of the dimension when you send an email. The + // default value must meet the following requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), + // dashes (-), at signs (@), or periods (.). + // + // - Contain 256 characters or fewer. + // + // This member is required. + DefaultDimensionValue *string + + // The name of an Amazon CloudWatch dimension associated with an email sending + // metric. The name must meet the following requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), + // dashes (-), or colons (:). + // + // - Contain 256 characters or fewer. + // + // This member is required. + DimensionName *string + + // The place where Amazon SES finds the value of a dimension to publish to Amazon + // CloudWatch. To use the message tags that you specify using an X-SES-MESSAGE-TAGS + // header or a parameter to the SendEmail / SendRawEmail API, specify messageTag . + // To use your own email headers, specify emailHeader . To put a custom tag on any + // link included in your email, specify linkTag . + // + // This member is required. + DimensionValueSource DimensionValueSource + + noSmithyDocumentSerde +} + +// The name of the configuration set. +// +// Configuration sets let you create groups of rules that you can apply to the +// emails you send using Amazon SES. For more information about using configuration +// sets, see [Using Amazon SES Configuration Sets]in the [Amazon SES Developer Guide]. +// +// [Using Amazon SES Configuration Sets]: https://docs.aws.amazon.com/ses/latest/dg/using-configuration-sets.html +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/ +type ConfigurationSet struct { + + // The name of the configuration set. The name must meet the following + // requirements: + // + // - Contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes + // (-). + // + // - Contain 64 characters or fewer. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Represents textual data, plus an optional character set specification. +// +// By default, the text must be 7-bit ASCII, due to the constraints of the SMTP +// protocol. If the text must contain any other characters, then you must also +// specify a character set. Examples include UTF-8, ISO-8859-1, and Shift_JIS. +type Content struct { + + // The textual data of the content. + // + // This member is required. + Data *string + + // The character set of the content. + Charset *string + + noSmithyDocumentSerde +} + +// Contains information about a custom verification email template. +type CustomVerificationEmailTemplate struct { + + // The URL that the recipient of the verification email is sent to if his or her + // address is not successfully verified. + FailureRedirectionURL *string + + // The email address that the custom verification email is sent from. + FromEmailAddress *string + + // The URL that the recipient of the verification email is sent to if his or her + // address is successfully verified. + SuccessRedirectionURL *string + + // The name of the custom verification email template. + TemplateName *string + + // The subject line of the custom verification email. + TemplateSubject *string + + noSmithyDocumentSerde +} + +// Specifies whether messages that use the configuration set are required to use +// Transport Layer Security (TLS). +type DeliveryOptions struct { + + // Specifies whether messages that use the configuration set are required to use + // Transport Layer Security (TLS). If the value is Require , messages are only + // delivered if a TLS connection can be established. If the value is Optional , + // messages can be delivered in plain text if a TLS connection can't be + // established. + TlsPolicy TlsPolicy + + noSmithyDocumentSerde +} + +// Represents the destination of the message, consisting of To:, CC:, and BCC: +// fields. +// +// Amazon SES does not support the SMTPUTF8 extension, as described in [RFC6531]. For this +// reason, the email address string must be 7-bit ASCII. If you want to send to or +// from email addresses that contain Unicode characters in the domain part of an +// address, you must encode the domain using Punycode. Punycode is not permitted in +// the local part of the email address (the part before the @ sign) nor in the +// "friendly from" name. If you want to use Unicode characters in the "friendly +// from" name, you must encode the "friendly from" name using MIME encoded-word +// syntax, as described in [Sending raw email using the Amazon SES API]. For more information about Punycode, see [RFC 3492]. +// +// [RFC6531]: https://tools.ietf.org/html/rfc6531 +// [Sending raw email using the Amazon SES API]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html +// [RFC 3492]: http://tools.ietf.org/html/rfc3492 +type Destination struct { + + // The recipients to place on the BCC: line of the message. + BccAddresses []string + + // The recipients to place on the CC: line of the message. + CcAddresses []string + + // The recipients to place on the To: line of the message. + ToAddresses []string + + noSmithyDocumentSerde +} + +// Contains information about an event destination. +// +// When you create or update an event destination, you must provide one, and only +// one, destination. The destination can be Amazon CloudWatch, Amazon Kinesis +// Firehose or Amazon Simple Notification Service (Amazon SNS). +// +// Event destinations are associated with configuration sets, which enable you to +// publish email sending events to Amazon CloudWatch, Amazon Kinesis Firehose, or +// Amazon Simple Notification Service (Amazon SNS). For information about using +// configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type EventDestination struct { + + // The type of email sending events to publish to the event destination. + // + // - send - The call was successful and Amazon SES is attempting to deliver the + // email. + // + // - reject - Amazon SES determined that the email contained a virus and rejected + // it. + // + // - bounce - The recipient's mail server permanently rejected the email. This + // corresponds to a hard bounce. + // + // - complaint - The recipient marked the email as spam. + // + // - delivery - Amazon SES successfully delivered the email to the recipient's + // mail server. + // + // - open - The recipient received the email and opened it in their email client. + // + // - click - The recipient clicked one or more links in the email. + // + // - renderingFailure - Amazon SES did not send the email because of a template + // rendering issue. + // + // This member is required. + MatchingEventTypes []EventType + + // The name of the event destination. The name must meet the following + // requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or + // dashes (-). + // + // - Contain 64 characters or fewer. + // + // This member is required. + Name *string + + // An object that contains the names, default values, and sources of the + // dimensions associated with an Amazon CloudWatch event destination. + CloudWatchDestination *CloudWatchDestination + + // Sets whether Amazon SES publishes events to this destination when you send an + // email with the associated configuration set. Set to true to enable publishing + // to this destination; set to false to prevent publishing to this destination. + // The default value is false . + Enabled bool + + // An object that contains the delivery stream ARN and the IAM role ARN associated + // with an Amazon Kinesis Firehose event destination. + KinesisFirehoseDestination *KinesisFirehoseDestination + + // An object that contains the topic ARN associated with an Amazon Simple + // Notification Service (Amazon SNS) event destination. + SNSDestination *SNSDestination + + noSmithyDocumentSerde +} + +// Additional X-headers to include in the Delivery Status Notification (DSN) when +// an email that Amazon SES receives on your behalf bounces. +// +// For information about receiving email through Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email.html +type ExtensionField struct { + + // The name of the header to add. Must be between 1 and 50 characters, inclusive, + // and consist of alphanumeric (a-z, A-Z, 0-9) characters and dashes only. + // + // This member is required. + Name *string + + // The value of the header to add. Must contain 2048 characters or fewer, and must + // not contain newline characters ("\r" or "\n"). + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Represents the DKIM attributes of a verified email address or a domain. +type IdentityDkimAttributes struct { + + // Is true if DKIM signing is enabled for email sent from the identity. It's false + // otherwise. The default value is true. + // + // This member is required. + DkimEnabled bool + + // Describes whether Amazon SES has successfully verified the DKIM DNS records + // (tokens) published in the domain name's DNS. (This only applies to domain + // identities, not email address identities.) + // + // This member is required. + DkimVerificationStatus VerificationStatus + + // A set of character strings that represent the domain's identity. Using these + // tokens, you need to create DNS CNAME records that point to DKIM public keys that + // are hosted by Amazon SES. Amazon Web Services eventually detects that you've + // updated your DNS records. This detection process might take up to 72 hours. + // After successful detection, Amazon SES is able to DKIM-sign email originating + // from that domain. (This only applies to domain identities, not email address + // identities.) + // + // For more information about creating DNS records using DKIM tokens, see the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-easy.html + DkimTokens []string + + noSmithyDocumentSerde +} + +// Represents the custom MAIL FROM domain attributes of a verified identity (email +// address or domain). +type IdentityMailFromDomainAttributes struct { + + // The action that Amazon SES takes if it cannot successfully read the required MX + // record when you send an email. A value of UseDefaultValue indicates that if + // Amazon SES cannot read the required MX record, it uses amazonses.com (or a + // subdomain of that) as the MAIL FROM domain. A value of RejectMessage indicates + // that if Amazon SES cannot read the required MX record, Amazon SES returns a + // MailFromDomainNotVerified error and does not send the email. + // + // The custom MAIL FROM setup states that result in this behavior are Pending , + // Failed , and TemporaryFailure . + // + // This member is required. + BehaviorOnMXFailure BehaviorOnMXFailure + + // The custom MAIL FROM domain that the identity is configured to use. + // + // This member is required. + MailFromDomain *string + + // The state that indicates whether Amazon SES has successfully read the MX record + // required for custom MAIL FROM domain setup. If the state is Success , Amazon SES + // uses the specified custom MAIL FROM domain when the verified identity sends an + // email. All other states indicate that Amazon SES takes the action described by + // BehaviorOnMXFailure . + // + // This member is required. + MailFromDomainStatus CustomMailFromStatus + + noSmithyDocumentSerde +} + +// Represents the notification attributes of an identity, including whether an +// identity has Amazon Simple Notification Service (Amazon SNS) topics set for +// bounce, complaint, and/or delivery notifications, and whether feedback +// forwarding is enabled for bounce and complaint notifications. +type IdentityNotificationAttributes struct { + + // The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES + // publishes bounce notifications. + // + // This member is required. + BounceTopic *string + + // The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES + // publishes complaint notifications. + // + // This member is required. + ComplaintTopic *string + + // The Amazon Resource Name (ARN) of the Amazon SNS topic where Amazon SES + // publishes delivery notifications. + // + // This member is required. + DeliveryTopic *string + + // Describes whether Amazon SES forwards bounce and complaint notifications as + // email. true indicates that Amazon SES forwards bounce and complaint + // notifications as email, while false indicates that bounce and complaint + // notifications are published only to the specified bounce and complaint Amazon + // SNS topics. + // + // This member is required. + ForwardingEnabled bool + + // Describes whether Amazon SES includes the original email headers in Amazon SNS + // notifications of type Bounce . A value of true specifies that Amazon SES + // includes headers in bounce notifications, and a value of false specifies that + // Amazon SES does not include headers in bounce notifications. + HeadersInBounceNotificationsEnabled bool + + // Describes whether Amazon SES includes the original email headers in Amazon SNS + // notifications of type Complaint . A value of true specifies that Amazon SES + // includes headers in complaint notifications, and a value of false specifies + // that Amazon SES does not include headers in complaint notifications. + HeadersInComplaintNotificationsEnabled bool + + // Describes whether Amazon SES includes the original email headers in Amazon SNS + // notifications of type Delivery . A value of true specifies that Amazon SES + // includes headers in delivery notifications, and a value of false specifies that + // Amazon SES does not include headers in delivery notifications. + HeadersInDeliveryNotificationsEnabled bool + + noSmithyDocumentSerde +} + +// Represents the verification attributes of a single identity. +type IdentityVerificationAttributes struct { + + // The verification status of the identity: "Pending", "Success", "Failed", or + // "TemporaryFailure". + // + // This member is required. + VerificationStatus VerificationStatus + + // The verification token for a domain identity. Null for email address identities. + VerificationToken *string + + noSmithyDocumentSerde +} + +// Contains the delivery stream ARN and the IAM role ARN associated with an Amazon +// Kinesis Firehose event destination. +// +// Event destinations, such as Amazon Kinesis Firehose, are associated with +// configuration sets, which enable you to publish email sending events. For +// information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type KinesisFirehoseDestination struct { + + // The ARN of the Amazon Kinesis Firehose stream that email sending events should + // be published to. + // + // This member is required. + DeliveryStreamARN *string + + // The ARN of the IAM role under which Amazon SES publishes email sending events + // to the Amazon Kinesis Firehose stream. + // + // This member is required. + IAMRoleARN *string + + noSmithyDocumentSerde +} + +// When included in a receipt rule, this action calls an Amazon Web Services +// Lambda function and, optionally, publishes a notification to Amazon Simple +// Notification Service (Amazon SNS). +// +// To enable Amazon SES to call your Amazon Web Services Lambda function or to +// publish to an Amazon SNS topic of another account, Amazon SES must have +// permission to access those resources. For information about giving permissions, +// see the [Amazon SES Developer Guide]. +// +// For information about using Amazon Web Services Lambda actions in receipt +// rules, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-lambda.html +type LambdaAction struct { + + // The Amazon Resource Name (ARN) of the Amazon Web Services Lambda function. An + // example of an Amazon Web Services Lambda function ARN is + // arn:aws:lambda:us-west-2:account-id:function:MyFunction . For more information + // about Amazon Web Services Lambda, see the [Amazon Web Services Lambda Developer Guide]. + // + // [Amazon Web Services Lambda Developer Guide]: https://docs.aws.amazon.com/lambda/latest/dg/welcome.html + // + // This member is required. + FunctionArn *string + + // The invocation type of the Amazon Web Services Lambda function. An invocation + // type of RequestResponse means that the execution of the function immediately + // results in a response, and a value of Event means that the function is invoked + // asynchronously. The default value is Event . For information about Amazon Web + // Services Lambda invocation types, see the [Amazon Web Services Lambda Developer Guide]. + // + // There is a 30-second timeout on RequestResponse invocations. You should use + // Event invocation in most cases. Use RequestResponse only to make a mail flow + // decision, such as whether to stop the receipt rule or the receipt rule set. + // + // [Amazon Web Services Lambda Developer Guide]: https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html + InvocationType InvocationType + + // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the + // Lambda action is executed. You can find the ARN of a topic by using the [ListTopics] + // operation in Amazon SNS. + // + // For more information about Amazon SNS topics, see the [Amazon SNS Developer Guide]. + // + // [ListTopics]: https://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html + // [Amazon SNS Developer Guide]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html + TopicArn *string + + noSmithyDocumentSerde +} + +// Represents the message to be sent, composed of a subject and a body. +type Message struct { + + // The message body. + // + // This member is required. + Body *Body + + // The subject of the message: A short summary of the content, which appears in + // the recipient's inbox. + // + // This member is required. + Subject *Content + + noSmithyDocumentSerde +} + +// Message-related information to include in the Delivery Status Notification +// (DSN) when an email that Amazon SES receives on your behalf bounces. +// +// For information about receiving email through Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email.html +type MessageDsn struct { + + // The reporting MTA that attempted to deliver the message, formatted as specified + // in [RFC 3464]( mta-name-type; mta-name ). The default value is dns; + // inbound-smtp.[region].amazonaws.com . + // + // [RFC 3464]: https://tools.ietf.org/html/rfc3464 + // + // This member is required. + ReportingMta *string + + // When the message was received by the reporting mail transfer agent (MTA), in [RFC 822] + // date-time format. + // + // [RFC 822]: https://www.ietf.org/rfc/rfc0822.txt + ArrivalDate *time.Time + + // Additional X-headers to include in the DSN. + ExtensionFields []ExtensionField + + noSmithyDocumentSerde +} + +// Contains the name and value of a tag that you can provide to SendEmail or +// SendRawEmail to apply to an email. +// +// Message tags, which you use with configuration sets, enable you to publish +// email sending events. For information about using configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type MessageTag struct { + + // The name of the tag. The name must meet the following requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or + // dashes (-). + // + // - Contain 256 characters or fewer. + // + // This member is required. + Name *string + + // The value of the tag. The value must meet the following requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or + // dashes (-). + // + // - Contain 256 characters or fewer. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Represents the raw data of the message. +type RawMessage struct { + + // The raw data of the message. This data needs to base64-encoded if you are + // accessing Amazon SES directly through the HTTPS interface. If you are accessing + // Amazon SES using an Amazon Web Services SDK, the SDK takes care of the base + // 64-encoding for you. In all cases, the client must ensure that the message + // format complies with Internet email standards regarding email header fields, + // MIME types, and MIME encoding. + // + // The To:, CC:, and BCC: headers in the raw message can contain a group list. + // + // If you are using SendRawEmail with sending authorization, you can include + // X-headers in the raw message to specify the "Source," "From," and "Return-Path" + // addresses. For more information, see the documentation for SendRawEmail . + // + // Do not include these X-headers in the DKIM signature, because they are removed + // by Amazon SES before sending the email. + // + // For more information, go to the [Amazon SES Developer Guide]. + // + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html + // + // This member is required. + Data []byte + + noSmithyDocumentSerde +} + +// An action that Amazon SES can take when it receives an email on behalf of one +// or more email addresses or domains that you own. An instance of this data type +// can represent only one action. +// +// For information about setting up receipt rules, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +type ReceiptAction struct { + + // Adds a header to the received email. + AddHeaderAction *AddHeaderAction + + // Rejects the received email by returning a bounce response to the sender and, + // optionally, publishes a notification to Amazon Simple Notification Service + // (Amazon SNS). + BounceAction *BounceAction + + // Calls an Amazon Web Services Lambda function, and optionally, publishes a + // notification to Amazon SNS. + LambdaAction *LambdaAction + + // Saves the received message to an Amazon Simple Storage Service (Amazon S3) + // bucket and, optionally, publishes a notification to Amazon SNS. + S3Action *S3Action + + // Publishes the email content within a notification to Amazon SNS. + SNSAction *SNSAction + + // Terminates the evaluation of the receipt rule set and optionally publishes a + // notification to Amazon SNS. + StopAction *StopAction + + // Calls Amazon WorkMail and, optionally, publishes a notification to Amazon + // Amazon SNS. + WorkmailAction *WorkmailAction + + noSmithyDocumentSerde +} + +// A receipt IP address filter enables you to specify whether to accept or reject +// mail originating from an IP address or range of IP addresses. +// +// For information about setting up IP address filters, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-ip-filtering-console-walkthrough.html +type ReceiptFilter struct { + + // A structure that provides the IP addresses to block or allow, and whether to + // block or allow incoming mail from them. + // + // This member is required. + IpFilter *ReceiptIpFilter + + // The name of the IP address filter. The name must meet the following + // requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or + // dashes (-). + // + // - Start and end with a letter or number. + // + // - Contain 64 characters or fewer. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// A receipt IP address filter enables you to specify whether to accept or reject +// mail originating from an IP address or range of IP addresses. +// +// For information about setting up IP address filters, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-ip-filtering-console-walkthrough.html +type ReceiptIpFilter struct { + + // A single IP address or a range of IP addresses to block or allow, specified in + // Classless Inter-Domain Routing (CIDR) notation. An example of a single email + // address is 10.0.0.1. An example of a range of IP addresses is 10.0.0.1/24. For + // more information about CIDR notation, see [RFC 2317]. + // + // [RFC 2317]: https://tools.ietf.org/html/rfc2317 + // + // This member is required. + Cidr *string + + // Indicates whether to block or allow incoming mail from the specified IP + // addresses. + // + // This member is required. + Policy ReceiptFilterPolicy + + noSmithyDocumentSerde +} + +// Receipt rules enable you to specify which actions Amazon SES should take when +// it receives mail on behalf of one or more email addresses or domains that you +// own. +// +// Each receipt rule defines a set of email addresses or domains that it applies +// to. If the email addresses or domains match at least one recipient address of +// the message, Amazon SES executes all of the receipt rule's actions on the +// message. +// +// For information about setting up receipt rules, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html +type ReceiptRule struct { + + // The name of the receipt rule. The name must meet the following requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), + // dashes (-), or periods (.). + // + // - Start and end with a letter or number. + // + // - Contain 64 characters or fewer. + // + // This member is required. + Name *string + + // An ordered list of actions to perform on messages that match at least one of + // the recipient email addresses or domains specified in the receipt rule. + Actions []ReceiptAction + + // If true , the receipt rule is active. The default value is false . + Enabled bool + + // The recipient domains and email addresses that the receipt rule applies to. If + // this field is not specified, this rule matches all recipients on all verified + // domains. + Recipients []string + + // If true , then messages that this receipt rule applies to are scanned for spam + // and viruses. The default value is false . + ScanEnabled bool + + // Specifies whether Amazon SES should require that incoming email is delivered + // over a connection encrypted with Transport Layer Security (TLS). If this + // parameter is set to Require , Amazon SES bounces emails that are not received + // over TLS. The default is Optional . + TlsPolicy TlsPolicy + + noSmithyDocumentSerde +} + +// Information about a receipt rule set. +// +// A receipt rule set is a collection of rules that specify what Amazon SES should +// do with mail it receives on behalf of your account's verified domains. +// +// For information about setting up receipt rule sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-concepts.html#receiving-email-concepts-rules +type ReceiptRuleSetMetadata struct { + + // The date and time the receipt rule set was created. + CreatedTimestamp *time.Time + + // The name of the receipt rule set. The name must meet the following requirements: + // + // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or + // dashes (-). + // + // - Start and end with a letter or number. + // + // - Contain 64 characters or fewer. + Name *string + + noSmithyDocumentSerde +} + +// Recipient-related information to include in the Delivery Status Notification +// (DSN) when an email that Amazon SES receives on your behalf bounces. +// +// For information about receiving email through Amazon SES, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email.html +type RecipientDsnFields struct { + + // The action performed by the reporting mail transfer agent (MTA) as a result of + // its attempt to deliver the message to the recipient address. This is required by + // [RFC 3464]. + // + // [RFC 3464]: https://tools.ietf.org/html/rfc3464 + // + // This member is required. + Action DsnAction + + // The status code that indicates what went wrong. This is required by [RFC 3464]. + // + // [RFC 3464]: https://tools.ietf.org/html/rfc3464 + // + // This member is required. + Status *string + + // An extended explanation of what went wrong; this is usually an SMTP response. + // See [RFC 3463]for the correct formatting of this parameter. + // + // [RFC 3463]: https://tools.ietf.org/html/rfc3463 + DiagnosticCode *string + + // Additional X-headers to include in the DSN. + ExtensionFields []ExtensionField + + // The email address that the message was ultimately delivered to. This + // corresponds to the Final-Recipient in the DSN. If not specified, FinalRecipient + // is set to the Recipient specified in the BouncedRecipientInfo structure. Either + // FinalRecipient or the recipient in BouncedRecipientInfo must be a recipient of + // the original bounced message. + // + // Do not prepend the FinalRecipient email address with rfc 822; , as described in [RFC 3798] + // . + // + // [RFC 3798]: https://tools.ietf.org/html/rfc3798 + FinalRecipient *string + + // The time the final delivery attempt was made, in [RFC 822] date-time format. + // + // [RFC 822]: https://www.ietf.org/rfc/rfc0822.txt + LastAttemptDate *time.Time + + // The MTA to which the remote MTA attempted to deliver the message, formatted as + // specified in [RFC 3464]( mta-name-type; mta-name ). This parameter typically applies only + // to propagating synchronous bounces. + // + // [RFC 3464]: https://tools.ietf.org/html/rfc3464 + RemoteMta *string + + noSmithyDocumentSerde +} + +// Contains information about the reputation settings for a configuration set. +type ReputationOptions struct { + + // The date and time at which the reputation metrics for the configuration set + // were last reset. Resetting these metrics is known as a fresh start. + // + // When you disable email sending for a configuration set using UpdateConfigurationSetSendingEnabled and later + // re-enable it, the reputation metrics for the configuration set (but not for the + // entire Amazon SES account) are reset. + // + // If email sending for the configuration set has never been disabled and later + // re-enabled, the value of this attribute is null . + LastFreshStart *time.Time + + // Describes whether or not Amazon SES publishes reputation metrics for the + // configuration set, such as bounce and complaint rates, to Amazon CloudWatch. + // + // If the value is true , reputation metrics are published. If the value is false , + // reputation metrics are not published. The default value is false . + ReputationMetricsEnabled bool + + // Describes whether email sending is enabled or disabled for the configuration + // set. If the value is true , then Amazon SES sends emails that use the + // configuration set. If the value is false , Amazon SES does not send emails that + // use the configuration set. The default value is true . You can change this + // setting using UpdateConfigurationSetSendingEnabled. + SendingEnabled bool + + noSmithyDocumentSerde +} + +// When included in a receipt rule, this action saves the received message to an +// Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a +// notification to Amazon Simple Notification Service (Amazon SNS). +// +// To enable Amazon SES to write emails to your Amazon S3 bucket, use an Amazon +// Web Services KMS key to encrypt your emails, or publish to an Amazon SNS topic +// of another account, Amazon SES must have permission to access those resources. +// For information about granting permissions, see the [Amazon SES Developer Guide]. +// +// When you save your emails to an Amazon S3 bucket, the maximum email size +// (including headers) is 40 MB. Emails larger than that bounces. +// +// For information about specifying Amazon S3 actions in receipt rules, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-s3.html +type S3Action struct { + + // The name of the Amazon S3 bucket for incoming email. + // + // This member is required. + BucketName *string + + // The customer master key that Amazon SES should use to encrypt your emails + // before saving them to the Amazon S3 bucket. You can use the default master key + // or a custom master key that you created in Amazon Web Services KMS as follows: + // + // - To use the default master key, provide an ARN in the form of + // arn:aws:kms:REGION:ACCOUNT-ID-WITHOUT-HYPHENS:alias/aws/ses . For example, if + // your Amazon Web Services account ID is 123456789012 and you want to use the + // default master key in the US West (Oregon) Region, the ARN of the default master + // key would be arn:aws:kms:us-west-2:123456789012:alias/aws/ses . If you use the + // default master key, you don't need to perform any extra steps to give Amazon SES + // permission to use the key. + // + // - To use a custom master key that you created in Amazon Web Services KMS, + // provide the ARN of the master key and ensure that you add a statement to your + // key's policy to give Amazon SES permission to use it. For more information about + // giving permissions, see the [Amazon SES Developer Guide]. + // + // For more information about key policies, see the [Amazon Web Services KMS Developer Guide]. If you do not specify a + // master key, Amazon SES does not encrypt your emails. + // + // Your mail is encrypted by Amazon SES using the Amazon S3 encryption client + // before the mail is submitted to Amazon S3 for storage. It is not encrypted using + // Amazon S3 server-side encryption. This means that you must use the Amazon S3 + // encryption client to decrypt the email after retrieving it from Amazon S3, as + // the service has no access to use your Amazon Web Services KMS keys for + // decryption. This encryption client is currently available with the [Amazon Web Services SDK for Java]and [Amazon Web Services SDK for Ruby] only. + // For more information about client-side encryption using Amazon Web Services KMS + // master keys, see the [Amazon S3 Developer Guide]. + // + // [Amazon Web Services KMS Developer Guide]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html + // [Amazon Web Services SDK for Ruby]: http://aws.amazon.com/sdk-for-ruby/ + // [Amazon S3 Developer Guide]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html + // [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-permissions.html + // [Amazon Web Services SDK for Java]: http://aws.amazon.com/sdk-for-java/ + KmsKeyArn *string + + // The key prefix of the Amazon S3 bucket. The key prefix is similar to a + // directory name that enables you to store similar data under the same directory + // in a bucket. + ObjectKeyPrefix *string + + // The ARN of the Amazon SNS topic to notify when the message is saved to the + // Amazon S3 bucket. You can find the ARN of a topic by using the [ListTopics]operation in + // Amazon SNS. + // + // For more information about Amazon SNS topics, see the [Amazon SNS Developer Guide]. + // + // [ListTopics]: https://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html + // [Amazon SNS Developer Guide]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html + TopicArn *string + + noSmithyDocumentSerde +} + +// Represents sending statistics data. Each SendDataPoint contains statistics for +// a 15-minute period of sending activity. +type SendDataPoint struct { + + // Number of emails that have bounced. + Bounces int64 + + // Number of unwanted emails that were rejected by recipients. + Complaints int64 + + // Number of emails that have been sent. + DeliveryAttempts int64 + + // Number of emails rejected by Amazon SES. + Rejects int64 + + // Time of the data point. + Timestamp *time.Time + + noSmithyDocumentSerde +} + +// When included in a receipt rule, this action publishes a notification to Amazon +// Simple Notification Service (Amazon SNS). This action includes a complete copy +// of the email content in the Amazon SNS notifications. Amazon SNS notifications +// for all other actions simply provide information about the email. They do not +// include the email content itself. +// +// If you own the Amazon SNS topic, you don't need to do anything to give Amazon +// SES permission to publish emails to it. However, if you don't own the Amazon SNS +// topic, you need to attach a policy to the topic to give Amazon SES permissions +// to access it. For information about giving permissions, see the [Amazon SES Developer Guide]. +// +// You can only publish emails that are 150 KB or less (including the header) to +// Amazon SNS. Larger emails bounce. If you anticipate emails larger than 150 KB, +// use the S3 action instead. +// +// For information about using a receipt rule to publish an Amazon SNS +// notification, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-sns.html +type SNSAction struct { + + // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify. You can find + // the ARN of a topic by using the [ListTopics]operation in Amazon SNS. + // + // For more information about Amazon SNS topics, see the [Amazon SNS Developer Guide]. + // + // [ListTopics]: https://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html + // [Amazon SNS Developer Guide]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html + // + // This member is required. + TopicArn *string + + // The encoding to use for the email within the Amazon SNS notification. UTF-8 is + // easier to use, but may not preserve all special characters when a message was + // encoded with a different encoding format. Base64 preserves all special + // characters. The default value is UTF-8. + Encoding SNSActionEncoding + + noSmithyDocumentSerde +} + +// Contains the topic ARN associated with an Amazon Simple Notification Service +// (Amazon SNS) event destination. +// +// Event destinations, such as Amazon SNS, are associated with configuration sets, +// which enable you to publish email sending events. For information about using +// configuration sets, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html +type SNSDestination struct { + + // The ARN of the Amazon SNS topic for email sending events. You can find the ARN + // of a topic by using the [ListTopics]Amazon SNS operation. + // + // For more information about Amazon SNS topics, see the [Amazon SNS Developer Guide]. + // + // [ListTopics]: https://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html + // [Amazon SNS Developer Guide]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html + // + // This member is required. + TopicARN *string + + noSmithyDocumentSerde +} + +// When included in a receipt rule, this action terminates the evaluation of the +// receipt rule set and, optionally, publishes a notification to Amazon Simple +// Notification Service (Amazon SNS). +// +// For information about setting a stop action in a receipt rule, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-stop.html +type StopAction struct { + + // The scope of the StopAction. The only acceptable value is RuleSet . + // + // This member is required. + Scope StopScope + + // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the stop + // action is taken. You can find the ARN of a topic by using the [ListTopics]Amazon SNS + // operation. + // + // For more information about Amazon SNS topics, see the [Amazon SNS Developer Guide]. + // + // [ListTopics]: https://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html + // [Amazon SNS Developer Guide]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html + TopicArn *string + + noSmithyDocumentSerde +} + +// The content of the email, composed of a subject line and either an HTML part or +// a text-only part. +type Template struct { + + // The name of the template. You use this name when you send email using the + // SendTemplatedEmail or SendBulkTemplatedEmail operations. + // + // This member is required. + TemplateName *string + + // The HTML body of the email. + HtmlPart *string + + // The subject line of the email. + SubjectPart *string + + // The email body that is visible to recipients whose email clients do not display + // HTML content. + TextPart *string + + noSmithyDocumentSerde +} + +// Contains information about an email template. +type TemplateMetadata struct { + + // The time and date the template was created. + CreatedTimestamp *time.Time + + // The name of the template. + Name *string + + noSmithyDocumentSerde +} + +// A domain that is used to redirect email recipients to an Amazon SES-operated +// domain. This domain captures open and click events generated by Amazon SES +// emails. +// +// For more information, see [Configuring Custom Domains to Handle Open and Click Tracking] in the Amazon SES Developer Guide. +// +// [Configuring Custom Domains to Handle Open and Click Tracking]: https://docs.aws.amazon.com/ses/latest/dg/configure-custom-open-click-domains.html +type TrackingOptions struct { + + // The custom subdomain that is used to redirect email recipients to the Amazon + // SES event tracking domain. + CustomRedirectDomain *string + + noSmithyDocumentSerde +} + +// When included in a receipt rule, this action calls Amazon WorkMail and, +// optionally, publishes a notification to Amazon Simple Notification Service +// (Amazon SNS). It usually isn't necessary to set this up manually, because Amazon +// WorkMail adds the rule automatically during its setup procedure. +// +// For information using a receipt rule to call Amazon WorkMail, see the [Amazon SES Developer Guide]. +// +// [Amazon SES Developer Guide]: https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-workmail.html +type WorkmailAction struct { + + // The Amazon Resource Name (ARN) of the Amazon WorkMail organization. Amazon + // WorkMail ARNs use the following format: + // + // arn:aws:workmail:::organization/ + // + // You can find the ID of your organization by using the [ListOrganizations] operation in Amazon + // WorkMail. Amazon WorkMail organization IDs begin with " m- ", followed by a + // string of alphanumeric characters. + // + // For information about Amazon WorkMail organizations, see the [Amazon WorkMail Administrator Guide]. + // + // [ListOrganizations]: https://docs.aws.amazon.com/workmail/latest/APIReference/API_ListOrganizations.html + // [Amazon WorkMail Administrator Guide]: https://docs.aws.amazon.com/workmail/latest/adminguide/organizations_overview.html + // + // This member is required. + OrganizationArn *string + + // The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the + // WorkMail action is called. You can find the ARN of a topic by using the [ListTopics] + // operation in Amazon SNS. + // + // For more information about Amazon SNS topics, see the [Amazon SNS Developer Guide]. + // + // [ListTopics]: https://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html + // [Amazon SNS Developer Guide]: https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html + TopicArn *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ses/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/validators.go new file mode 100644 index 00000000..304c046d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ses/validators.go @@ -0,0 +1,3104 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCloneReceiptRuleSet struct { +} + +func (*validateOpCloneReceiptRuleSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCloneReceiptRuleSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CloneReceiptRuleSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCloneReceiptRuleSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateConfigurationSetEventDestination struct { +} + +func (*validateOpCreateConfigurationSetEventDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateConfigurationSetEventDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateConfigurationSetEventDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateConfigurationSetEventDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateConfigurationSet struct { +} + +func (*validateOpCreateConfigurationSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateConfigurationSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateConfigurationSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateConfigurationSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateConfigurationSetTrackingOptions struct { +} + +func (*validateOpCreateConfigurationSetTrackingOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateConfigurationSetTrackingOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateConfigurationSetTrackingOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateConfigurationSetTrackingOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateCustomVerificationEmailTemplate struct { +} + +func (*validateOpCreateCustomVerificationEmailTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateCustomVerificationEmailTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateCustomVerificationEmailTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateReceiptFilter struct { +} + +func (*validateOpCreateReceiptFilter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateReceiptFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateReceiptFilterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateReceiptFilterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateReceiptRule struct { +} + +func (*validateOpCreateReceiptRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateReceiptRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateReceiptRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateReceiptRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateReceiptRuleSet struct { +} + +func (*validateOpCreateReceiptRuleSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateReceiptRuleSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateReceiptRuleSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateReceiptRuleSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateTemplate struct { +} + +func (*validateOpCreateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteConfigurationSetEventDestination struct { +} + +func (*validateOpDeleteConfigurationSetEventDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteConfigurationSetEventDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteConfigurationSetEventDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteConfigurationSetEventDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteConfigurationSet struct { +} + +func (*validateOpDeleteConfigurationSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteConfigurationSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteConfigurationSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteConfigurationSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteConfigurationSetTrackingOptions struct { +} + +func (*validateOpDeleteConfigurationSetTrackingOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteConfigurationSetTrackingOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteConfigurationSetTrackingOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteConfigurationSetTrackingOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCustomVerificationEmailTemplate struct { +} + +func (*validateOpDeleteCustomVerificationEmailTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCustomVerificationEmailTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCustomVerificationEmailTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteIdentity struct { +} + +func (*validateOpDeleteIdentity) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIdentityInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIdentityInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteIdentityPolicy struct { +} + +func (*validateOpDeleteIdentityPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIdentityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIdentityPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIdentityPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteReceiptFilter struct { +} + +func (*validateOpDeleteReceiptFilter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteReceiptFilter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteReceiptFilterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteReceiptFilterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteReceiptRule struct { +} + +func (*validateOpDeleteReceiptRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteReceiptRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteReceiptRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteReceiptRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteReceiptRuleSet struct { +} + +func (*validateOpDeleteReceiptRuleSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteReceiptRuleSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteReceiptRuleSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteReceiptRuleSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteTemplate struct { +} + +func (*validateOpDeleteTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVerifiedEmailAddress struct { +} + +func (*validateOpDeleteVerifiedEmailAddress) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVerifiedEmailAddress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVerifiedEmailAddressInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVerifiedEmailAddressInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeConfigurationSet struct { +} + +func (*validateOpDescribeConfigurationSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeConfigurationSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeConfigurationSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeConfigurationSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeReceiptRule struct { +} + +func (*validateOpDescribeReceiptRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeReceiptRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeReceiptRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeReceiptRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeReceiptRuleSet struct { +} + +func (*validateOpDescribeReceiptRuleSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeReceiptRuleSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeReceiptRuleSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeReceiptRuleSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCustomVerificationEmailTemplate struct { +} + +func (*validateOpGetCustomVerificationEmailTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCustomVerificationEmailTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCustomVerificationEmailTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetIdentityDkimAttributes struct { +} + +func (*validateOpGetIdentityDkimAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIdentityDkimAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIdentityDkimAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIdentityDkimAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetIdentityMailFromDomainAttributes struct { +} + +func (*validateOpGetIdentityMailFromDomainAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIdentityMailFromDomainAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIdentityMailFromDomainAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIdentityMailFromDomainAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetIdentityNotificationAttributes struct { +} + +func (*validateOpGetIdentityNotificationAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIdentityNotificationAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIdentityNotificationAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIdentityNotificationAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetIdentityPolicies struct { +} + +func (*validateOpGetIdentityPolicies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIdentityPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIdentityPoliciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIdentityPoliciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetIdentityVerificationAttributes struct { +} + +func (*validateOpGetIdentityVerificationAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIdentityVerificationAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIdentityVerificationAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIdentityVerificationAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTemplate struct { +} + +func (*validateOpGetTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListIdentityPolicies struct { +} + +func (*validateOpListIdentityPolicies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListIdentityPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListIdentityPoliciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListIdentityPoliciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutConfigurationSetDeliveryOptions struct { +} + +func (*validateOpPutConfigurationSetDeliveryOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutConfigurationSetDeliveryOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutConfigurationSetDeliveryOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutConfigurationSetDeliveryOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutIdentityPolicy struct { +} + +func (*validateOpPutIdentityPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutIdentityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutIdentityPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutIdentityPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpReorderReceiptRuleSet struct { +} + +func (*validateOpReorderReceiptRuleSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpReorderReceiptRuleSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ReorderReceiptRuleSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpReorderReceiptRuleSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendBounce struct { +} + +func (*validateOpSendBounce) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendBounce) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendBounceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendBounceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendBulkTemplatedEmail struct { +} + +func (*validateOpSendBulkTemplatedEmail) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendBulkTemplatedEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendBulkTemplatedEmailInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendBulkTemplatedEmailInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendCustomVerificationEmail struct { +} + +func (*validateOpSendCustomVerificationEmail) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendCustomVerificationEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendCustomVerificationEmailInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendCustomVerificationEmailInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendEmail struct { +} + +func (*validateOpSendEmail) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendEmailInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendEmailInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendRawEmail struct { +} + +func (*validateOpSendRawEmail) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendRawEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendRawEmailInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendRawEmailInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendTemplatedEmail struct { +} + +func (*validateOpSendTemplatedEmail) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendTemplatedEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendTemplatedEmailInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendTemplatedEmailInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetIdentityDkimEnabled struct { +} + +func (*validateOpSetIdentityDkimEnabled) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetIdentityDkimEnabled) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetIdentityDkimEnabledInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetIdentityDkimEnabledInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetIdentityFeedbackForwardingEnabled struct { +} + +func (*validateOpSetIdentityFeedbackForwardingEnabled) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetIdentityFeedbackForwardingEnabled) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetIdentityFeedbackForwardingEnabledInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetIdentityFeedbackForwardingEnabledInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetIdentityHeadersInNotificationsEnabled struct { +} + +func (*validateOpSetIdentityHeadersInNotificationsEnabled) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetIdentityHeadersInNotificationsEnabled) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetIdentityHeadersInNotificationsEnabledInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetIdentityHeadersInNotificationsEnabledInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetIdentityMailFromDomain struct { +} + +func (*validateOpSetIdentityMailFromDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetIdentityMailFromDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetIdentityMailFromDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetIdentityMailFromDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetIdentityNotificationTopic struct { +} + +func (*validateOpSetIdentityNotificationTopic) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetIdentityNotificationTopic) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetIdentityNotificationTopicInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetIdentityNotificationTopicInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetReceiptRulePosition struct { +} + +func (*validateOpSetReceiptRulePosition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetReceiptRulePosition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetReceiptRulePositionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetReceiptRulePositionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTestRenderTemplate struct { +} + +func (*validateOpTestRenderTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTestRenderTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TestRenderTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTestRenderTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateConfigurationSetEventDestination struct { +} + +func (*validateOpUpdateConfigurationSetEventDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateConfigurationSetEventDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateConfigurationSetEventDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateConfigurationSetEventDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateConfigurationSetReputationMetricsEnabled struct { +} + +func (*validateOpUpdateConfigurationSetReputationMetricsEnabled) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateConfigurationSetReputationMetricsEnabled) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateConfigurationSetReputationMetricsEnabledInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateConfigurationSetReputationMetricsEnabledInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateConfigurationSetSendingEnabled struct { +} + +func (*validateOpUpdateConfigurationSetSendingEnabled) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateConfigurationSetSendingEnabled) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateConfigurationSetSendingEnabledInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateConfigurationSetSendingEnabledInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateConfigurationSetTrackingOptions struct { +} + +func (*validateOpUpdateConfigurationSetTrackingOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateConfigurationSetTrackingOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateConfigurationSetTrackingOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateConfigurationSetTrackingOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCustomVerificationEmailTemplate struct { +} + +func (*validateOpUpdateCustomVerificationEmailTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCustomVerificationEmailTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCustomVerificationEmailTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateReceiptRule struct { +} + +func (*validateOpUpdateReceiptRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateReceiptRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateReceiptRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateReceiptRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateTemplate struct { +} + +func (*validateOpUpdateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpVerifyDomainDkim struct { +} + +func (*validateOpVerifyDomainDkim) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpVerifyDomainDkim) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*VerifyDomainDkimInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpVerifyDomainDkimInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpVerifyDomainIdentity struct { +} + +func (*validateOpVerifyDomainIdentity) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpVerifyDomainIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*VerifyDomainIdentityInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpVerifyDomainIdentityInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpVerifyEmailAddress struct { +} + +func (*validateOpVerifyEmailAddress) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpVerifyEmailAddress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*VerifyEmailAddressInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpVerifyEmailAddressInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpVerifyEmailIdentity struct { +} + +func (*validateOpVerifyEmailIdentity) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpVerifyEmailIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*VerifyEmailIdentityInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpVerifyEmailIdentityInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCloneReceiptRuleSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCloneReceiptRuleSet{}, middleware.After) +} + +func addOpCreateConfigurationSetEventDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateConfigurationSetEventDestination{}, middleware.After) +} + +func addOpCreateConfigurationSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateConfigurationSet{}, middleware.After) +} + +func addOpCreateConfigurationSetTrackingOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateConfigurationSetTrackingOptions{}, middleware.After) +} + +func addOpCreateCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateCustomVerificationEmailTemplate{}, middleware.After) +} + +func addOpCreateReceiptFilterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateReceiptFilter{}, middleware.After) +} + +func addOpCreateReceiptRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateReceiptRule{}, middleware.After) +} + +func addOpCreateReceiptRuleSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateReceiptRuleSet{}, middleware.After) +} + +func addOpCreateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTemplate{}, middleware.After) +} + +func addOpDeleteConfigurationSetEventDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteConfigurationSetEventDestination{}, middleware.After) +} + +func addOpDeleteConfigurationSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteConfigurationSet{}, middleware.After) +} + +func addOpDeleteConfigurationSetTrackingOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteConfigurationSetTrackingOptions{}, middleware.After) +} + +func addOpDeleteCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCustomVerificationEmailTemplate{}, middleware.After) +} + +func addOpDeleteIdentityValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIdentity{}, middleware.After) +} + +func addOpDeleteIdentityPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIdentityPolicy{}, middleware.After) +} + +func addOpDeleteReceiptFilterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteReceiptFilter{}, middleware.After) +} + +func addOpDeleteReceiptRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteReceiptRule{}, middleware.After) +} + +func addOpDeleteReceiptRuleSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteReceiptRuleSet{}, middleware.After) +} + +func addOpDeleteTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteTemplate{}, middleware.After) +} + +func addOpDeleteVerifiedEmailAddressValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVerifiedEmailAddress{}, middleware.After) +} + +func addOpDescribeConfigurationSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeConfigurationSet{}, middleware.After) +} + +func addOpDescribeReceiptRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeReceiptRule{}, middleware.After) +} + +func addOpDescribeReceiptRuleSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeReceiptRuleSet{}, middleware.After) +} + +func addOpGetCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCustomVerificationEmailTemplate{}, middleware.After) +} + +func addOpGetIdentityDkimAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIdentityDkimAttributes{}, middleware.After) +} + +func addOpGetIdentityMailFromDomainAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIdentityMailFromDomainAttributes{}, middleware.After) +} + +func addOpGetIdentityNotificationAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIdentityNotificationAttributes{}, middleware.After) +} + +func addOpGetIdentityPoliciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIdentityPolicies{}, middleware.After) +} + +func addOpGetIdentityVerificationAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIdentityVerificationAttributes{}, middleware.After) +} + +func addOpGetTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTemplate{}, middleware.After) +} + +func addOpListIdentityPoliciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListIdentityPolicies{}, middleware.After) +} + +func addOpPutConfigurationSetDeliveryOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutConfigurationSetDeliveryOptions{}, middleware.After) +} + +func addOpPutIdentityPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutIdentityPolicy{}, middleware.After) +} + +func addOpReorderReceiptRuleSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpReorderReceiptRuleSet{}, middleware.After) +} + +func addOpSendBounceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendBounce{}, middleware.After) +} + +func addOpSendBulkTemplatedEmailValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendBulkTemplatedEmail{}, middleware.After) +} + +func addOpSendCustomVerificationEmailValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendCustomVerificationEmail{}, middleware.After) +} + +func addOpSendEmailValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendEmail{}, middleware.After) +} + +func addOpSendRawEmailValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendRawEmail{}, middleware.After) +} + +func addOpSendTemplatedEmailValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendTemplatedEmail{}, middleware.After) +} + +func addOpSetIdentityDkimEnabledValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetIdentityDkimEnabled{}, middleware.After) +} + +func addOpSetIdentityFeedbackForwardingEnabledValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetIdentityFeedbackForwardingEnabled{}, middleware.After) +} + +func addOpSetIdentityHeadersInNotificationsEnabledValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetIdentityHeadersInNotificationsEnabled{}, middleware.After) +} + +func addOpSetIdentityMailFromDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetIdentityMailFromDomain{}, middleware.After) +} + +func addOpSetIdentityNotificationTopicValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetIdentityNotificationTopic{}, middleware.After) +} + +func addOpSetReceiptRulePositionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetReceiptRulePosition{}, middleware.After) +} + +func addOpTestRenderTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTestRenderTemplate{}, middleware.After) +} + +func addOpUpdateConfigurationSetEventDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateConfigurationSetEventDestination{}, middleware.After) +} + +func addOpUpdateConfigurationSetReputationMetricsEnabledValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateConfigurationSetReputationMetricsEnabled{}, middleware.After) +} + +func addOpUpdateConfigurationSetSendingEnabledValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateConfigurationSetSendingEnabled{}, middleware.After) +} + +func addOpUpdateConfigurationSetTrackingOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateConfigurationSetTrackingOptions{}, middleware.After) +} + +func addOpUpdateCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCustomVerificationEmailTemplate{}, middleware.After) +} + +func addOpUpdateReceiptRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateReceiptRule{}, middleware.After) +} + +func addOpUpdateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateTemplate{}, middleware.After) +} + +func addOpVerifyDomainDkimValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpVerifyDomainDkim{}, middleware.After) +} + +func addOpVerifyDomainIdentityValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpVerifyDomainIdentity{}, middleware.After) +} + +func addOpVerifyEmailAddressValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpVerifyEmailAddress{}, middleware.After) +} + +func addOpVerifyEmailIdentityValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpVerifyEmailIdentity{}, middleware.After) +} + +func validateAddHeaderAction(v *types.AddHeaderAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddHeaderAction"} + if v.HeaderName == nil { + invalidParams.Add(smithy.NewErrParamRequired("HeaderName")) + } + if v.HeaderValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("HeaderValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBody(v *types.Body) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Body"} + if v.Text != nil { + if err := validateContent(v.Text); err != nil { + invalidParams.AddNested("Text", err.(smithy.InvalidParamsError)) + } + } + if v.Html != nil { + if err := validateContent(v.Html); err != nil { + invalidParams.AddNested("Html", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBounceAction(v *types.BounceAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BounceAction"} + if v.SmtpReplyCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("SmtpReplyCode")) + } + if v.Message == nil { + invalidParams.Add(smithy.NewErrParamRequired("Message")) + } + if v.Sender == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sender")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBouncedRecipientInfo(v *types.BouncedRecipientInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BouncedRecipientInfo"} + if v.Recipient == nil { + invalidParams.Add(smithy.NewErrParamRequired("Recipient")) + } + if v.RecipientDsnFields != nil { + if err := validateRecipientDsnFields(v.RecipientDsnFields); err != nil { + invalidParams.AddNested("RecipientDsnFields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBouncedRecipientInfoList(v []types.BouncedRecipientInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BouncedRecipientInfoList"} + for i := range v { + if err := validateBouncedRecipientInfo(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBulkEmailDestination(v *types.BulkEmailDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BulkEmailDestination"} + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if v.ReplacementTags != nil { + if err := validateMessageTagList(v.ReplacementTags); err != nil { + invalidParams.AddNested("ReplacementTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBulkEmailDestinationList(v []types.BulkEmailDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BulkEmailDestinationList"} + for i := range v { + if err := validateBulkEmailDestination(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCloudWatchDestination(v *types.CloudWatchDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CloudWatchDestination"} + if v.DimensionConfigurations == nil { + invalidParams.Add(smithy.NewErrParamRequired("DimensionConfigurations")) + } else if v.DimensionConfigurations != nil { + if err := validateCloudWatchDimensionConfigurations(v.DimensionConfigurations); err != nil { + invalidParams.AddNested("DimensionConfigurations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCloudWatchDimensionConfiguration(v *types.CloudWatchDimensionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CloudWatchDimensionConfiguration"} + if v.DimensionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DimensionName")) + } + if len(v.DimensionValueSource) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DimensionValueSource")) + } + if v.DefaultDimensionValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultDimensionValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCloudWatchDimensionConfigurations(v []types.CloudWatchDimensionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CloudWatchDimensionConfigurations"} + for i := range v { + if err := validateCloudWatchDimensionConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConfigurationSet(v *types.ConfigurationSet) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConfigurationSet"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateContent(v *types.Content) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Content"} + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEventDestination(v *types.EventDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventDestination"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.MatchingEventTypes == nil { + invalidParams.Add(smithy.NewErrParamRequired("MatchingEventTypes")) + } + if v.KinesisFirehoseDestination != nil { + if err := validateKinesisFirehoseDestination(v.KinesisFirehoseDestination); err != nil { + invalidParams.AddNested("KinesisFirehoseDestination", err.(smithy.InvalidParamsError)) + } + } + if v.CloudWatchDestination != nil { + if err := validateCloudWatchDestination(v.CloudWatchDestination); err != nil { + invalidParams.AddNested("CloudWatchDestination", err.(smithy.InvalidParamsError)) + } + } + if v.SNSDestination != nil { + if err := validateSNSDestination(v.SNSDestination); err != nil { + invalidParams.AddNested("SNSDestination", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateExtensionField(v *types.ExtensionField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExtensionField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateExtensionFieldList(v []types.ExtensionField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExtensionFieldList"} + for i := range v { + if err := validateExtensionField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKinesisFirehoseDestination(v *types.KinesisFirehoseDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KinesisFirehoseDestination"} + if v.IAMRoleARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("IAMRoleARN")) + } + if v.DeliveryStreamARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaAction(v *types.LambdaAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaAction"} + if v.FunctionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("FunctionArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMessage(v *types.Message) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Message"} + if v.Subject == nil { + invalidParams.Add(smithy.NewErrParamRequired("Subject")) + } else if v.Subject != nil { + if err := validateContent(v.Subject); err != nil { + invalidParams.AddNested("Subject", err.(smithy.InvalidParamsError)) + } + } + if v.Body == nil { + invalidParams.Add(smithy.NewErrParamRequired("Body")) + } else if v.Body != nil { + if err := validateBody(v.Body); err != nil { + invalidParams.AddNested("Body", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMessageDsn(v *types.MessageDsn) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MessageDsn"} + if v.ReportingMta == nil { + invalidParams.Add(smithy.NewErrParamRequired("ReportingMta")) + } + if v.ExtensionFields != nil { + if err := validateExtensionFieldList(v.ExtensionFields); err != nil { + invalidParams.AddNested("ExtensionFields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMessageTag(v *types.MessageTag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MessageTag"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMessageTagList(v []types.MessageTag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MessageTagList"} + for i := range v { + if err := validateMessageTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRawMessage(v *types.RawMessage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RawMessage"} + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateReceiptAction(v *types.ReceiptAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReceiptAction"} + if v.S3Action != nil { + if err := validateS3Action(v.S3Action); err != nil { + invalidParams.AddNested("S3Action", err.(smithy.InvalidParamsError)) + } + } + if v.BounceAction != nil { + if err := validateBounceAction(v.BounceAction); err != nil { + invalidParams.AddNested("BounceAction", err.(smithy.InvalidParamsError)) + } + } + if v.WorkmailAction != nil { + if err := validateWorkmailAction(v.WorkmailAction); err != nil { + invalidParams.AddNested("WorkmailAction", err.(smithy.InvalidParamsError)) + } + } + if v.LambdaAction != nil { + if err := validateLambdaAction(v.LambdaAction); err != nil { + invalidParams.AddNested("LambdaAction", err.(smithy.InvalidParamsError)) + } + } + if v.StopAction != nil { + if err := validateStopAction(v.StopAction); err != nil { + invalidParams.AddNested("StopAction", err.(smithy.InvalidParamsError)) + } + } + if v.AddHeaderAction != nil { + if err := validateAddHeaderAction(v.AddHeaderAction); err != nil { + invalidParams.AddNested("AddHeaderAction", err.(smithy.InvalidParamsError)) + } + } + if v.SNSAction != nil { + if err := validateSNSAction(v.SNSAction); err != nil { + invalidParams.AddNested("SNSAction", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateReceiptActionsList(v []types.ReceiptAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReceiptActionsList"} + for i := range v { + if err := validateReceiptAction(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateReceiptFilter(v *types.ReceiptFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReceiptFilter"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.IpFilter == nil { + invalidParams.Add(smithy.NewErrParamRequired("IpFilter")) + } else if v.IpFilter != nil { + if err := validateReceiptIpFilter(v.IpFilter); err != nil { + invalidParams.AddNested("IpFilter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateReceiptIpFilter(v *types.ReceiptIpFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReceiptIpFilter"} + if len(v.Policy) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if v.Cidr == nil { + invalidParams.Add(smithy.NewErrParamRequired("Cidr")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateReceiptRule(v *types.ReceiptRule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReceiptRule"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Actions != nil { + if err := validateReceiptActionsList(v.Actions); err != nil { + invalidParams.AddNested("Actions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecipientDsnFields(v *types.RecipientDsnFields) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecipientDsnFields"} + if len(v.Action) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } + if v.Status == nil { + invalidParams.Add(smithy.NewErrParamRequired("Status")) + } + if v.ExtensionFields != nil { + if err := validateExtensionFieldList(v.ExtensionFields); err != nil { + invalidParams.AddNested("ExtensionFields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateS3Action(v *types.S3Action) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3Action"} + if v.BucketName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BucketName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSNSAction(v *types.SNSAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SNSAction"} + if v.TopicArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TopicArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSNSDestination(v *types.SNSDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SNSDestination"} + if v.TopicARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("TopicARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStopAction(v *types.StopAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopAction"} + if len(v.Scope) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Scope")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTemplate(v *types.Template) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Template"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWorkmailAction(v *types.WorkmailAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WorkmailAction"} + if v.OrganizationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCloneReceiptRuleSetInput(v *CloneReceiptRuleSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CloneReceiptRuleSetInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if v.OriginalRuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("OriginalRuleSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateConfigurationSetEventDestinationInput(v *CreateConfigurationSetEventDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationSetEventDestinationInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if v.EventDestination == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventDestination")) + } else if v.EventDestination != nil { + if err := validateEventDestination(v.EventDestination); err != nil { + invalidParams.AddNested("EventDestination", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateConfigurationSetInput(v *CreateConfigurationSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationSetInput"} + if v.ConfigurationSet == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSet")) + } else if v.ConfigurationSet != nil { + if err := validateConfigurationSet(v.ConfigurationSet); err != nil { + invalidParams.AddNested("ConfigurationSet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateConfigurationSetTrackingOptionsInput(v *CreateConfigurationSetTrackingOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationSetTrackingOptionsInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if v.TrackingOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrackingOptions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateCustomVerificationEmailTemplateInput(v *CreateCustomVerificationEmailTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCustomVerificationEmailTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if v.FromEmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("FromEmailAddress")) + } + if v.TemplateSubject == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateSubject")) + } + if v.TemplateContent == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateContent")) + } + if v.SuccessRedirectionURL == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuccessRedirectionURL")) + } + if v.FailureRedirectionURL == nil { + invalidParams.Add(smithy.NewErrParamRequired("FailureRedirectionURL")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateReceiptFilterInput(v *CreateReceiptFilterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateReceiptFilterInput"} + if v.Filter == nil { + invalidParams.Add(smithy.NewErrParamRequired("Filter")) + } else if v.Filter != nil { + if err := validateReceiptFilter(v.Filter); err != nil { + invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateReceiptRuleInput(v *CreateReceiptRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateReceiptRuleInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if v.Rule == nil { + invalidParams.Add(smithy.NewErrParamRequired("Rule")) + } else if v.Rule != nil { + if err := validateReceiptRule(v.Rule); err != nil { + invalidParams.AddNested("Rule", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateReceiptRuleSetInput(v *CreateReceiptRuleSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateReceiptRuleSetInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateTemplateInput(v *CreateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTemplateInput"} + if v.Template == nil { + invalidParams.Add(smithy.NewErrParamRequired("Template")) + } else if v.Template != nil { + if err := validateTemplate(v.Template); err != nil { + invalidParams.AddNested("Template", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteConfigurationSetEventDestinationInput(v *DeleteConfigurationSetEventDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationSetEventDestinationInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if v.EventDestinationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventDestinationName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteConfigurationSetInput(v *DeleteConfigurationSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationSetInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteConfigurationSetTrackingOptionsInput(v *DeleteConfigurationSetTrackingOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationSetTrackingOptionsInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCustomVerificationEmailTemplateInput(v *DeleteCustomVerificationEmailTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomVerificationEmailTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteIdentityInput(v *DeleteIdentityInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIdentityInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteIdentityPolicyInput(v *DeleteIdentityPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIdentityPolicyInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteReceiptFilterInput(v *DeleteReceiptFilterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteReceiptFilterInput"} + if v.FilterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FilterName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteReceiptRuleInput(v *DeleteReceiptRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteReceiptRuleInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if v.RuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteReceiptRuleSetInput(v *DeleteReceiptRuleSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteReceiptRuleSetInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteTemplateInput(v *DeleteTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVerifiedEmailAddressInput(v *DeleteVerifiedEmailAddressInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVerifiedEmailAddressInput"} + if v.EmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmailAddress")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeConfigurationSetInput(v *DescribeConfigurationSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeConfigurationSetInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeReceiptRuleInput(v *DescribeReceiptRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeReceiptRuleInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if v.RuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeReceiptRuleSetInput(v *DescribeReceiptRuleSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeReceiptRuleSetInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCustomVerificationEmailTemplateInput(v *GetCustomVerificationEmailTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCustomVerificationEmailTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetIdentityDkimAttributesInput(v *GetIdentityDkimAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIdentityDkimAttributesInput"} + if v.Identities == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identities")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetIdentityMailFromDomainAttributesInput(v *GetIdentityMailFromDomainAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIdentityMailFromDomainAttributesInput"} + if v.Identities == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identities")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetIdentityNotificationAttributesInput(v *GetIdentityNotificationAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIdentityNotificationAttributesInput"} + if v.Identities == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identities")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetIdentityPoliciesInput(v *GetIdentityPoliciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIdentityPoliciesInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if v.PolicyNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetIdentityVerificationAttributesInput(v *GetIdentityVerificationAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIdentityVerificationAttributesInput"} + if v.Identities == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identities")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTemplateInput(v *GetTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListIdentityPoliciesInput(v *ListIdentityPoliciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListIdentityPoliciesInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutConfigurationSetDeliveryOptionsInput(v *PutConfigurationSetDeliveryOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationSetDeliveryOptionsInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutIdentityPolicyInput(v *PutIdentityPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutIdentityPolicyInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpReorderReceiptRuleSetInput(v *ReorderReceiptRuleSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReorderReceiptRuleSetInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if v.RuleNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendBounceInput(v *SendBounceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendBounceInput"} + if v.OriginalMessageId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OriginalMessageId")) + } + if v.BounceSender == nil { + invalidParams.Add(smithy.NewErrParamRequired("BounceSender")) + } + if v.MessageDsn != nil { + if err := validateMessageDsn(v.MessageDsn); err != nil { + invalidParams.AddNested("MessageDsn", err.(smithy.InvalidParamsError)) + } + } + if v.BouncedRecipientInfoList == nil { + invalidParams.Add(smithy.NewErrParamRequired("BouncedRecipientInfoList")) + } else if v.BouncedRecipientInfoList != nil { + if err := validateBouncedRecipientInfoList(v.BouncedRecipientInfoList); err != nil { + invalidParams.AddNested("BouncedRecipientInfoList", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendBulkTemplatedEmailInput(v *SendBulkTemplatedEmailInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendBulkTemplatedEmailInput"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.DefaultTags != nil { + if err := validateMessageTagList(v.DefaultTags); err != nil { + invalidParams.AddNested("DefaultTags", err.(smithy.InvalidParamsError)) + } + } + if v.Template == nil { + invalidParams.Add(smithy.NewErrParamRequired("Template")) + } + if v.Destinations == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destinations")) + } else if v.Destinations != nil { + if err := validateBulkEmailDestinationList(v.Destinations); err != nil { + invalidParams.AddNested("Destinations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendCustomVerificationEmailInput(v *SendCustomVerificationEmailInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendCustomVerificationEmailInput"} + if v.EmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmailAddress")) + } + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendEmailInput(v *SendEmailInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendEmailInput"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if v.Message == nil { + invalidParams.Add(smithy.NewErrParamRequired("Message")) + } else if v.Message != nil { + if err := validateMessage(v.Message); err != nil { + invalidParams.AddNested("Message", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateMessageTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendRawEmailInput(v *SendRawEmailInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendRawEmailInput"} + if v.RawMessage == nil { + invalidParams.Add(smithy.NewErrParamRequired("RawMessage")) + } else if v.RawMessage != nil { + if err := validateRawMessage(v.RawMessage); err != nil { + invalidParams.AddNested("RawMessage", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateMessageTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendTemplatedEmailInput(v *SendTemplatedEmailInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendTemplatedEmailInput"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if v.Tags != nil { + if err := validateMessageTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if v.Template == nil { + invalidParams.Add(smithy.NewErrParamRequired("Template")) + } + if v.TemplateData == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateData")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetIdentityDkimEnabledInput(v *SetIdentityDkimEnabledInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetIdentityDkimEnabledInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetIdentityFeedbackForwardingEnabledInput(v *SetIdentityFeedbackForwardingEnabledInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetIdentityFeedbackForwardingEnabledInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetIdentityHeadersInNotificationsEnabledInput(v *SetIdentityHeadersInNotificationsEnabledInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetIdentityHeadersInNotificationsEnabledInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if len(v.NotificationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("NotificationType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetIdentityMailFromDomainInput(v *SetIdentityMailFromDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetIdentityMailFromDomainInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetIdentityNotificationTopicInput(v *SetIdentityNotificationTopicInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetIdentityNotificationTopicInput"} + if v.Identity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identity")) + } + if len(v.NotificationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("NotificationType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetReceiptRulePositionInput(v *SetReceiptRulePositionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetReceiptRulePositionInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if v.RuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTestRenderTemplateInput(v *TestRenderTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TestRenderTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if v.TemplateData == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateData")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateConfigurationSetEventDestinationInput(v *UpdateConfigurationSetEventDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationSetEventDestinationInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if v.EventDestination == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventDestination")) + } else if v.EventDestination != nil { + if err := validateEventDestination(v.EventDestination); err != nil { + invalidParams.AddNested("EventDestination", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateConfigurationSetReputationMetricsEnabledInput(v *UpdateConfigurationSetReputationMetricsEnabledInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationSetReputationMetricsEnabledInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateConfigurationSetSendingEnabledInput(v *UpdateConfigurationSetSendingEnabledInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationSetSendingEnabledInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateConfigurationSetTrackingOptionsInput(v *UpdateConfigurationSetTrackingOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationSetTrackingOptionsInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if v.TrackingOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrackingOptions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCustomVerificationEmailTemplateInput(v *UpdateCustomVerificationEmailTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCustomVerificationEmailTemplateInput"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateReceiptRuleInput(v *UpdateReceiptRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateReceiptRuleInput"} + if v.RuleSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleSetName")) + } + if v.Rule == nil { + invalidParams.Add(smithy.NewErrParamRequired("Rule")) + } else if v.Rule != nil { + if err := validateReceiptRule(v.Rule); err != nil { + invalidParams.AddNested("Rule", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateTemplateInput(v *UpdateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateTemplateInput"} + if v.Template == nil { + invalidParams.Add(smithy.NewErrParamRequired("Template")) + } else if v.Template != nil { + if err := validateTemplate(v.Template); err != nil { + invalidParams.AddNested("Template", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpVerifyDomainDkimInput(v *VerifyDomainDkimInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VerifyDomainDkimInput"} + if v.Domain == nil { + invalidParams.Add(smithy.NewErrParamRequired("Domain")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpVerifyDomainIdentityInput(v *VerifyDomainIdentityInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VerifyDomainIdentityInput"} + if v.Domain == nil { + invalidParams.Add(smithy.NewErrParamRequired("Domain")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpVerifyEmailAddressInput(v *VerifyEmailAddressInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VerifyEmailAddressInput"} + if v.EmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmailAddress")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpVerifyEmailIdentityInput(v *VerifyEmailIdentityInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VerifyEmailIdentityInput"} + if v.EmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmailAddress")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go index 4f7b4248..915d5090 100644 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go +++ b/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go @@ -34,8 +34,6 @@ const ( DiffInsert Operation = 1 // DiffEqual item represents an equal diff. DiffEqual Operation = 0 - //IndexSeparator is used to seperate the array indexes in an index string - IndexSeparator = "," ) // Diff represents one diff operation @@ -406,14 +404,11 @@ func (dmp *DiffMatchPatch) DiffLinesToRunes(text1, text2 string) ([]rune, []rune func (dmp *DiffMatchPatch) DiffCharsToLines(diffs []Diff, lineArray []string) []Diff { hydrated := make([]Diff, 0, len(diffs)) for _, aDiff := range diffs { - chars := strings.Split(aDiff.Text, IndexSeparator) - text := make([]string, len(chars)) + runes := []rune(aDiff.Text) + text := make([]string, len(runes)) - for i, r := range chars { - i1, err := strconv.Atoi(r) - if err == nil { - text[i] = lineArray[i1] - } + for i, r := range runes { + text[i] = lineArray[runeToInt(r)] } aDiff.Text = strings.Join(text, "") diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go index 44c43595..eb727bb5 100644 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go +++ b/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go @@ -9,11 +9,16 @@ package diffmatchpatch import ( - "strconv" + "fmt" "strings" "unicode/utf8" ) +const UNICODE_INVALID_RANGE_START = 0xD800 +const UNICODE_INVALID_RANGE_END = 0xDFFF +const UNICODE_INVALID_RANGE_DELTA = UNICODE_INVALID_RANGE_END - UNICODE_INVALID_RANGE_START + 1 +const UNICODE_RANGE_MAX = 0x10FFFF + // unescaper unescapes selected chars for compatibility with JavaScript's encodeURI. // In speed critical applications this could be dropped since the receiving application will certainly decode these fine. Note that this function is case-sensitive. Thus "%3F" would not be unescaped. But this is ok because it is only called with the output of HttpUtility.UrlEncode which returns lowercase hex. Example: "%3f" -> "?", "%24" -> "$", etc. var unescaper = strings.NewReplacer( @@ -93,14 +98,93 @@ func intArrayToString(ns []uint32) string { return "" } - indexSeparator := IndexSeparator[0] - - // Appr. 3 chars per num plus the comma. - b := []byte{} + b := []rune{} for _, n := range ns { - b = strconv.AppendInt(b, int64(n), 10) - b = append(b, indexSeparator) + b = append(b, intToRune(n)) } - b = b[:len(b)-1] return string(b) } + +// These constants define the number of bits representable +// in 1,2,3,4 byte utf8 sequences, respectively. +const ONE_BYTE_BITS = 7 +const TWO_BYTE_BITS = 11 +const THREE_BYTE_BITS = 16 +const FOUR_BYTE_BITS = 21 + +// Helper for getting a sequence of bits from an integer. +func getBits(i uint32, cnt byte, from byte) byte { + return byte((i >> from) & ((1 << cnt) - 1)) +} + +// Converts an integer in the range 0~1112060 into a rune. +// Based on the ranges table in https://en.wikipedia.org/wiki/UTF-8 +func intToRune(i uint32) rune { + if i < (1 << ONE_BYTE_BITS) { + return rune(i) + } + + if i < (1 << TWO_BYTE_BITS) { + r, size := utf8.DecodeRune([]byte{0b11000000 | getBits(i, 5, 6), 0b10000000 | getBits(i, 6, 0)}) + if size != 2 || r == utf8.RuneError { + panic(fmt.Sprintf("Error encoding an int %d with size 2, got rune %v and size %d", size, r, i)) + } + return r + } + + // Last -3 here needed because for some reason 3rd to last codepoint 65533 in this range + // was returning utf8.RuneError during encoding. + if i < ((1 << THREE_BYTE_BITS) - UNICODE_INVALID_RANGE_DELTA - 3) { + if i >= UNICODE_INVALID_RANGE_START { + i += UNICODE_INVALID_RANGE_DELTA + } + + r, size := utf8.DecodeRune([]byte{0b11100000 | getBits(i, 4, 12), 0b10000000 | getBits(i, 6, 6), 0b10000000 | getBits(i, 6, 0)}) + if size != 3 || r == utf8.RuneError { + panic(fmt.Sprintf("Error encoding an int %d with size 3, got rune %v and size %d", size, r, i)) + } + return r + } + + if i < (1<= UNICODE_INVALID_RANGE_END { + return result - UNICODE_INVALID_RANGE_DELTA + } + + return result + } + + if size == 4 { + result := uint32(bytes[0]&0b111)<<18 | uint32(bytes[1]&0b111111)<<12 | uint32(bytes[2]&0b111111)<<6 | uint32(bytes[3]&0b111111) + return result - UNICODE_INVALID_RANGE_DELTA - 3 + } + + panic(fmt.Sprintf("Unexpected state decoding rune=%v size=%d", r, size)) +} diff --git a/vendor/github.com/webrpc/webrpc/go.mod b/vendor/github.com/webrpc/webrpc/go.mod index 448a3ed0..641298be 100644 --- a/vendor/github.com/webrpc/webrpc/go.mod +++ b/vendor/github.com/webrpc/webrpc/go.mod @@ -2,6 +2,9 @@ module github.com/webrpc/webrpc go 1.19 +// Waiting for https://github.com/posener/gitfs/pull/37 to be merged +replace github.com/posener/gitfs v1.2.1 => github.com/klaidliadon/gitfs v0.0.0-20240520073403-98884616789c + // replace github.com/webrpc/gen-golang => ../gen-golang // replace github.com/webrpc/gen-typescript => ../gen-typescript // replace github.com/webrpc/gen-javascript => ../gen-javascript @@ -16,6 +19,7 @@ require ( github.com/posener/gitfs v1.2.1 github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c github.com/stretchr/testify v1.9.0 + github.com/webrpc/gen-dart v0.1.1 github.com/webrpc/gen-golang v0.14.8 github.com/webrpc/gen-javascript v0.12.0 github.com/webrpc/gen-kotlin v0.1.0 @@ -25,10 +29,18 @@ require ( ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/ProtonMail/go-crypto v1.0.0 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/emirpasic/gods v1.18.1 // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-git/go-git/v5 v5.12.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/go-github v17.0.0+incompatible // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.6.0 // indirect @@ -38,24 +50,21 @@ require ( github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kr/fs v0.1.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/posener/diff v0.0.1 // indirect - github.com/sergi/go-diff v1.3.1 // indirect + github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shopspring/decimal v1.4.0 // indirect + github.com/skeema/knownhosts v1.2.2 // indirect github.com/spf13/cast v1.6.0 // indirect - github.com/src-d/gcfg v1.4.0 // indirect - github.com/webrpc/gen-dart v0.1.1 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.22.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.19.0 // indirect - gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect - gopkg.in/src-d/go-git.v4 v4.13.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/vendor/modules.txt b/vendor/modules.txt index 7b458a1a..0d30e4a6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/0xsequence/ethkit v1.24.12 +# github.com/0xsequence/ethkit v1.25.0 ## explicit; go 1.21 github.com/0xsequence/ethkit github.com/0xsequence/ethkit/cmd/ethkit @@ -36,7 +36,7 @@ github.com/0xsequence/ethkit/util # github.com/0xsequence/go-ethauth v0.13.0 ## explicit; go 1.17 github.com/0xsequence/go-ethauth -# github.com/0xsequence/go-sequence v0.32.1 +# github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e ## explicit; go 1.21 github.com/0xsequence/go-sequence github.com/0xsequence/go-sequence/contracts @@ -95,7 +95,7 @@ github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer github.com/Microsoft/go-winio/pkg/guid -# github.com/aws/aws-sdk-go-v2 v1.26.1 +# github.com/aws/aws-sdk-go-v2 v1.27.0 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/defaults @@ -140,10 +140,10 @@ github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 # github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 @@ -172,6 +172,16 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url github.com/aws/aws-sdk-go-v2/service/kms github.com/aws/aws-sdk-go-v2/service/kms/internal/endpoints github.com/aws/aws-sdk-go-v2/service/kms/types +# github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.29.1 +## explicit; go 1.20 +github.com/aws/aws-sdk-go-v2/service/secretsmanager +github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/secretsmanager/types +# github.com/aws/aws-sdk-go-v2/service/ses v1.22.9 +## explicit; go 1.20 +github.com/aws/aws-sdk-go-v2/service/ses +github.com/aws/aws-sdk-go-v2/service/ses/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/ses/types # github.com/aws/aws-sdk-go-v2/service/sqs v1.31.4 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/service/sqs @@ -519,8 +529,8 @@ github.com/segmentio/asm/cpu/arm64 github.com/segmentio/asm/cpu/cpuid github.com/segmentio/asm/cpu/x86 github.com/segmentio/asm/internal/unsafebytes -# github.com/sergi/go-diff v1.3.1 -## explicit; go 1.12 +# github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 +## explicit; go 1.13 github.com/sergi/go-diff/diffmatchpatch # github.com/shopspring/decimal v1.4.0 ## explicit; go 1.10 @@ -579,7 +589,7 @@ github.com/webrpc/gen-openapi # github.com/webrpc/gen-typescript v0.13.0 ## explicit; go 1.16 github.com/webrpc/gen-typescript -# github.com/webrpc/webrpc v0.18.6 +# github.com/webrpc/webrpc v0.18.7 ## explicit; go 1.19 github.com/webrpc/webrpc github.com/webrpc/webrpc/cmd/webrpc-gen From 4aec4b830ce1e1a24fa37ad4e83b91280a295b8c Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:26:08 +0200 Subject: [PATCH 02/13] config: config for SES, builder and verification contexts DB table --- config/config.go | 21 ++++++++++++++++++--- docker/awslocal_ready_hook.sh | 13 +++++++++++++ etc/waas-auth.sample.conf | 8 ++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index 05bbcb5e..bd7c9e04 100644 --- a/config/config.go +++ b/config/config.go @@ -15,6 +15,8 @@ type Config struct { Admin AdminConfig `toml:"admin"` Endpoints EndpointsConfig `toml:"endpoints"` KMS KMSConfig `toml:"kms"` + SES SESConfig `toml:"ses"` + Builder BuilderConfig `toml:"builder"` Database DatabaseConfig `toml:"database"` Telemetry telemetry.Config `toml:"telemetry"` Tracing TracingConfig `toml:"tracing"` @@ -44,10 +46,23 @@ type KMSConfig struct { DefaultSessionKeys []string `toml:"default_session_keys"` } +type SESConfig struct { + Region string `toml:"region"` + Source string `toml:"source"` + SourceARN string `toml:"source_arn"` + AccessRoleARN string `toml:"access_role_arn"` +} + type DatabaseConfig struct { - TenantsTable string `toml:"tenants_table"` - AccountsTable string `toml:"accounts_table"` - SessionsTable string `toml:"sessions_table"` + TenantsTable string `toml:"tenants_table"` + AccountsTable string `toml:"accounts_table"` + SessionsTable string `toml:"sessions_table"` + VerificationContextsTable string `toml:"verification_contexts_table"` +} + +type BuilderConfig struct { + BaseURL string `toml:"base_url"` + SecretID string `toml:"secret_id"` } type TracingConfig struct { diff --git a/docker/awslocal_ready_hook.sh b/docker/awslocal_ready_hook.sh index 59125f72..539b2706 100755 --- a/docker/awslocal_ready_hook.sh +++ b/docker/awslocal_ready_hook.sh @@ -9,6 +9,13 @@ fi awslocal kms create-key --region us-east-1 --tags '[{"TagKey":"_custom_id_","TagValue":"aeb99e0f-9e89-44de-a084-e1817af47778"}]' awslocal kms create-key --region us-east-1 --tags '[{"TagKey":"_custom_id_","TagValue":"27ebbde0-49d2-4cb6-ad78-4f2c24fe7b79"}]' +awslocal ses verify-email-identity --email noreply@local.auth.sequence.app + +awslocal secretsmanager create-secret \ + --region us-east-1 \ + --name BuilderJWT \ + --secret-string 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXJ2aWNlIjoiV2FhUyJ9.-FAkEOb0jtHhoHv6r4O7U8PGOw_b60M9MnSYN9Bm_7A' + awslocal dynamodb create-table \ --region us-east-1 \ --table-name TenantsTable \ @@ -34,3 +41,9 @@ awslocal dynamodb create-table \ "IndexName=UserID-Index,KeySchema=[{AttributeName=UserID,KeyType=HASH},{AttributeName=Identity,KeyType=SORT}],Projection={ProjectionType=ALL},ProvisionedThroughput={ReadCapacityUnits=10,WriteCapacityUnits=10}" \ "IndexName=Email-Index,KeySchema=[{AttributeName=ProjectScopedEmail,KeyType=HASH},{AttributeName=Identity,KeyType=SORT}],Projection={ProjectionType=ALL},ProvisionedThroughput={ReadCapacityUnits=10,WriteCapacityUnits=10}" +awslocal dynamodb create-table \ + --region us-east-1 \ + --table-name VerificationContextsTable \ + --attribute-definitions AttributeName=ID,AttributeType=S \ + --key-schema AttributeName=ID,KeyType=HASH \ + --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 diff --git a/etc/waas-auth.sample.conf b/etc/waas-auth.sample.conf index 04ba7ce9..1b7a1e19 100644 --- a/etc/waas-auth.sample.conf +++ b/etc/waas-auth.sample.conf @@ -37,8 +37,16 @@ QwIDAQAB [database] tenants_table = "TenantsTable" sessions_table = "SessionsTable" + verification_contexts_table = "VerificationContextsTable" [kms] tenant_keys = ["arn:aws:kms:us-east-1:000000000000:key/27ebbde0-49d2-4cb6-ad78-4f2c24fe7b79"] default_session_keys = ["arn:aws:kms:us-east-1:000000000000:key/27ebbde0-49d2-4cb6-ad78-4f2c24fe7b79"] default_transport_keys = ["arn:aws:kms:us-east-1:000000000000:key/aeb99e0f-9e89-44de-a084-e1817af47778"] + +[ses] + source = "noreply@local.auth.sequence.app" + +[builder] + base_url = "http://host.docker.internal:9999" + secret_id = "BuilderJWT" From da12ccabf4d80f2373f432ce354abcab57a43015 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:26:39 +0200 Subject: [PATCH 03/13] proto: minimal builder schema --- proto/builder/authenticated_client.go | 79 +++++ proto/builder/builder.gen.go | 410 ++++++++++++++++++++++++++ proto/builder/builder.ridl | 89 ++++++ proto/builder/proto.go | 4 + 4 files changed, 582 insertions(+) create mode 100644 proto/builder/authenticated_client.go create mode 100644 proto/builder/builder.gen.go create mode 100644 proto/builder/builder.ridl create mode 100644 proto/builder/proto.go diff --git a/proto/builder/authenticated_client.go b/proto/builder/authenticated_client.go new file mode 100644 index 00000000..4352da9d --- /dev/null +++ b/proto/builder/authenticated_client.go @@ -0,0 +1,79 @@ +package builder + +import ( + "context" + "fmt" + "net/http" + "sync" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager" +) + +type AuthenticatedClient struct { + HTTPClient + + m sync.RWMutex + cachedToken string + expiration time.Time + + sm *secretsmanager.Client + secretID string +} + +func NewAuthenticatedClient(httpClient HTTPClient, sm *secretsmanager.Client, secretID string) *AuthenticatedClient { + return &AuthenticatedClient{ + HTTPClient: httpClient, + sm: sm, + secretID: secretID, + } +} + +func (c *AuthenticatedClient) Do(req *http.Request) (*http.Response, error) { + ctx := req.Context() + + token, exp := c.getToken() + if token == "" || time.Now().After(exp) { + var err error + token, err = c.fetchToken(ctx) + if err != nil { + return nil, err + } + } + + h := http.Header{} + h.Set("Authorization", fmt.Sprintf("Bearer %s", token)) + ctx, err := WithHTTPRequestHeaders(ctx, h) + if err != nil { + return nil, err + } + + return c.Do(req.WithContext(ctx)) +} + +func (c *AuthenticatedClient) getToken() (string, time.Time) { + c.m.RLock() + defer c.m.RUnlock() + + return c.cachedToken, c.expiration +} + +func (c *AuthenticatedClient) fetchToken(ctx context.Context) (string, error) { + out, err := c.sm.GetSecretValue(ctx, &secretsmanager.GetSecretValueInput{ + SecretId: aws.String(c.secretID), + }) + if err != nil { + return "", err + } + if out.SecretString == nil { + return "", fmt.Errorf("no token found") + } + + c.m.Lock() + defer c.m.Unlock() + + c.cachedToken = *out.SecretString + c.expiration = time.Now().Add(1 * time.Hour) + return c.cachedToken, nil +} diff --git a/proto/builder/builder.gen.go b/proto/builder/builder.gen.go new file mode 100644 index 00000000..ef51bb3e --- /dev/null +++ b/proto/builder/builder.gen.go @@ -0,0 +1,410 @@ +// sequence-builder v0.1.0 97ffbb3b01cdef9c1dad137ab703fa04e501eb27 +// -- +// Code generated by webrpc-gen@v0.18.7 with golang generator. DO NOT EDIT. +// +// webrpc-gen -schema=builder.ridl -target=golang -pkg=builder -client -out=./builder.gen.go +package builder + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "time" +) + +// WebRPC description and code-gen version +func WebRPCVersion() string { + return "v1" +} + +// Schema version of your RIDL schema +func WebRPCSchemaVersion() string { + return "v0.1.0" +} + +// Schema hash generated from your RIDL schema +func WebRPCSchemaHash() string { + return "97ffbb3b01cdef9c1dad137ab703fa04e501eb27" +} + +// +// Common types +// + +type EmailTemplateType uint8 + +const ( + EmailTemplateType_UNKNOWN EmailTemplateType = 0 + EmailTemplateType_LOGIN EmailTemplateType = 1 + EmailTemplateType_GUARD EmailTemplateType = 2 +) + +var EmailTemplateType_name = map[uint8]string{ + 0: "UNKNOWN", + 1: "LOGIN", + 2: "GUARD", +} + +var EmailTemplateType_value = map[string]uint8{ + "UNKNOWN": 0, + "LOGIN": 1, + "GUARD": 2, +} + +func (x EmailTemplateType) String() string { + return EmailTemplateType_name[uint8(x)] +} + +func (x EmailTemplateType) MarshalText() ([]byte, error) { + return []byte(EmailTemplateType_name[uint8(x)]), nil +} + +func (x *EmailTemplateType) UnmarshalText(b []byte) error { + *x = EmailTemplateType(EmailTemplateType_value[string(b)]) + return nil +} + +func (x *EmailTemplateType) Is(values ...EmailTemplateType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +// db table: 'email_templates' +type EmailTemplate struct { + ID uint64 `json:"id" db:"id,omitempty"` + TemplateType *EmailTemplateType `json:"templateType" db:"template_type"` + ProjectID uint64 `json:"projectId" db:"project_id"` + Subject string `json:"subject" db:"subject"` + IntroText string `json:"introText" db:"intro_text"` + LogoURL string `json:"logoUrl" db:"logo_url"` + Template *string `json:"template" db:"template"` + Placeholders []string `json:"placeholders" db:"placeholders"` + CreatedAt time.Time `json:"createdAt" db:"created_at"` + UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` + DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at,omitempty"` +} + +var WebRPCServices = map[string][]string{ + "Builder": { + "GetEmailTemplate", + }, +} + +// +// Server types +// + +type Builder interface { + // Project > Email Templates + // + GetEmailTemplate(ctx context.Context, projectId uint64, templateType *EmailTemplateType) (*EmailTemplate, error) +} + +// +// Client types +// + +type BuilderClient interface { + // Project > Email Templates + // + GetEmailTemplate(ctx context.Context, projectId uint64, templateType *EmailTemplateType) (*EmailTemplate, error) +} + +// +// Client +// + +const BuilderPathPrefix = "/rpc/Builder/" + +type builderClient struct { + client HTTPClient + urls [1]string +} + +func NewBuilderClient(addr string, client HTTPClient) BuilderClient { + prefix := urlBase(addr) + BuilderPathPrefix + urls := [1]string{ + prefix + "GetEmailTemplate", + } + return &builderClient{ + client: client, + urls: urls, + } +} + +func (c *builderClient) GetEmailTemplate(ctx context.Context, projectId uint64, templateType *EmailTemplateType) (*EmailTemplate, error) { + in := struct { + Arg0 uint64 `json:"projectId"` + Arg1 *EmailTemplateType `json:"templateType"` + }{projectId, templateType} + out := struct { + Ret0 *EmailTemplate `json:"emailTemplate"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[0], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +// HTTPClient is the interface used by generated clients to send HTTP requests. +// It is fulfilled by *(net/http).Client, which is sufficient for most users. +// Users can provide their own implementation for special retry policies. +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + +// urlBase helps ensure that addr specifies a scheme. If it is unparsable +// as a URL, it returns addr unchanged. +func urlBase(addr string) string { + // If the addr specifies a scheme, use it. If not, default to + // http. If url.Parse fails on it, return it unchanged. + url, err := url.Parse(addr) + if err != nil { + return addr + } + if url.Scheme == "" { + url.Scheme = "http" + } + return url.String() +} + +// newRequest makes an http.Request from a client, adding common headers. +func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType string) (*http.Request, error) { + req, err := http.NewRequestWithContext(ctx, "POST", url, reqBody) + if err != nil { + return nil, err + } + req.Header.Set("Accept", contentType) + req.Header.Set("Content-Type", contentType) + if headers, ok := HTTPRequestHeaders(ctx); ok { + for k := range headers { + for _, v := range headers[k] { + req.Header.Add(k, v) + } + } + } + return req, nil +} + +// doHTTPRequest is common code to make a request to the remote service. +func doHTTPRequest(ctx context.Context, client HTTPClient, url string, in, out interface{}) (*http.Response, error) { + reqBody, err := json.Marshal(in) + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to marshal JSON body: %w", err)) + } + if err = ctx.Err(); err != nil { + return nil, ErrWebrpcRequestFailed.WithCause(fmt.Errorf("aborted because context was done: %w", err)) + } + + req, err := newRequest(ctx, url, bytes.NewBuffer(reqBody), "application/json") + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCause(fmt.Errorf("could not build request: %w", err)) + } + + resp, err := client.Do(req) + if err != nil { + return nil, ErrWebrpcRequestFailed.WithCause(err) + } + + if resp.StatusCode != 200 { + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to read server error response body: %w", err)) + } + + var rpcErr WebRPCError + if err := json.Unmarshal(respBody, &rpcErr); err != nil { + return nil, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to unmarshal server error: %w", err)) + } + if rpcErr.Cause != "" { + rpcErr.cause = errors.New(rpcErr.Cause) + } + return nil, rpcErr + } + + if out != nil { + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to read response body: %w", err)) + } + + err = json.Unmarshal(respBody, &out) + if err != nil { + return nil, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to unmarshal JSON response body: %w", err)) + } + } + + return resp, nil +} + +func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error) { + if _, ok := h["Accept"]; ok { + return nil, errors.New("provided header cannot set Accept") + } + if _, ok := h["Content-Type"]; ok { + return nil, errors.New("provided header cannot set Content-Type") + } + + copied := make(http.Header, len(h)) + for k, vv := range h { + if vv == nil { + copied[k] = nil + continue + } + copied[k] = make([]string, len(vv)) + copy(copied[k], vv) + } + + return context.WithValue(ctx, HTTPClientRequestHeadersCtxKey, copied), nil +} + +func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { + h, ok := ctx.Value(HTTPClientRequestHeadersCtxKey).(http.Header) + return h, ok +} + +// +// Helpers +// + +type contextKey struct { + name string +} + +func (k *contextKey) String() string { + return "webrpc context value " + k.name +} + +var ( + HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} + HTTPRequestCtxKey = &contextKey{"HTTPRequest"} + + ServiceNameCtxKey = &contextKey{"ServiceName"} + + MethodNameCtxKey = &contextKey{"MethodName"} +) + +func ServiceNameFromContext(ctx context.Context) string { + service, _ := ctx.Value(ServiceNameCtxKey).(string) + return service +} + +func MethodNameFromContext(ctx context.Context) string { + method, _ := ctx.Value(MethodNameCtxKey).(string) + return method +} + +func RequestFromContext(ctx context.Context) *http.Request { + r, _ := ctx.Value(HTTPRequestCtxKey).(*http.Request) + return r +} + +// +// Errors +// + +type WebRPCError struct { + Name string `json:"error"` + Code int `json:"code"` + Message string `json:"msg"` + Cause string `json:"cause,omitempty"` + HTTPStatus int `json:"status"` + cause error +} + +var _ error = WebRPCError{} + +func (e WebRPCError) Error() string { + if e.cause != nil { + return fmt.Sprintf("%s %d: %s: %v", e.Name, e.Code, e.Message, e.cause) + } + return fmt.Sprintf("%s %d: %s", e.Name, e.Code, e.Message) +} + +func (e WebRPCError) Is(target error) bool { + if target == nil { + return false + } + if rpcErr, ok := target.(WebRPCError); ok { + return rpcErr.Code == e.Code + } + return errors.Is(e.cause, target) +} + +func (e WebRPCError) Unwrap() error { + return e.cause +} + +func (e WebRPCError) WithCause(cause error) WebRPCError { + err := e + err.cause = cause + err.Cause = cause.Error() + return err +} + +func (e WebRPCError) WithCausef(format string, args ...interface{}) WebRPCError { + cause := fmt.Errorf(format, args...) + err := e + err.cause = cause + err.Cause = cause.Error() + return err +} + +// Deprecated: Use .WithCause() method on WebRPCError. +func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError { + return rpcErr.WithCause(cause) +} + +// Webrpc errors +var ( + ErrWebrpcEndpoint = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400} + ErrWebrpcRequestFailed = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400} + ErrWebrpcBadRoute = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404} + ErrWebrpcBadMethod = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405} + ErrWebrpcBadRequest = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400} + ErrWebrpcBadResponse = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500} + ErrWebrpcServerPanic = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500} + ErrWebrpcInternalError = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500} + ErrWebrpcClientDisconnected = WebRPCError{Code: -8, Name: "WebrpcClientDisconnected", Message: "client disconnected", HTTPStatus: 400} + ErrWebrpcStreamLost = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400} + ErrWebrpcStreamFinished = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200} +) + +// Schema errors +var ( + ErrUnauthorized = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401} + ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} + ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} + ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} + ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} + ErrTimeout = WebRPCError{Code: 2000, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} + ErrInvalidArgument = WebRPCError{Code: 2001, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} + ErrNotFound = WebRPCError{Code: 3000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} + ErrUserNotFound = WebRPCError{Code: 3001, Name: "UserNotFound", Message: "User not found", HTTPStatus: 400} + ErrProjectNotFound = WebRPCError{Code: 3002, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 400} + ErrInvalidTier = WebRPCError{Code: 3003, Name: "InvalidTier", Message: "Invalid subscription tier", HTTPStatus: 400} + ErrEmailTemplateExists = WebRPCError{Code: 3004, Name: "EmailTemplateExists", Message: "Email Template exists", HTTPStatus: 409} + ErrSubscriptionLimit = WebRPCError{Code: 3005, Name: "SubscriptionLimit", Message: "Subscription limit reached", HTTPStatus: 402} + ErrFeatureNotIncluded = WebRPCError{Code: 3006, Name: "FeatureNotIncluded", Message: "Feature not included", HTTPStatus: 402} + ErrInvalidNetwork = WebRPCError{Code: 3007, Name: "InvalidNetwork", Message: "Invalid network", HTTPStatus: 400} + ErrInvitationExpired = WebRPCError{Code: 4000, Name: "InvitationExpired", Message: "Invitation code is expired", HTTPStatus: 400} + ErrAlreadyCollaborator = WebRPCError{Code: 4001, Name: "AlreadyCollaborator", Message: "Already a collaborator", HTTPStatus: 409} +) diff --git a/proto/builder/builder.ridl b/proto/builder/builder.ridl new file mode 100644 index 00000000..19420ec1 --- /dev/null +++ b/proto/builder/builder.ridl @@ -0,0 +1,89 @@ +webrpc = v1 # TODO, use v2 + +name = sequence-builder +version = v0.1.0 + + +# db table: "email_templates" +struct EmailTemplate + - id: uint64 + + go.field.name = ID + + go.tag.db = id,omitempty + + - templateType?: EmailTemplateType + + go.field.name = TemplateType + + go.tag.db = template_type + + - projectId: uint64 + + go.field.name = ProjectID + + go.tag.db = project_id + + - subject: string + + go.tag.db = subject + + - introText: string + + go.tag.db = intro_text + + - logoUrl: string + + go.field.name = LogoURL + + go.tag.db = logo_url + + - template?: string + + go.field.name = Template + + go.tag.db = template + + - placeholders: []string + + go.tag.db = placeholders + + - createdAt: timestamp + + json = createdAt + + go.tag.db = created_at + + - updatedAt: timestamp + + json = updatedAt + + go.tag.db = updated_at + + - deletedAt?: timestamp + + go.tag.db = deleted_at,omitempty + + go.tag.json = deletedAt,omitempty + + go.field.type = *time.Time + +enum EmailTemplateType: uint8 + - UNKNOWN + - LOGIN + - GUARD + + +## +## Errors +## +error 1000 Unauthorized "Unauthorized access" HTTP 401 +error 1001 PermissionDenied "Permission denied" HTTP 403 +error 1002 SessionExpired "Session expired" HTTP 403 +error 1003 MethodNotFound "Method not found" HTTP 404 +error 1004 RequestConflict "Conflict with target resource" HTTP 409 + +error 2000 Timeout "Request timed out" HTTP 408 +error 2001 InvalidArgument "Invalid argument" HTTP 400 + +error 3000 NotFound "Resource not found" HTTP 400 +error 3001 UserNotFound "User not found" HTTP 400 +error 3002 ProjectNotFound "Project not found" HTTP 400 +error 3003 InvalidTier "Invalid subscription tier" HTTP 400 +error 3004 EmailTemplateExists "Email Template exists" HTTP 409 +error 3005 SubscriptionLimit "Subscription limit reached" HTTP 402 +error 3006 FeatureNotIncluded "Feature not included" HTTP 402 +error 3007 InvalidNetwork "Invalid network" HTTP 400 + +error 4000 InvitationExpired "Invitation code is expired" HTTP 400 +error 4001 AlreadyCollaborator "Already a collaborator" HTTP 409 + +## +## Builder rpc service +## +service Builder + # Project > Email Templates + # + - GetEmailTemplate(projectId: uint64, templateType?: EmailTemplateType) => (emailTemplate: EmailTemplate) + + diff --git a/proto/builder/proto.go b/proto/builder/proto.go new file mode 100644 index 00000000..1a66e7c3 --- /dev/null +++ b/proto/builder/proto.go @@ -0,0 +1,4 @@ +// Clients +//go:generate go run github.com/webrpc/webrpc/cmd/webrpc-gen -schema=builder.ridl -target=golang -pkg=builder -client -out=./builder.gen.go + +package builder From 177b3e052288ec8bfc883b38300545fb8245bc88 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:27:17 +0200 Subject: [PATCH 04/13] proto: update WaaS API schema --- proto/waas/wallet.gen.go | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/proto/waas/wallet.gen.go b/proto/waas/wallet.gen.go index e582b615..5241d3eb 100644 --- a/proto/waas/wallet.gen.go +++ b/proto/waas/wallet.gen.go @@ -1,4 +1,4 @@ -// sequence-wallet v0.1.0 1530f3a22dd91b9d14e4d090562d25a099330858 +// sequence-wallet v0.1.0 3f740d112f5dfb80cf5a78f6da1d7241dd4d017a // -- // Code generated by webrpc-gen@v0.18.6 with golang generator. DO NOT EDIT. // @@ -31,7 +31,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "1530f3a22dd91b9d14e4d090562d25a099330858" + return "3f740d112f5dfb80cf5a78f6da1d7241dd4d017a" } // @@ -251,6 +251,7 @@ var WebRPCServices = map[string][]string{ "SessionAuthProof", "FederateAccount", "RemoveAccount", + "InitiateEmailAuth", "SendIntent", "ChainList", }, @@ -298,6 +299,7 @@ type WaaS interface { SessionAuthProof(ctx context.Context, intent *Intent, proof *SessionAuthProof) (*IntentResponse, error) FederateAccount(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) RemoveAccount(ctx context.Context, intent *Intent) (*IntentResponse, error) + InitiateEmailAuth(ctx context.Context, intent *Intent, answerHash string, salt string) (*IntentResponse, error) // Generic send intent method SendIntent(ctx context.Context, intent *Intent) (*IntentResponse, error) // utilities @@ -346,6 +348,7 @@ type WaaSClient interface { SessionAuthProof(ctx context.Context, intent *Intent, proof *SessionAuthProof) (*IntentResponse, error) FederateAccount(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) RemoveAccount(ctx context.Context, intent *Intent) (*IntentResponse, error) + InitiateEmailAuth(ctx context.Context, intent *Intent, answerHash string, salt string) (*IntentResponse, error) // Generic send intent method SendIntent(ctx context.Context, intent *Intent) (*IntentResponse, error) // utilities @@ -360,12 +363,12 @@ const WaaSPathPrefix = "/rpc/WaaS/" type waaSClient struct { client HTTPClient - urls [27]string + urls [28]string } func NewWaaSClient(addr string, client HTTPClient) WaaSClient { prefix := urlBase(addr) + WaaSPathPrefix - urls := [27]string{ + urls := [28]string{ prefix + "CreateProject", prefix + "DeployProjectParentWallet", prefix + "UpdateProjectUserMapRules", @@ -391,6 +394,7 @@ func NewWaaSClient(addr string, client HTTPClient) WaaSClient { prefix + "SessionAuthProof", prefix + "FederateAccount", prefix + "RemoveAccount", + prefix + "InitiateEmailAuth", prefix + "SendIntent", prefix + "ChainList", } @@ -888,6 +892,27 @@ func (c *waaSClient) RemoveAccount(ctx context.Context, intent *Intent) (*Intent return out.Ret0, err } +func (c *waaSClient) InitiateEmailAuth(ctx context.Context, intent *Intent, answerHash string, salt string) (*IntentResponse, error) { + in := struct { + Arg0 *Intent `json:"intent"` + Arg1 string `json:"answerHash"` + Arg2 string `json:"salt"` + }{intent, answerHash, salt} + out := struct { + Ret0 *IntentResponse `json:"response"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[25], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + func (c *waaSClient) SendIntent(ctx context.Context, intent *Intent) (*IntentResponse, error) { in := struct { Arg0 *Intent `json:"intent"` @@ -896,7 +921,7 @@ func (c *waaSClient) SendIntent(ctx context.Context, intent *Intent) (*IntentRes Ret0 *IntentResponse `json:"response"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[25], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[26], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -912,7 +937,7 @@ func (c *waaSClient) ChainList(ctx context.Context) ([]*Chain, error) { Ret0 []*Chain `json:"chains"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[26], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[27], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { From e05bd0954f9bf5ae8ed47d72fb8b9c3d0090de4d Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:27:41 +0200 Subject: [PATCH 05/13] proto: VerificationContext struct --- proto/authenticator.gen.go | 134 +++++++++++++++-------------- proto/authenticator.ridl | 27 ++++-- proto/clients/authenticator.gen.go | 118 +++++++++++++------------ proto/clients/authenticator.gen.ts | 42 ++++++--- 4 files changed, 180 insertions(+), 141 deletions(-) diff --git a/proto/authenticator.gen.go b/proto/authenticator.gen.go index 0cc1649b..93657e0c 100644 --- a/proto/authenticator.gen.go +++ b/proto/authenticator.gen.go @@ -1,6 +1,6 @@ -// sequence-waas-authenticator v0.1.0 2b3aee6b2e912ae0b3a6b4878672632d3025a99a +// sequence-waas-authenticator v0.1.0 ac3c2c244a304a00a769c89f84ff9c17c8f116bc // -- -// Code generated by webrpc-gen@v0.18.6 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.18.7 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=authenticator.ridl -target=golang -pkg=proto -server -client -out=./authenticator.gen.go package proto @@ -34,7 +34,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "2b3aee6b2e912ae0b3a6b4878672632d3025a99a" + return "ac3c2c244a304a00a769c89f84ff9c17c8f116bc" } // @@ -44,6 +44,7 @@ func WebRPCSchemaHash() string { type IntentName string const ( + IntentName_initiateAuth IntentName = "initiateAuth" IntentName_openSession IntentName = "openSession" IntentName_closeSession IntentName = "closeSession" IntentName_validateSession IntentName = "validateSession" @@ -58,6 +59,7 @@ const ( IntentName_federateAccount IntentName = "federateAccount" IntentName_removeAccount IntentName = "removeAccount" IntentName_listAccounts IntentName = "listAccounts" + IntentName_getIdToken IntentName = "getIdToken" ) func (x IntentName) MarshalText() ([]byte, error) { @@ -84,6 +86,7 @@ func (x *IntentName) Is(values ...IntentName) bool { type IntentResponseCode string const ( + IntentResponseCode_authInitiated IntentResponseCode = "authInitiated" IntentResponseCode_sessionOpened IntentResponseCode = "sessionOpened" IntentResponseCode_sessionClosed IntentResponseCode = "sessionClosed" IntentResponseCode_sessionList IntentResponseCode = "sessionList" @@ -99,6 +102,7 @@ const ( IntentResponseCode_accountList IntentResponseCode = "accountList" IntentResponseCode_accountFederated IntentResponseCode = "accountFederated" IntentResponseCode_accountRemoved IntentResponseCode = "accountRemoved" + IntentResponseCode_idToken IntentResponseCode = "idToken" ) func (x IntentResponseCode) MarshalText() ([]byte, error) { @@ -122,55 +126,21 @@ func (x *IntentResponseCode) Is(values ...IntentResponseCode) bool { return false } -type Intent struct { - Version string `json:"version"` - Name IntentName `json:"name"` - ExpiresAt uint64 `json:"expiresAt"` - IssuedAt uint64 `json:"issuedAt"` - Data interface{} `json:"data"` - Signatures []*Signature `json:"signatures,omitempty"` -} - -type Signature struct { - SessionID string `json:"sessionId"` - Signature string `json:"signature"` -} - -type IntentResponse struct { - Code IntentResponseCode `json:"code"` - Data interface{} `json:"data"` -} - -type IdentityType uint8 +type IdentityType string const ( - IdentityType_None IdentityType = 0 - IdentityType_Guest IdentityType = 1 - IdentityType_OIDC IdentityType = 2 + IdentityType_None IdentityType = "None" + IdentityType_Guest IdentityType = "Guest" + IdentityType_OIDC IdentityType = "OIDC" + IdentityType_Email IdentityType = "Email" ) -var IdentityType_name = map[uint8]string{ - 0: "None", - 1: "Guest", - 2: "OIDC", -} - -var IdentityType_value = map[string]uint8{ - "None": 0, - "Guest": 1, - "OIDC": 2, -} - -func (x IdentityType) String() string { - return IdentityType_name[uint8(x)] -} - func (x IdentityType) MarshalText() ([]byte, error) { - return []byte(IdentityType_name[uint8(x)]), nil + return []byte(x), nil } func (x *IdentityType) UnmarshalText(b []byte) error { - *x = IdentityType(IdentityType_value[string(b)]) + *x = IdentityType(string(b)) return nil } @@ -186,6 +156,25 @@ func (x *IdentityType) Is(values ...IdentityType) bool { return false } +type Intent struct { + Version string `json:"version"` + Name IntentName `json:"name"` + ExpiresAt uint64 `json:"expiresAt"` + IssuedAt uint64 `json:"issuedAt"` + Data interface{} `json:"data"` + Signatures []*Signature `json:"signatures,omitempty"` +} + +type Signature struct { + SessionID string `json:"sessionId"` + Signature string `json:"signature"` +} + +type IntentResponse struct { + Code IntentResponseCode `json:"code"` + Data interface{} `json:"data"` +} + type Version struct { WebrpcVersion string `json:"webrpcVersion"` SchemaVersion string `json:"schemaVersion"` @@ -236,6 +225,7 @@ type TenantData struct { SequenceContext *MiniSequenceContext `json:"sequenceContext"` UpgradeCode string `json:"upgradeCode"` WaasAccessToken string `json:"waasAccessToken"` + EmailEnabled bool `json:"emailEnabled"` OIDCProviders []*OpenIdProvider `json:"oidcProviders"` KMSKeys []string `json:"kmsKeys"` AllowedOrigins validation.Origins `json:"allowedOrigins"` @@ -273,6 +263,18 @@ type SessionData struct { ExpiresAt time.Time `json:"expiresAt"` } +type VerificationContext struct { + ProjectID uint64 `json:"projectId"` + SessionID string `json:"sessionId"` + IdentityType IdentityType `json:"identityType"` + Verifier string `json:"verifier"` + Challenge *string `json:"challenge"` + Answer *string `json:"answer"` + Attempts int `json:"attempts"` + LastAttemptAt *time.Time `json:"lastAttemptAt"` + ExpiresAt time.Time `json:"expiresAt"` +} + var WebRPCServices = map[string][]string{ "WaasAuthenticator": { "RegisterSession", @@ -304,8 +306,8 @@ type WaasAuthenticatorAdmin interface { RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) GetTenant(ctx context.Context, projectId uint64) (*Tenant, error) - CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) - UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) + CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) + UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) } // @@ -323,8 +325,8 @@ type WaasAuthenticatorAdminClient interface { RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) GetTenant(ctx context.Context, projectId uint64) (*Tenant, error) - CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) - UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) + CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) + UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) } // @@ -731,9 +733,10 @@ func (s *waasAuthenticatorAdminServer) serveCreateTenantJSON(ctx context.Context reqPayload := struct { Arg0 uint64 `json:"projectId"` Arg1 string `json:"waasAccessToken"` - Arg2 []*OpenIdProvider `json:"oidcProviders"` - Arg3 []string `json:"allowedOrigins"` - Arg4 *string `json:"password"` + Arg2 bool `json:"emailEnabled"` + Arg3 []*OpenIdProvider `json:"oidcProviders"` + Arg4 []string `json:"allowedOrigins"` + Arg5 *string `json:"password"` }{} if err := json.Unmarshal(reqBody, &reqPayload); err != nil { s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) @@ -741,7 +744,7 @@ func (s *waasAuthenticatorAdminServer) serveCreateTenantJSON(ctx context.Context } // Call service method implementation. - ret0, ret1, err := s.WaasAuthenticatorAdmin.CreateTenant(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2, reqPayload.Arg3, reqPayload.Arg4) + ret0, ret1, err := s.WaasAuthenticatorAdmin.CreateTenant(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2, reqPayload.Arg3, reqPayload.Arg4, reqPayload.Arg5) if err != nil { rpcErr, ok := err.(WebRPCError) if !ok { @@ -779,8 +782,9 @@ func (s *waasAuthenticatorAdminServer) serveUpdateTenantJSON(ctx context.Context reqPayload := struct { Arg0 uint64 `json:"projectId"` Arg1 string `json:"upgradeCode"` - Arg2 []*OpenIdProvider `json:"oidcProviders"` - Arg3 []string `json:"allowedOrigins"` + Arg2 bool `json:"emailEnabled"` + Arg3 []*OpenIdProvider `json:"oidcProviders"` + Arg4 []string `json:"allowedOrigins"` }{} if err := json.Unmarshal(reqBody, &reqPayload); err != nil { s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) @@ -788,7 +792,7 @@ func (s *waasAuthenticatorAdminServer) serveUpdateTenantJSON(ctx context.Context } // Call service method implementation. - ret0, err := s.WaasAuthenticatorAdmin.UpdateTenant(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2, reqPayload.Arg3) + ret0, err := s.WaasAuthenticatorAdmin.UpdateTenant(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2, reqPayload.Arg3, reqPayload.Arg4) if err != nil { rpcErr, ok := err.(WebRPCError) if !ok { @@ -1006,14 +1010,15 @@ func (c *waasAuthenticatorAdminClient) GetTenant(ctx context.Context, projectId return out.Ret0, err } -func (c *waasAuthenticatorAdminClient) CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) { +func (c *waasAuthenticatorAdminClient) CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) { in := struct { Arg0 uint64 `json:"projectId"` Arg1 string `json:"waasAccessToken"` - Arg2 []*OpenIdProvider `json:"oidcProviders"` - Arg3 []string `json:"allowedOrigins"` - Arg4 *string `json:"password"` - }{projectId, waasAccessToken, oidcProviders, allowedOrigins, password} + Arg2 bool `json:"emailEnabled"` + Arg3 []*OpenIdProvider `json:"oidcProviders"` + Arg4 []string `json:"allowedOrigins"` + Arg5 *string `json:"password"` + }{projectId, waasAccessToken, emailEnabled, oidcProviders, allowedOrigins, password} out := struct { Ret0 *Tenant `json:"tenant"` Ret1 string `json:"upgradeCode"` @@ -1030,13 +1035,14 @@ func (c *waasAuthenticatorAdminClient) CreateTenant(ctx context.Context, project return out.Ret0, out.Ret1, err } -func (c *waasAuthenticatorAdminClient) UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) { +func (c *waasAuthenticatorAdminClient) UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) { in := struct { Arg0 uint64 `json:"projectId"` Arg1 string `json:"upgradeCode"` - Arg2 []*OpenIdProvider `json:"oidcProviders"` - Arg3 []string `json:"allowedOrigins"` - }{projectId, upgradeCode, oidcProviders, allowedOrigins} + Arg2 bool `json:"emailEnabled"` + Arg3 []*OpenIdProvider `json:"oidcProviders"` + Arg4 []string `json:"allowedOrigins"` + }{projectId, upgradeCode, emailEnabled, oidcProviders, allowedOrigins} out := struct { Ret0 *Tenant `json:"tenant"` }{} diff --git a/proto/authenticator.ridl b/proto/authenticator.ridl index f2382574..d34534a0 100644 --- a/proto/authenticator.ridl +++ b/proto/authenticator.ridl @@ -10,8 +10,7 @@ import ../vendor/github.com/0xsequence/go-sequence/intents/intent.ridl - IntentResponseCode - IntentResponse - Signature - - IntentName - - IntentResponseCode + - IdentityType struct Version - webrpcVersion: string @@ -79,6 +78,8 @@ struct TenantData + json = upgradeCode - waasAccessToken: string + json = waasAccessToken + - emailEnabled: bool + + json = emailEnabled - oidcProviders: []OpenIdProvider + go.field.name = OIDCProviders + json = oidcProviders @@ -94,11 +95,6 @@ struct MiniSequenceContext - factory: string - mainModule: string -enum IdentityType: uint8 - - None - - Guest - - OIDC - struct AccountData - projectId: uint64 + go.field.name = ProjectID @@ -141,6 +137,19 @@ struct SessionData - expiresAt: timestamp + json = expiresAt +struct VerificationContext + - projectId: uint64 + + go.field.name = ProjectID + - sessionId: string + + go.field.name = SessionID + - identityType: IdentityType + - verifier: string + - challenge?: string + - answer?: string + - attempts: int + - lastAttemptAt?: timestamp + - expiresAt: timestamp + ## ## Errors @@ -167,5 +176,5 @@ service WaasAuthenticatorAdmin - Clock() => (serverTime: timestamp) - GetTenant(projectId: uint64) => (tenant: Tenant) - - CreateTenant(projectId: uint64, waasAccessToken: string, oidcProviders: []OpenIdProvider, allowedOrigins: []string, password?: string) => (tenant: Tenant, upgradeCode: string) - - UpdateTenant(projectId: uint64, upgradeCode: string, oidcProviders: []OpenIdProvider, allowedOrigins: []string) => (tenant: Tenant) + - CreateTenant(projectId: uint64, waasAccessToken: string, emailEnabled: bool, oidcProviders: []OpenIdProvider, allowedOrigins: []string, password?: string) => (tenant: Tenant, upgradeCode: string) + - UpdateTenant(projectId: uint64, upgradeCode: string, emailEnabled: bool, oidcProviders: []OpenIdProvider, allowedOrigins: []string) => (tenant: Tenant) diff --git a/proto/clients/authenticator.gen.go b/proto/clients/authenticator.gen.go index bb2dca89..8b920393 100644 --- a/proto/clients/authenticator.gen.go +++ b/proto/clients/authenticator.gen.go @@ -1,6 +1,6 @@ -// sequence-waas-authenticator v0.1.0 2b3aee6b2e912ae0b3a6b4878672632d3025a99a +// sequence-waas-authenticator v0.1.0 ac3c2c244a304a00a769c89f84ff9c17c8f116bc // -- -// Code generated by webrpc-gen@v0.18.6 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.18.7 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=authenticator.ridl -target=golang -pkg=proto -client -out=./clients/authenticator.gen.go package proto @@ -33,7 +33,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "2b3aee6b2e912ae0b3a6b4878672632d3025a99a" + return "ac3c2c244a304a00a769c89f84ff9c17c8f116bc" } // @@ -43,6 +43,7 @@ func WebRPCSchemaHash() string { type IntentName string const ( + IntentName_initiateAuth IntentName = "initiateAuth" IntentName_openSession IntentName = "openSession" IntentName_closeSession IntentName = "closeSession" IntentName_validateSession IntentName = "validateSession" @@ -57,6 +58,7 @@ const ( IntentName_federateAccount IntentName = "federateAccount" IntentName_removeAccount IntentName = "removeAccount" IntentName_listAccounts IntentName = "listAccounts" + IntentName_getIdToken IntentName = "getIdToken" ) func (x IntentName) MarshalText() ([]byte, error) { @@ -83,6 +85,7 @@ func (x *IntentName) Is(values ...IntentName) bool { type IntentResponseCode string const ( + IntentResponseCode_authInitiated IntentResponseCode = "authInitiated" IntentResponseCode_sessionOpened IntentResponseCode = "sessionOpened" IntentResponseCode_sessionClosed IntentResponseCode = "sessionClosed" IntentResponseCode_sessionList IntentResponseCode = "sessionList" @@ -98,6 +101,7 @@ const ( IntentResponseCode_accountList IntentResponseCode = "accountList" IntentResponseCode_accountFederated IntentResponseCode = "accountFederated" IntentResponseCode_accountRemoved IntentResponseCode = "accountRemoved" + IntentResponseCode_idToken IntentResponseCode = "idToken" ) func (x IntentResponseCode) MarshalText() ([]byte, error) { @@ -121,55 +125,21 @@ func (x *IntentResponseCode) Is(values ...IntentResponseCode) bool { return false } -type Intent struct { - Version string `json:"version"` - Name IntentName `json:"name"` - ExpiresAt uint64 `json:"expiresAt"` - IssuedAt uint64 `json:"issuedAt"` - Data interface{} `json:"data"` - Signatures []*Signature `json:"signatures,omitempty"` -} - -type Signature struct { - SessionID string `json:"sessionId"` - Signature string `json:"signature"` -} - -type IntentResponse struct { - Code IntentResponseCode `json:"code"` - Data interface{} `json:"data"` -} - -type IdentityType uint8 +type IdentityType string const ( - IdentityType_None IdentityType = 0 - IdentityType_Guest IdentityType = 1 - IdentityType_OIDC IdentityType = 2 + IdentityType_None IdentityType = "None" + IdentityType_Guest IdentityType = "Guest" + IdentityType_OIDC IdentityType = "OIDC" + IdentityType_Email IdentityType = "Email" ) -var IdentityType_name = map[uint8]string{ - 0: "None", - 1: "Guest", - 2: "OIDC", -} - -var IdentityType_value = map[string]uint8{ - "None": 0, - "Guest": 1, - "OIDC": 2, -} - -func (x IdentityType) String() string { - return IdentityType_name[uint8(x)] -} - func (x IdentityType) MarshalText() ([]byte, error) { - return []byte(IdentityType_name[uint8(x)]), nil + return []byte(x), nil } func (x *IdentityType) UnmarshalText(b []byte) error { - *x = IdentityType(IdentityType_value[string(b)]) + *x = IdentityType(string(b)) return nil } @@ -185,6 +155,25 @@ func (x *IdentityType) Is(values ...IdentityType) bool { return false } +type Intent struct { + Version string `json:"version"` + Name IntentName `json:"name"` + ExpiresAt uint64 `json:"expiresAt"` + IssuedAt uint64 `json:"issuedAt"` + Data interface{} `json:"data"` + Signatures []*Signature `json:"signatures,omitempty"` +} + +type Signature struct { + SessionID string `json:"sessionId"` + Signature string `json:"signature"` +} + +type IntentResponse struct { + Code IntentResponseCode `json:"code"` + Data interface{} `json:"data"` +} + type Version struct { WebrpcVersion string `json:"webrpcVersion"` SchemaVersion string `json:"schemaVersion"` @@ -235,6 +224,7 @@ type TenantData struct { SequenceContext *MiniSequenceContext `json:"sequenceContext"` UpgradeCode string `json:"upgradeCode"` WaasAccessToken string `json:"waasAccessToken"` + EmailEnabled bool `json:"emailEnabled"` OIDCProviders []*OpenIdProvider `json:"oidcProviders"` KMSKeys []string `json:"kmsKeys"` AllowedOrigins validation.Origins `json:"allowedOrigins"` @@ -272,6 +262,18 @@ type SessionData struct { ExpiresAt time.Time `json:"expiresAt"` } +type VerificationContext struct { + ProjectID uint64 `json:"projectId"` + SessionID string `json:"sessionId"` + IdentityType IdentityType `json:"identityType"` + Verifier string `json:"verifier"` + Challenge *string `json:"challenge"` + Answer *string `json:"answer"` + Attempts int `json:"attempts"` + LastAttemptAt *time.Time `json:"lastAttemptAt"` + ExpiresAt time.Time `json:"expiresAt"` +} + var WebRPCServices = map[string][]string{ "WaasAuthenticator": { "RegisterSession", @@ -303,8 +305,8 @@ type WaasAuthenticatorAdmin interface { RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) GetTenant(ctx context.Context, projectId uint64) (*Tenant, error) - CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) - UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) + CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) + UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) } // @@ -322,8 +324,8 @@ type WaasAuthenticatorAdminClient interface { RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) Clock(ctx context.Context) (time.Time, error) GetTenant(ctx context.Context, projectId uint64) (*Tenant, error) - CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) - UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) + CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) + UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) } // @@ -495,14 +497,15 @@ func (c *waasAuthenticatorAdminClient) GetTenant(ctx context.Context, projectId return out.Ret0, err } -func (c *waasAuthenticatorAdminClient) CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) { +func (c *waasAuthenticatorAdminClient) CreateTenant(ctx context.Context, projectId uint64, waasAccessToken string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string, password *string) (*Tenant, string, error) { in := struct { Arg0 uint64 `json:"projectId"` Arg1 string `json:"waasAccessToken"` - Arg2 []*OpenIdProvider `json:"oidcProviders"` - Arg3 []string `json:"allowedOrigins"` - Arg4 *string `json:"password"` - }{projectId, waasAccessToken, oidcProviders, allowedOrigins, password} + Arg2 bool `json:"emailEnabled"` + Arg3 []*OpenIdProvider `json:"oidcProviders"` + Arg4 []string `json:"allowedOrigins"` + Arg5 *string `json:"password"` + }{projectId, waasAccessToken, emailEnabled, oidcProviders, allowedOrigins, password} out := struct { Ret0 *Tenant `json:"tenant"` Ret1 string `json:"upgradeCode"` @@ -519,13 +522,14 @@ func (c *waasAuthenticatorAdminClient) CreateTenant(ctx context.Context, project return out.Ret0, out.Ret1, err } -func (c *waasAuthenticatorAdminClient) UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) { +func (c *waasAuthenticatorAdminClient) UpdateTenant(ctx context.Context, projectId uint64, upgradeCode string, emailEnabled bool, oidcProviders []*OpenIdProvider, allowedOrigins []string) (*Tenant, error) { in := struct { Arg0 uint64 `json:"projectId"` Arg1 string `json:"upgradeCode"` - Arg2 []*OpenIdProvider `json:"oidcProviders"` - Arg3 []string `json:"allowedOrigins"` - }{projectId, upgradeCode, oidcProviders, allowedOrigins} + Arg2 bool `json:"emailEnabled"` + Arg3 []*OpenIdProvider `json:"oidcProviders"` + Arg4 []string `json:"allowedOrigins"` + }{projectId, upgradeCode, emailEnabled, oidcProviders, allowedOrigins} out := struct { Ret0 *Tenant `json:"tenant"` }{} diff --git a/proto/clients/authenticator.gen.ts b/proto/clients/authenticator.gen.ts index bd551bf3..cf79906f 100644 --- a/proto/clients/authenticator.gen.ts +++ b/proto/clients/authenticator.gen.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -// sequence-waas-authenticator v0.1.0 2b3aee6b2e912ae0b3a6b4878672632d3025a99a +// sequence-waas-authenticator v0.1.0 ac3c2c244a304a00a769c89f84ff9c17c8f116bc // -- -// Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.18.7 with typescript generator. DO NOT EDIT. // // webrpc-gen -schema=authenticator.ridl -target=typescript -client -out=./clients/authenticator.gen.ts @@ -12,7 +12,7 @@ export const WebRPCVersion = "v1" export const WebRPCSchemaVersion = "v0.1.0" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = "2b3aee6b2e912ae0b3a6b4878672632d3025a99a" +export const WebRPCSchemaHash = "ac3c2c244a304a00a769c89f84ff9c17c8f116bc" // // Types @@ -20,6 +20,7 @@ export const WebRPCSchemaHash = "2b3aee6b2e912ae0b3a6b4878672632d3025a99a" export enum IntentName { + initiateAuth = 'initiateAuth', openSession = 'openSession', closeSession = 'closeSession', validateSession = 'validateSession', @@ -33,10 +34,12 @@ export enum IntentName { getTransactionReceipt = 'getTransactionReceipt', federateAccount = 'federateAccount', removeAccount = 'removeAccount', - listAccounts = 'listAccounts' + listAccounts = 'listAccounts', + getIdToken = 'getIdToken' } export enum IntentResponseCode { + authInitiated = 'authInitiated', sessionOpened = 'sessionOpened', sessionClosed = 'sessionClosed', sessionList = 'sessionList', @@ -51,7 +54,15 @@ export enum IntentResponseCode { getSessionResponse = 'getSessionResponse', accountList = 'accountList', accountFederated = 'accountFederated', - accountRemoved = 'accountRemoved' + accountRemoved = 'accountRemoved', + idToken = 'idToken' +} + +export enum IdentityType { + None = 'None', + Guest = 'Guest', + OIDC = 'OIDC', + Email = 'Email' } export interface Intent { @@ -73,12 +84,6 @@ export interface IntentResponse { data: any } -export enum IdentityType { - None = 'None', - Guest = 'Guest', - OIDC = 'OIDC' -} - export interface Version { webrpcVersion: string schemaVersion: string @@ -128,6 +133,7 @@ export interface TenantData { sequenceContext: MiniSequenceContext upgradeCode: string waasAccessToken: string + emailEnabled: boolean oidcProviders: Array kmsKeys: Array allowedOrigins: Array @@ -165,6 +171,18 @@ export interface SessionData { expiresAt: string } +export interface VerificationContext { + projectId: number + sessionId: string + identityType: IdentityType + verifier: string + challenge?: string + answer?: string + attempts: number + lastAttemptAt?: string + expiresAt: string +} + export interface WaasAuthenticator { registerSession(args: RegisterSessionArgs, headers?: object, signal?: AbortSignal): Promise sendIntent(args: SendIntentArgs, headers?: object, signal?: AbortSignal): Promise @@ -231,6 +249,7 @@ export interface GetTenantReturn { export interface CreateTenantArgs { projectId: number waasAccessToken: string + emailEnabled: boolean oidcProviders: Array allowedOrigins: Array password?: string @@ -243,6 +262,7 @@ export interface CreateTenantReturn { export interface UpdateTenantArgs { projectId: number upgradeCode: string + emailEnabled: boolean oidcProviders: Array allowedOrigins: Array } From da429af5ba37732077cbe1c8767456a684a6eaac Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:27:59 +0200 Subject: [PATCH 06/13] proto: add Email identity type handling --- proto/identity.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/proto/identity.go b/proto/identity.go index e4eb70b9..7dd9f27d 100644 --- a/proto/identity.go +++ b/proto/identity.go @@ -8,7 +8,9 @@ import ( func (id Identity) String() string { switch id.Type { case IdentityType_OIDC: - return id.Type.String() + ":" + id.Issuer + "#" + id.Subject + return string(id.Type) + ":" + id.Issuer + "#" + id.Subject + case IdentityType_Email: + return string(id.Type) + ":" + id.Email default: return "" } @@ -20,7 +22,7 @@ func (id *Identity) FromString(s string) error { return fmt.Errorf("invalid identity format: %s", s) } - switch IdentityType(IdentityType_value[parts[0]]) { + switch IdentityType(parts[0]) { case IdentityType_OIDC: oidcParts := strings.SplitN(parts[1], "#", 2) if len(oidcParts) != 2 { @@ -30,6 +32,10 @@ func (id *Identity) FromString(s string) error { id.Issuer = oidcParts[0] id.Subject = oidcParts[1] + case IdentityType_Email: + id.Type = IdentityType_Email + id.Email = parts[1] + default: return fmt.Errorf("invalid identity type: %s", parts[0]) } From fecf065a22811236dbebd7f7c884be5eaeeee02c Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:29:07 +0200 Subject: [PATCH 07/13] data: handle VerificationContext data entity --- data/verification_context.go | 170 +++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 data/verification_context.go diff --git a/data/verification_context.go b/data/verification_context.go new file mode 100644 index 00000000..b130afac --- /dev/null +++ b/data/verification_context.go @@ -0,0 +1,170 @@ +package data + +import ( + "context" + "fmt" + "strconv" + "strings" + "time" + + "github.com/0xsequence/go-sequence/intents" + "github.com/0xsequence/waas-authenticator/proto" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue" + "github.com/aws/aws-sdk-go-v2/service/dynamodb" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" +) + +type AuthID struct { + ProjectID uint64 + IdentityType intents.IdentityType + Verifier string +} + +func (id AuthID) String() string { + return fmt.Sprintf("%d/%s/%s", id.ProjectID, id.IdentityType, id.Verifier) +} + +func (id *AuthID) FromString(s string) error { + parts := strings.SplitN(s, "/", 3) + if len(parts) != 3 { + return fmt.Errorf("invalid auth session ID format: %s", s) + } + + projID, err := strconv.Atoi(parts[0]) + if err != nil { + return fmt.Errorf("invalid project ID: %s", s) + } + + id.ProjectID = uint64(projID) + id.IdentityType = intents.IdentityType(parts[1]) + id.Verifier = parts[2] + return nil +} + +func (id *AuthID) MarshalDynamoDBAttributeValue() (types.AttributeValue, error) { + return &types.AttributeValueMemberS{Value: id.String()}, nil +} + +func (id *AuthID) UnmarshalDynamoDBAttributeValue(value types.AttributeValue) error { + v, ok := value.(*types.AttributeValueMemberS) + if !ok { + return fmt.Errorf("invalid auth session ID of type: %T", value) + } + return id.FromString(v.Value) +} + +type VerificationContext struct { + ID AuthID `dynamodbav:"ID"` + EncryptedKey []byte `dynamodbav:"EncryptedKey"` + Algorithm string `dynamodbav:"Algorithm"` + Ciphertext []byte `dynamodbav:"Ciphertext"` + CreatedAt time.Time `dynamodbav:"CreatedAt"` +} + +func (s *VerificationContext) Key() map[string]types.AttributeValue { + return map[string]types.AttributeValue{ + "ID": &types.AttributeValueMemberS{Value: s.ID.String()}, + } +} + +func (s *VerificationContext) CorrespondsTo(data *proto.VerificationContext) bool { + if string(s.ID.IdentityType) != string(data.IdentityType) { + return false + } + if s.ID.Verifier != data.Verifier { + return false + } + if s.ID.ProjectID != data.ProjectID { + return false + } + return true +} + +type VerificationContextTable struct { + db DB + tableARN string +} + +func NewVerificationContextTable(db DB, tableARN string) *VerificationContextTable { + return &VerificationContextTable{ + db: db, + tableARN: tableARN, + } +} + +// Put updates a VerificationContext by ID or creates one if it doesn't exist yet. +func (t *VerificationContextTable) Put(ctx context.Context, verifCtx *VerificationContext) error { + verifCtx.CreatedAt = time.Now() + + av, err := attributevalue.MarshalMap(verifCtx) + if err != nil { + return fmt.Errorf("marshal input: %w", err) + } + input := &dynamodb.PutItemInput{ + TableName: aws.String(t.tableARN), + Item: av, + } + if _, err := t.db.PutItem(ctx, input); err != nil { + return fmt.Errorf("PutItem: %w", err) + } + return nil +} + +// Get returns an AuthSession from the DB with the given ID. +// +// AuthSession not being found is not considered an error. Instead, it returns `false` as second value if the AuthSession +// was not found. +func (t *VerificationContextTable) Get(ctx context.Context, id AuthID) (*VerificationContext, bool, error) { + verifCtx := VerificationContext{ID: id} + input := &dynamodb.GetItemInput{ + TableName: aws.String(t.tableARN), + Key: verifCtx.Key(), + } + + out, err := t.db.GetItem(ctx, input) + if err != nil { + return nil, false, fmt.Errorf("GetItem: %w", err) + } + if len(out.Item) == 0 { + return nil, false, nil + } + + if err := attributevalue.UnmarshalMap(out.Item, &verifCtx); err != nil { + return nil, false, fmt.Errorf("unmarshal result: %w", err) + } + return &verifCtx, true, nil +} + +func (t *VerificationContextTable) UpdateData( + ctx context.Context, current *VerificationContext, encryptedKey []byte, algorithm string, ciphertext []byte, +) error { + oldEncryptedKey := current.EncryptedKey + oldAlgorithm := current.Algorithm + oldCiphertext := current.Ciphertext + + current.EncryptedKey = encryptedKey + current.Algorithm = algorithm + current.Ciphertext = ciphertext + + av, err := attributevalue.MarshalMap(current) + if err != nil { + return fmt.Errorf("marshal input: %w", err) + } + input := &dynamodb.PutItemInput{ + TableName: aws.String(t.tableARN), + Item: av, + ConditionExpression: aws.String( + "attribute_exists(ID) AND EncryptedKey = :encrypted_key AND Algorithm = :algorithm AND Ciphertext = :ciphertext", + ), + ExpressionAttributeValues: map[string]types.AttributeValue{ + ":encrypted_key": &types.AttributeValueMemberB{Value: oldEncryptedKey}, + ":algorithm": &types.AttributeValueMemberS{Value: oldAlgorithm}, + ":ciphertext": &types.AttributeValueMemberB{Value: oldCiphertext}, + }, + } + if _, err := t.db.PutItem(ctx, input); err != nil { + return fmt.Errorf("UpdateData: %w", err) + } + return nil +} From 60d7f9a8ada74b8cb6951d1693b2f72ea1e09477 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:30:08 +0200 Subject: [PATCH 08/13] auth: move identity to new auth pkg with email and oidc providers --- rpc/auth/email/provider.go | 202 +++++++++++++++++++ rpc/auth/email/sender.go | 16 ++ rpc/auth/email/ses.go | 71 +++++++ rpc/{identity => auth/oidc}/keyset.go | 2 +- rpc/auth/oidc/legacy.go | 275 ++++++++++++++++++++++++++ rpc/auth/provider.go | 40 ++++ rpc/identity/oidc.go | 95 --------- rpc/identity/verifier.go | 135 ------------- 8 files changed, 605 insertions(+), 231 deletions(-) create mode 100644 rpc/auth/email/provider.go create mode 100644 rpc/auth/email/sender.go create mode 100644 rpc/auth/email/ses.go rename rpc/{identity => auth/oidc}/keyset.go (99%) create mode 100644 rpc/auth/oidc/legacy.go create mode 100644 rpc/auth/provider.go delete mode 100644 rpc/identity/oidc.go delete mode 100644 rpc/identity/verifier.go diff --git a/rpc/auth/email/provider.go b/rpc/auth/email/provider.go new file mode 100644 index 00000000..41af20c5 --- /dev/null +++ b/rpc/auth/email/provider.go @@ -0,0 +1,202 @@ +package email + +import ( + "context" + "crypto/rand" + "fmt" + "io" + "math/big" + "strings" + "time" + + "github.com/0xsequence/ethkit/go-ethereum/common/hexutil" + ethcrypto "github.com/0xsequence/ethkit/go-ethereum/crypto" + "github.com/0xsequence/go-sequence/intents" + "github.com/0xsequence/waas-authenticator/proto" + "github.com/0xsequence/waas-authenticator/proto/builder" + proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" + "github.com/0xsequence/waas-authenticator/rpc/attestation" + "github.com/0xsequence/waas-authenticator/rpc/auth" + "github.com/0xsequence/waas-authenticator/rpc/tenant" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" +) + +// AuthProvider is a Verifier that uses a secret code, delivered to user's email address, as the auth challenge. +type AuthProvider struct { + Sender Sender + Wallets proto_wallet.WaaS + Builder builder.Builder +} + +func NewAuthProvider(sender Sender, wallets proto_wallet.WaaS, builder builder.Builder) auth.Provider { + return &AuthProvider{ + Sender: sender, + Wallets: wallets, + Builder: builder, + } +} + +// InitiateAuth for Email ignores any preexisting auth session data. Instead, if called multiple times, the auth session +// is replaced. This allows the user to resend the verification code in case of issues. Note that this invalidates the +// previous auth session - only the most recent one is stored and used in Verify. +func (m *AuthProvider) InitiateAuth( + ctx context.Context, + verifCtx *proto.VerificationContext, + verifier string, + intent *intents.Intent, + storeFn auth.StoreVerificationContextFn, +) (*intents.IntentResponseAuthInitiated, error) { + att := attestation.FromContext(ctx) + tnt := tenant.FromContext(ctx) + + // the verifier consists of the email address and sessionID separated by ';' + emailAddress, sessionID, err := m.extractVerifier(verifier) + if err != nil { + return nil, err + } + if sessionID != intent.Signers()[0] { + return nil, fmt.Errorf("invalid session ID") + } + + // TODO: validate email address + + // Retrieve the email template from the Builder. + tplType := builder.EmailTemplateType_LOGIN + tpl, err := m.Builder.GetEmailTemplate(ctx, tnt.ProjectID, &tplType) + if err != nil { + return nil, fmt.Errorf("failed to build email template: %w", err) + } + + // generate the secret verification code to be sent to the user + secretCode, err := randomDigits(att, 6) + if err != nil { + return nil, err + } + // client salt is sent back to the client in the intent response + clientSalt, err := randomHex(att, 12) + if err != nil { + return nil, err + } + // server salt is sent to the WaaS API and stored in the auth session + serverSalt, err := randomHex(att, 12) + if err != nil { + return nil, err + } + + // clientAnswer is the value that we expect the client to produce + clientAnswer := hexutil.Encode(ethcrypto.Keccak256([]byte(clientSalt + secretCode))) + + // serverAnswer is the value we compare the answer against during verification + serverAnswer := hexutil.Encode(ethcrypto.Keccak256([]byte(serverSalt + clientAnswer))) + + // WaaS API is expected to store the answer and salt for later verification + _, err = m.Wallets.InitiateEmailAuth(waasapi.Context(ctx), waasapi.ConvertToAPIIntent(intent), serverAnswer, serverSalt) + if err != nil { + return nil, fmt.Errorf("initiating email auth with WaaS API: %m", err) + } + + verifCtx = &proto.VerificationContext{ + ProjectID: tnt.ProjectID, + SessionID: intent.Signers()[0], + IdentityType: proto.IdentityType_Email, + Verifier: verifier, + Challenge: &serverSalt, // the SERVER salt is a challenge in server's context + Answer: &serverAnswer, // the final answer, after hashing clientAnswer with serverSalt + ExpiresAt: time.Now().Add(30 * time.Minute), + } + if err := storeFn(ctx, verifCtx); err != nil { + return nil, err + } + + // Build the email message. The template is expected to contain the `{auth_code}` tag to be replaced with the + // generated secret code. + msg := &Message{ + Recipient: emailAddress, + Subject: tpl.Subject, + HTML: strings.Replace(*tpl.Template, "{auth_code}", secretCode, 1), + Text: tpl.IntroText + "\n\n" + secretCode, + } + if err := m.Sender.Send(ctx, msg); err != nil { + return nil, fmt.Errorf("failed to send email: %w", err) + } + + // Client should combine the challenge from the response with the code from the email address and hash it. + // The resulting value is the clientAnswer that is then send with the openSession intent and passed to Verify. + res := &intents.IntentResponseAuthInitiated{ + SessionID: verifCtx.SessionID, + IdentityType: intents.IdentityType_Email, + ExpiresIn: int(time.Now().Sub(verifCtx.ExpiresAt).Seconds()), + Challenge: &clientSalt, // the CLIENT salt is a challenge in client's context + } + return res, nil +} + +// Verify requires the auth session to exist as it contains the challenge and final answer. The challenge (server salt) +// from the auth session is combined with the client's answer and the resulting value compared with the final answer. +// Verify returns the identity if this is successful. +func (m *AuthProvider) Verify(ctx context.Context, verifCtx *proto.VerificationContext, sessionID string, answer string) (proto.Identity, error) { + if verifCtx == nil { + return proto.Identity{}, fmt.Errorf("auth session not found") + } + + if verifCtx.Challenge == nil || verifCtx.Answer == nil { + return proto.Identity{}, fmt.Errorf("auth session did not have challenge/answer") + } + + // the verifier consists of the email address and sessionID separated by ';' + emailAddress, verifierSessionID, err := m.extractVerifier(verifCtx.Verifier) + if err != nil { + return proto.Identity{}, err + } + if verifierSessionID != sessionID { + return proto.Identity{}, fmt.Errorf("invalid session ID") + } + + // challenge here is the server salt; combined with the client's answer and hashed it produces the serverAnswer + serverAnswer := hexutil.Encode(ethcrypto.Keccak256([]byte(*verifCtx.Challenge + answer))) + if serverAnswer != *verifCtx.Answer { + return proto.Identity{}, fmt.Errorf("incorrect answer") + } + + ident := proto.Identity{ + Type: proto.IdentityType_Email, + Email: emailAddress, + } + return ident, nil +} + +// ValidateTenant always succeeds as there are no email-specific settings to validate. +func (m *AuthProvider) ValidateTenant(ctx context.Context, tenant *proto.TenantData) error { + return nil +} + +func (m *AuthProvider) extractVerifier(verifier string) (emailAddress string, sessionID string, err error) { + parts := strings.SplitN(verifier, ";", 2) + if len(parts) != 2 { + return "", "", fmt.Errorf("invalid verifier") + } + return parts[0], parts[1], nil +} + +func randomDigits(source io.Reader, n int) (string, error) { + const digits = "0123456789" + result := make([]byte, n) + + for i := range result { + num, err := rand.Int(source, big.NewInt(int64(len(digits)))) + if err != nil { + return "", err + } + result[i] = digits[num.Int64()] + } + + return string(result), nil +} + +func randomHex(source io.Reader, n int) (string, error) { + b := make([]byte, n) + if _, err := source.Read(b); err != nil { + return "", err + } + return hexutil.Encode(b), nil +} diff --git a/rpc/auth/email/sender.go b/rpc/auth/email/sender.go new file mode 100644 index 00000000..c8b77d16 --- /dev/null +++ b/rpc/auth/email/sender.go @@ -0,0 +1,16 @@ +package email + +import ( + "context" +) + +type Message struct { + Recipient string + Subject string + HTML string + Text string +} + +type Sender interface { + Send(ctx context.Context, message *Message) error +} diff --git a/rpc/auth/email/ses.go b/rpc/auth/email/ses.go new file mode 100644 index 00000000..cf19f44e --- /dev/null +++ b/rpc/auth/email/ses.go @@ -0,0 +1,71 @@ +package email + +import ( + "context" + + "github.com/0xsequence/waas-authenticator/config" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials/stscreds" + "github.com/aws/aws-sdk-go-v2/service/ses" + "github.com/aws/aws-sdk-go-v2/service/ses/types" + "github.com/aws/aws-sdk-go-v2/service/sts" +) + +type sesSender struct { + client *ses.Client + source *string + sourceARN *string +} + +func NewSESSender(awsCfg aws.Config, cfg config.SESConfig) Sender { + if cfg.AccessRoleARN != "" { + stsClient := sts.NewFromConfig(awsCfg) + creds := stscreds.NewAssumeRoleProvider(stsClient, cfg.AccessRoleARN) + awsCfg.Credentials = aws.NewCredentialsCache(creds) + } + + if cfg.Region != "" { + awsCfg.Region = cfg.Region + } + + sender := &sesSender{ + client: ses.NewFromConfig(awsCfg), + } + + if cfg.Source != "" { + sender.source = &cfg.Source + } + + if cfg.SourceARN != "" { + sender.sourceARN = &cfg.SourceARN + } + + return sender +} + +func (s *sesSender) Send(ctx context.Context, msg *Message) error { + _, err := s.client.SendEmail(ctx, &ses.SendEmailInput{ + Destination: &types.Destination{ + ToAddresses: []string{msg.Recipient}, + }, + Message: &types.Message{ + Body: &types.Body{ + Html: &types.Content{ + Data: &msg.HTML, + Charset: aws.String("UTF-8"), + }, + Text: &types.Content{ + Data: &msg.Text, + Charset: aws.String("UTF-8"), + }, + }, + Subject: &types.Content{ + Data: &msg.Subject, + Charset: aws.String("UTF-8"), + }, + }, + Source: s.source, + SourceArn: s.sourceARN, + }) + return err +} diff --git a/rpc/identity/keyset.go b/rpc/auth/oidc/keyset.go similarity index 99% rename from rpc/identity/keyset.go rename to rpc/auth/oidc/keyset.go index 7fc62013..6437dbf0 100644 --- a/rpc/identity/keyset.go +++ b/rpc/auth/oidc/keyset.go @@ -1,4 +1,4 @@ -package identity +package oidc import ( "context" diff --git a/rpc/auth/oidc/legacy.go b/rpc/auth/oidc/legacy.go new file mode 100644 index 00000000..105b9d22 --- /dev/null +++ b/rpc/auth/oidc/legacy.go @@ -0,0 +1,275 @@ +package oidc + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "slices" + "strings" + "time" + + "github.com/0xsequence/ethkit/ethcoder" + "github.com/0xsequence/go-sequence/intents" + "github.com/0xsequence/waas-authenticator/proto" + "github.com/0xsequence/waas-authenticator/rpc/auth" + "github.com/0xsequence/waas-authenticator/rpc/tenant" + "github.com/0xsequence/waas-authenticator/rpc/tracing" + "github.com/goware/cachestore" + "github.com/goware/cachestore/cachestorectl" + "github.com/lestrrat-go/jwx/v2/jwk" + "github.com/lestrrat-go/jwx/v2/jws" + "github.com/lestrrat-go/jwx/v2/jwt" + "golang.org/x/sync/errgroup" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) + Get(string) (*http.Response, error) +} + +// LegacyAuthProvider is triggered when the openSession intent doesn't specify an explicit identityType as legacy clients +// will. However, it handles identities of type OIDC. It's a one-step flow, without using initiateAuth, the clients are +// expected to call openSession directly. Because of this, LegacyAuthProvider puts an additional requirement on the ID +// tokens passed to it: they must contain the `nonce` or `sequence:session_hash` claim equal to the hash of the session +// the client attempts to open. +type LegacyAuthProvider struct { + client HTTPClient + store cachestore.Store[jwk.Key] +} + +func NewLegacyAuthProvider(cacheBackend cachestore.Backend, client HTTPClient) (auth.Provider, error) { + if client == nil { + client = http.DefaultClient + } + store, err := cachestorectl.Open[jwk.Key](cacheBackend) + if err != nil { + return nil, err + } + return &LegacyAuthProvider{ + client: client, + store: store, + }, nil +} + +// InitiateAuth returns an error in the legacy flow. +func (v *LegacyAuthProvider) InitiateAuth( + ctx context.Context, + verifCtx *proto.VerificationContext, + verifier string, + intent *intents.Intent, + storeFn auth.StoreVerificationContextFn, +) (*intents.IntentResponseAuthInitiated, error) { + if verifCtx != nil { + return nil, fmt.Errorf("unexpected auth session for identity type that does not support it") + } + return nil, fmt.Errorf("this identity type does not support initiateAuth") +} + +func (v *LegacyAuthProvider) Verify( + ctx context.Context, verifCtx *proto.VerificationContext, sessionID string, answer string, +) (ident proto.Identity, err error) { + ctx, span := tracing.Span(ctx, "LegacyAuthProvider.Verify") + defer func() { + if err != nil { + span.RecordError(err) + } + span.End() + }() + + if verifCtx != nil { + return proto.Identity{}, fmt.Errorf("unexpected auth session for identity type that does not support it") + } + + tok, err := jwt.Parse([]byte(answer), jwt.WithVerify(false), jwt.WithValidate(false)) + if err != nil { + return proto.Identity{}, fmt.Errorf("parse JWT: %w", err) + } + + issuer := normalizeIssuer(tok.Issuer()) + idp := getOIDCProvider(ctx, issuer) + if idp == nil { + return proto.Identity{}, fmt.Errorf("issuer %q not valid for this tenant", issuer) + } + + ks := &operationKeySet{ + ctx: ctx, + iss: issuer, + store: v.store, + getKeySet: v.GetKeySet, + } + + if _, err := jws.Verify([]byte(answer), jws.WithKeySet(ks, jws.WithMultipleKeysPerKeyID(false))); err != nil { + return proto.Identity{}, fmt.Errorf("signature verification: %w", err) + } + + sessionHash := ethcoder.Keccak256Hash([]byte(strings.ToLower(sessionID))).String() + validateOptions := []jwt.ValidateOption{ + jwt.WithValidator(withIssuer(idp.Issuer)), + jwt.WithValidator(withSessionHash(sessionHash)), + jwt.WithAcceptableSkew(10 * time.Second), + jwt.WithValidator(withAudience(idp.Audience)), + } + + if err := jwt.Validate(tok, validateOptions...); err != nil { + return proto.Identity{}, fmt.Errorf("JWT validation: %w", err) + } + + identity := proto.Identity{ + Type: proto.IdentityType_OIDC, + Issuer: issuer, + Subject: tok.Subject(), + Email: getEmailFromToken(tok), + } + return identity, nil +} + +func (v *LegacyAuthProvider) ValidateTenant(ctx context.Context, tenant *proto.TenantData) error { + var wg errgroup.Group + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + for i, provider := range tenant.OIDCProviders { + provider := provider + + if provider.Issuer == "" { + return fmt.Errorf("provider %d: empty issuer", i) + } + + if len(provider.Audience) < 1 { + return fmt.Errorf("provider %d: at least one audience is required", i) + } + + wg.Go(func() error { + if _, err := v.GetKeySet(ctx, provider.Issuer); err != nil { + return err + } + return nil + }) + } + + return wg.Wait() +} + +func (v *LegacyAuthProvider) GetKeySet(ctx context.Context, issuer string) (set jwk.Set, err error) { + ctx, span := tracing.Span(ctx, "LegacyAuthProvider.GetKeySet") + defer func() { + if err != nil { + span.RecordError(err) + } + span.End() + }() + + jwksURL, err := fetchJWKSURL(ctx, v.client, issuer) + if err != nil { + return nil, fmt.Errorf("fetch issuer keys: %w", err) + } + + keySet, err := jwk.Fetch(ctx, jwksURL, jwk.WithHTTPClient(tracing.WrapClientWithContext(ctx, v.client))) + if err != nil { + return nil, fmt.Errorf("fetch issuer keys: %w", err) + } + return keySet, nil +} + +func withIssuer(expectedIss string) jwt.ValidatorFunc { + return func(ctx context.Context, tok jwt.Token) jwt.ValidationError { + if normalizeIssuer(tok.Issuer()) != expectedIss { + return jwt.NewValidationError(fmt.Errorf("iss not satisfied")) + } + return nil + } +} + +func withSessionHash(expectedSessionHash string) jwt.ValidatorFunc { + return func(ctx context.Context, tok jwt.Token) jwt.ValidationError { + sessHashClaim, ok := tok.Get("sequence:session_hash") + if ok && sessHashClaim == expectedSessionHash { + return nil + } + + nonceClaim, ok := tok.Get("nonce") + if !ok { + return jwt.NewValidationError(fmt.Errorf("nonce not satisfied")) + } + + nonceVal, _ := nonceClaim.(string) + if nonceVal != "" && nonceVal == expectedSessionHash { + return nil + } + + return jwt.NewValidationError(fmt.Errorf("nonce not satisfied: %s != %s", nonceVal, expectedSessionHash)) + } +} + +func withAudience(expectedAudience []string) jwt.ValidatorFunc { + return func(ctx context.Context, tok jwt.Token) jwt.ValidationError { + tokAudiences := tok.Audience() + for _, aud := range expectedAudience { + if slices.Contains(tokAudiences, aud) { + return nil + } + } + + return jwt.NewValidationError(fmt.Errorf("aud not satisfied")) + } +} + +func getOIDCProvider(ctx context.Context, issuer string) *proto.OpenIdProvider { + tntData := tenant.FromContext(ctx) + for _, idp := range tntData.OIDCProviders { + if idp.Issuer == issuer { + return idp + } + } + return nil +} + +func fetchJWKSURL(ctx context.Context, client HTTPClient, iss string) (string, error) { + // Construct the URL to the issuer's .well-known/openid-configuration endpoint + issuerConfigURL := normalizeIssuer(iss) + "/.well-known/openid-configuration" + + req, err := http.NewRequest(http.MethodGet, issuerConfigURL, nil) + if err != nil { + return "", err + } + + resp, err := client.Do(req.WithContext(ctx)) + if err != nil { + return "", err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return "", errors.New("failed to fetch openid configuration") + } + + var config map[string]interface{} + if err := json.NewDecoder(resp.Body).Decode(&config); err != nil { + return "", err + } + + jwksURI, ok := config["jwks_uri"].(string) + if !ok { + return "", errors.New("jwks_uri not found in openid configuration") + } + + return jwksURI, nil +} + +func normalizeIssuer(iss string) string { + if !strings.HasPrefix(iss, "https://") && !strings.HasPrefix(iss, "http://") { + return "https://" + iss + } + return iss +} + +func getEmailFromToken(tok jwt.Token) string { + emailClaim, ok := tok.Get("email") + if !ok { + return "" + } + email, _ := emailClaim.(string) + return email +} diff --git a/rpc/auth/provider.go b/rpc/auth/provider.go new file mode 100644 index 00000000..abaa2804 --- /dev/null +++ b/rpc/auth/provider.go @@ -0,0 +1,40 @@ +package auth + +import ( + "context" + + "github.com/0xsequence/go-sequence/intents" + "github.com/0xsequence/waas-authenticator/proto" +) + +type StoreVerificationContextFn func(context.Context, *proto.VerificationContext) error + +type Provider interface { + // InitiateAuth is called as the first step in the authentication process, triggered by the initiateAuth intent. + // Provider should use this to prepare the challenge and store it in a verification context for later Verify use, + // if needed, using the function passed to it. + // + // Optionally, InitiateAuth might receive a non-nil verifCtx if a VerificationContext already exists for this + // specific project/identityType/verifier combination. Provider might decide to either ignore it, override the + // verification context or return an error. + InitiateAuth( + ctx context.Context, + verifCtx *proto.VerificationContext, + verifier string, + intent *intents.Intent, + storeFn StoreVerificationContextFn, + ) (*intents.IntentResponseAuthInitiated, error) + + // Verify is triggered by the openSession intent. Provider should use the VerificationContext and answer passed to + // it to validate the user's sign in attempt. Returning an Identity with no error will cause a valid session to be + // opened. Otherwise, the VerificationContext is updated by the caller, increasing the Attempts count. + // + // The VerificationContext might be nil if the user sent the openSession intent without sending initiateAuth first. + Verify( + ctx context.Context, verifCtx *proto.VerificationContext, sessionID string, answer string, + ) (proto.Identity, error) + + // ValidateTenant is called by the admin service whenever the Tenant is created or updated. Provider should verify + // that the configuration is correct and valid for the specific identity type. + ValidateTenant(ctx context.Context, tenant *proto.TenantData) error +} diff --git a/rpc/identity/oidc.go b/rpc/identity/oidc.go deleted file mode 100644 index f23ea00f..00000000 --- a/rpc/identity/oidc.go +++ /dev/null @@ -1,95 +0,0 @@ -package identity - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "strings" - - "github.com/0xsequence/waas-authenticator/proto" - "github.com/0xsequence/waas-authenticator/rpc/tenant" - "github.com/0xsequence/waas-authenticator/rpc/tracing" - "github.com/lestrrat-go/jwx/v2/jwk" - "github.com/lestrrat-go/jwx/v2/jwt" -) - -func (v *Verifier) GetKeySet(ctx context.Context, issuer string) (set jwk.Set, err error) { - ctx, span := tracing.Span(ctx, "identity.GetKeySet") - defer func() { - if err != nil { - span.RecordError(err) - } - span.End() - }() - - jwksURL, err := fetchJWKSURL(ctx, v.client, issuer) - if err != nil { - return nil, fmt.Errorf("fetch issuer keys: %w", err) - } - - keySet, err := jwk.Fetch(ctx, jwksURL, jwk.WithHTTPClient(tracing.WrapClientWithContext(ctx, v.client))) - if err != nil { - return nil, fmt.Errorf("fetch issuer keys: %w", err) - } - return keySet, nil -} - -func getOIDCProvider(ctx context.Context, issuer string) *proto.OpenIdProvider { - tntData := tenant.FromContext(ctx) - for _, idp := range tntData.OIDCProviders { - if idp.Issuer == issuer { - return idp - } - } - return nil -} - -func fetchJWKSURL(ctx context.Context, client HTTPClient, iss string) (string, error) { - // Construct the URL to the issuer's .well-known/openid-configuration endpoint - issuerConfigURL := normalizeIssuer(iss) + "/.well-known/openid-configuration" - - req, err := http.NewRequest(http.MethodGet, issuerConfigURL, nil) - if err != nil { - return "", err - } - - resp, err := client.Do(req.WithContext(ctx)) - if err != nil { - return "", err - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - return "", errors.New("failed to fetch openid configuration") - } - - var config map[string]interface{} - if err := json.NewDecoder(resp.Body).Decode(&config); err != nil { - return "", err - } - - jwksURI, ok := config["jwks_uri"].(string) - if !ok { - return "", errors.New("jwks_uri not found in openid configuration") - } - - return jwksURI, nil -} - -func normalizeIssuer(iss string) string { - if !strings.HasPrefix(iss, "https://") && !strings.HasPrefix(iss, "http://") { - return "https://" + iss - } - return iss -} - -func getEmailFromToken(tok jwt.Token) string { - emailClaim, ok := tok.Get("email") - if !ok { - return "" - } - email, _ := emailClaim.(string) - return email -} diff --git a/rpc/identity/verifier.go b/rpc/identity/verifier.go deleted file mode 100644 index 016f0ba3..00000000 --- a/rpc/identity/verifier.go +++ /dev/null @@ -1,135 +0,0 @@ -package identity - -import ( - "context" - "fmt" - "net/http" - "slices" - "time" - - "github.com/0xsequence/waas-authenticator/proto" - "github.com/0xsequence/waas-authenticator/rpc/tracing" - "github.com/goware/cachestore" - "github.com/goware/cachestore/cachestorectl" - "github.com/lestrrat-go/jwx/v2/jwk" - "github.com/lestrrat-go/jwx/v2/jws" - "github.com/lestrrat-go/jwx/v2/jwt" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) - Get(string) (*http.Response, error) -} - -type Verifier struct { - client HTTPClient - store cachestore.Store[jwk.Key] -} - -func NewVerifier(cacheBackend cachestore.Backend, client HTTPClient) (*Verifier, error) { - if client == nil { - client = http.DefaultClient - } - store, err := cachestorectl.Open[jwk.Key](cacheBackend) - if err != nil { - return nil, err - } - return &Verifier{ - client: client, - store: store, - }, nil -} - -func (v *Verifier) Verify(ctx context.Context, idToken string, sessionHash string) (ident proto.Identity, err error) { - ctx, span := tracing.Span(ctx, "identity.Verify") - defer func() { - if err != nil { - span.RecordError(err) - } - span.End() - }() - - tok, err := jwt.Parse([]byte(idToken), jwt.WithVerify(false), jwt.WithValidate(false)) - if err != nil { - return proto.Identity{}, fmt.Errorf("parse JWT: %w", err) - } - - issuer := normalizeIssuer(tok.Issuer()) - idp := getOIDCProvider(ctx, issuer) - if idp == nil { - return proto.Identity{}, fmt.Errorf("issuer %q not valid for this tenant", issuer) - } - - ks := &operationKeySet{ - ctx: ctx, - iss: issuer, - store: v.store, - getKeySet: v.GetKeySet, - } - - if _, err := jws.Verify([]byte(idToken), jws.WithKeySet(ks, jws.WithMultipleKeysPerKeyID(false))); err != nil { - return proto.Identity{}, fmt.Errorf("signature verification: %w", err) - } - - validateOptions := []jwt.ValidateOption{ - jwt.WithValidator(withIssuer(idp.Issuer)), - jwt.WithValidator(withSessionHash(sessionHash)), - jwt.WithAcceptableSkew(10 * time.Second), - jwt.WithValidator(withAudience(idp.Audience)), - } - - if err := jwt.Validate(tok, validateOptions...); err != nil { - return proto.Identity{}, fmt.Errorf("JWT validation: %w", err) - } - - identity := proto.Identity{ - Type: proto.IdentityType_OIDC, - Issuer: issuer, - Subject: tok.Subject(), - Email: getEmailFromToken(tok), - } - return identity, nil -} - -func withIssuer(expectedIss string) jwt.ValidatorFunc { - return func(ctx context.Context, tok jwt.Token) jwt.ValidationError { - if normalizeIssuer(tok.Issuer()) != expectedIss { - return jwt.NewValidationError(fmt.Errorf("iss not satisfied")) - } - return nil - } -} - -func withSessionHash(expectedSessionHash string) jwt.ValidatorFunc { - return func(ctx context.Context, tok jwt.Token) jwt.ValidationError { - sessHashClaim, ok := tok.Get("sequence:session_hash") - if ok && sessHashClaim == expectedSessionHash { - return nil - } - - nonceClaim, ok := tok.Get("nonce") - if !ok { - return jwt.NewValidationError(fmt.Errorf("nonce not satisfied")) - } - - nonceVal, _ := nonceClaim.(string) - if nonceVal != "" && nonceVal == expectedSessionHash { - return nil - } - - return jwt.NewValidationError(fmt.Errorf("nonce not satisfied: %s != %s", nonceVal, expectedSessionHash)) - } -} - -func withAudience(expectedAudience []string) jwt.ValidatorFunc { - return func(ctx context.Context, tok jwt.Token) jwt.ValidationError { - tokAudiences := tok.Audience() - for _, aud := range expectedAudience { - if slices.Contains(tokAudiences, aud) { - return nil - } - } - - return jwt.NewValidationError(fmt.Errorf("aud not satisfied")) - } -} From 4945e6c89d4001565c283413a19ab6a3f54d5f25 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:30:55 +0200 Subject: [PATCH 09/13] rpc: implement initiateAuth & changes to openSession --- rpc/accounts.go | 48 +++++++++++--- rpc/admin.go | 58 +++++++---------- rpc/intents.go | 41 +++++------- rpc/rpc.go | 75 +++++++++++++++------- rpc/send_transaction.go | 7 ++- rpc/sessions.go | 124 ++++++++++++++++++++++++++++++++++--- rpc/sessions_auth_proof.go | 5 +- rpc/sign_message.go | 5 +- rpc/utils.go | 21 +------ rpc/waasapi/waasapi.go | 52 ++++++++++++++++ 10 files changed, 306 insertions(+), 130 deletions(-) create mode 100644 rpc/waasapi/waasapi.go diff --git a/rpc/accounts.go b/rpc/accounts.go index 3184c666..26d30fd9 100644 --- a/rpc/accounts.go +++ b/rpc/accounts.go @@ -3,16 +3,15 @@ package rpc import ( "context" "fmt" - "strings" "time" - "github.com/0xsequence/ethkit/ethcoder" "github.com/0xsequence/go-sequence/intents" "github.com/0xsequence/waas-authenticator/data" "github.com/0xsequence/waas-authenticator/proto" "github.com/0xsequence/waas-authenticator/rpc/attestation" "github.com/0xsequence/waas-authenticator/rpc/crypto" "github.com/0xsequence/waas-authenticator/rpc/tenant" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" ) func (s *RPC) listAccounts( @@ -39,8 +38,8 @@ func (s *RPC) listAccounts( out[i] = &intents.Account{ ID: identity.String(), - Type: intents.IdentityType(identity.Type.String()), - Issuer: identity.Issuer, + Type: intents.IdentityType(identity.Type), + Issuer: &identity.Issuer, } if dbAcc.Email != "" { out[i].Email = &dbAcc.Email @@ -59,13 +58,42 @@ func (s *RPC) federateAccount( return nil, fmt.Errorf("sessionId mismatch") } - sessionHash := ethcoder.Keccak256Hash([]byte(strings.ToLower(sess.ID))).String() - ident, err := s.Verifier.Verify(ctx, intent.Data.IdToken, sessionHash) + authProvider, err := s.getAuthProvider(intent.Data.IdentityType) + if err != nil { + return nil, fmt.Errorf("get auth provider: %w", err) + } + + var verifCtx *proto.VerificationContext + authID := data.AuthID{ + ProjectID: tntData.ProjectID, + IdentityType: intent.Data.IdentityType, + Verifier: intent.Data.Verifier, + } + dbVerifCtx, found, err := s.VerificationContexts.Get(ctx, authID) + if err != nil { + return nil, fmt.Errorf("getting verification context: %w", err) + } + if found && dbVerifCtx != nil { + verifCtx, _, err = crypto.DecryptData[*proto.VerificationContext](ctx, dbVerifCtx.EncryptedKey, dbVerifCtx.Ciphertext, tntData.KMSKeys) + if err != nil { + return nil, fmt.Errorf("decrypting verification context data: %w", err) + } + + if time.Now().After(verifCtx.ExpiresAt) { + return nil, fmt.Errorf("auth session expired") + } + + if !dbVerifCtx.CorrespondsTo(verifCtx) { + return nil, fmt.Errorf("malformed verification context data") + } + } + + ident, err := authProvider.Verify(ctx, verifCtx, sess.ID, intent.Data.Answer) if err != nil { return nil, fmt.Errorf("verifying identity: %w", err) } - _, found, err := s.Accounts.Get(ctx, tntData.ProjectID, ident) + _, found, err = s.Accounts.Get(ctx, tntData.ProjectID, ident) if err != nil { return nil, fmt.Errorf("retrieving account: %w", err) } @@ -97,7 +125,7 @@ func (s *RPC) federateAccount( CreatedAt: accData.CreatedAt, } - if _, err := s.Wallets.FederateAccount(waasContext(ctx), account.UserID, convertToAPIIntent(intent.ToIntent())); err != nil { + if _, err := s.Wallets.FederateAccount(waasapi.Context(ctx), account.UserID, waasapi.ConvertToAPIIntent(intent.ToIntent())); err != nil { return nil, fmt.Errorf("creating account with WaaS API: %w", err) } @@ -108,7 +136,7 @@ func (s *RPC) federateAccount( outAcc := &intents.Account{ ID: ident.String(), Type: intents.IdentityType(ident.Type), - Issuer: ident.Issuer, + Issuer: &ident.Issuer, } if ident.Email != "" { outAcc.Email = &ident.Email @@ -160,7 +188,7 @@ func (s *RPC) removeAccount( return fmt.Errorf("invalid account") } - _, err = s.Wallets.RemoveAccount(waasContext(ctx), convertToAPIIntent(intent.ToIntent())) + _, err = s.Wallets.RemoveAccount(waasapi.Context(ctx), waasapi.ConvertToAPIIntent(intent.ToIntent())) if err != nil { return err } diff --git a/rpc/admin.go b/rpc/admin.go index 00f6a06b..794fb731 100644 --- a/rpc/admin.go +++ b/rpc/admin.go @@ -13,8 +13,8 @@ import ( "github.com/0xsequence/waas-authenticator/proto" "github.com/0xsequence/waas-authenticator/rpc/attestation" "github.com/0xsequence/waas-authenticator/rpc/crypto" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" "github.com/goware/validation" - "golang.org/x/sync/errgroup" ) func (s *RPC) GetTenant(ctx context.Context, projectID uint64) (*proto.Tenant, error) { @@ -45,6 +45,7 @@ func (s *RPC) CreateTenant( ctx context.Context, projectID uint64, waasAccessToken string, + emailEnabled bool, oidcProviders []*proto.OpenIdProvider, allowedOrigins []string, password *string, @@ -59,8 +60,11 @@ func (s *RPC) CreateTenant( return nil, "", fmt.Errorf("tenant already exists") } - if err := s.validateOIDCProviders(ctx, oidcProviders); err != nil { - return nil, "", fmt.Errorf("invalid oidcProviders: %w", err) + tenantData := proto.TenantData{OIDCProviders: oidcProviders} + for _, authProvider := range s.AuthProviders { + if err := authProvider.ValidateTenant(ctx, &tenantData); err != nil { + return nil, "", fmt.Errorf("invalid auth provider configuration: %w", err) + } } origins, err := validation.NewOrigins(allowedOrigins...) @@ -73,7 +77,7 @@ func (s *RPC) CreateTenant( return nil, "", fmt.Errorf("generating wallet: %w", err) } - waasCtx := waasContext(ctx, waasAccessToken) + waasCtx := waasapi.Context(ctx, waasAccessToken) // TODO: these are 4 calls to WaaS API, can we do it all in one call? if _, err := s.Wallets.UseHotWallet(waasCtx, wallet.Address().String()); err != nil { @@ -114,7 +118,7 @@ func (s *RPC) CreateTenant( } privateKey := wallet.PrivateKeyHex()[2:] // remove 0x prefix - tenantData := proto.TenantData{ + tenantData = proto.TenantData{ ProjectID: projectID, PrivateKey: privateKey, ParentAddress: common.HexToAddress(parentAddress), @@ -125,6 +129,7 @@ func (s *RPC) CreateTenant( }, UpgradeCode: upgradeCode, WaasAccessToken: waasAccessToken, + EmailEnabled: emailEnabled, OIDCProviders: oidcProviders, KMSKeys: s.Config.KMS.DefaultSessionKeys, AllowedOrigins: origins, @@ -158,7 +163,9 @@ func (s *RPC) CreateTenant( } func (s *RPC) UpdateTenant( - ctx context.Context, projectID uint64, upgradeCode string, oidcProviders []*proto.OpenIdProvider, allowedOrigins []string, + ctx context.Context, projectID uint64, upgradeCode string, + emailEnabled bool, + oidcProviders []*proto.OpenIdProvider, allowedOrigins []string, ) (*proto.Tenant, error) { att := attestation.FromContext(ctx) @@ -180,18 +187,22 @@ func (s *RPC) UpdateTenant( return nil, fmt.Errorf("invalid upgrade code") } - if err := s.validateOIDCProviders(ctx, oidcProviders); err != nil { - return nil, fmt.Errorf("invalid oidcProviders: %w", err) - } - origins, err := validation.NewOrigins(allowedOrigins...) if err != nil { return nil, fmt.Errorf("invalid allowedOrigins: %w", err) } + tntData.EmailEnabled = emailEnabled tntData.OIDCProviders = oidcProviders tntData.AllowedOrigins = origins + tenantData := proto.TenantData{OIDCProviders: oidcProviders} + for _, authProvider := range s.AuthProviders { + if err := authProvider.ValidateTenant(ctx, &tenantData); err != nil { + return nil, fmt.Errorf("invalid auth provider configuration: %w", err) + } + } + encryptedKey, algorithm, ciphertext, err := crypto.EncryptData(ctx, att, s.Config.KMS.TenantKeys[0], tntData) if err != nil { return nil, fmt.Errorf("encrypting tenant data: %w", err) @@ -215,30 +226,3 @@ func (s *RPC) UpdateTenant( } return retTenant, nil } - -func (s *RPC) validateOIDCProviders(ctx context.Context, providers []*proto.OpenIdProvider) error { - var wg errgroup.Group - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - for i, provider := range providers { - provider := provider - - if provider.Issuer == "" { - return fmt.Errorf("provider %d: empty issuer", i) - } - - if len(provider.Audience) < 1 { - return fmt.Errorf("provider %d: at least one audience is required", i) - } - - wg.Go(func() error { - if _, err := s.Verifier.GetKeySet(ctx, provider.Issuer); err != nil { - return err - } - return nil - }) - } - - return wg.Wait() -} diff --git a/rpc/intents.go b/rpc/intents.go index 57334f96..f8db7fd9 100644 --- a/rpc/intents.go +++ b/rpc/intents.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "math/big" - "net/http" "github.com/0xsequence/ethkit/ethcoder" "github.com/0xsequence/ethkit/ethwallet" @@ -14,9 +13,9 @@ import ( v2 "github.com/0xsequence/go-sequence/core/v2" "github.com/0xsequence/go-sequence/intents" "github.com/0xsequence/waas-authenticator/proto" - proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" "github.com/0xsequence/waas-authenticator/rpc/tenant" "github.com/0xsequence/waas-authenticator/rpc/tracing" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" ) func AddressForUser(ctx context.Context, tntData *proto.TenantData, user string) (string, error) { @@ -70,6 +69,18 @@ func (s *RPC) SendIntent(ctx context.Context, protoIntent *proto.Intent) (*proto ctx, span := tracing.Intent(ctx, intent) defer span.End() + if intent.Name == intents.IntentName_initiateAuth { + intentTyped, err := intents.NewIntentTypedFromIntent[intents.IntentDataInitiateAuth](intent) + if err != nil { + return nil, err + } + res, err := s.initiateAuth(ctx, intentTyped) + if err != nil { + return nil, err + } + return makeIntentResponse(proto.IntentResponseCode_authInitiated, res), nil + } + sess, found, err := s.Sessions.Get(ctx, tntData.ProjectID, sessionID) if (err != nil || !found) && intent.Name != intents.IntentName_closeSession { return nil, fmt.Errorf("session invalid or not found") @@ -156,7 +167,7 @@ func (s *RPC) SendIntent(ctx context.Context, protoIntent *proto.Intent) (*proto } // Generic forwarding of intent, no special handling - res, err := s.Wallets.SendIntent(waasContext(ctx), convertToAPIIntent(intent)) + res, err := s.Wallets.SendIntent(waasapi.Context(ctx), waasapi.ConvertToAPIIntent(intent)) if err != nil { return nil, fmt.Errorf("sending intent: %w", err) } @@ -184,27 +195,3 @@ func (s *RPC) signUsingParent(wallet *ethwallet.Wallet, parentAddress common.Add // The signature must end with SIG_TYPE_EIP712 return append(sig, byte(1)), parentSubdigest, nil } - -func waasContext(ctx context.Context, optJwtToken ...string) context.Context { - var jwtToken string - if len(optJwtToken) == 1 { - jwtToken = optJwtToken[0] - } else { - tntData := tenant.FromContext(ctx) - jwtToken = tntData.WaasAccessToken - } - - waasHeader := http.Header{} - waasHeader.Set("Authorization", "BEARER "+jwtToken) - - accessKey := tenant.AccessKeyFromContext(ctx) - if accessKey != "" { - waasHeader.Set("X-Access-Key", accessKey) - } - - waasCtx, err := proto_wallet.WithHTTPRequestHeaders(ctx, waasHeader) - if err != nil { - return ctx - } - return waasCtx -} diff --git a/rpc/rpc.go b/rpc/rpc.go index 98abacc1..38ef7120 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -8,22 +8,27 @@ import ( "sync/atomic" "time" + "github.com/0xsequence/go-sequence/intents" "github.com/0xsequence/nitrocontrol/enclave" waasauthenticator "github.com/0xsequence/waas-authenticator" "github.com/0xsequence/waas-authenticator/config" "github.com/0xsequence/waas-authenticator/data" "github.com/0xsequence/waas-authenticator/proto" + "github.com/0xsequence/waas-authenticator/proto/builder" proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" "github.com/0xsequence/waas-authenticator/rpc/access" "github.com/0xsequence/waas-authenticator/rpc/attestation" + "github.com/0xsequence/waas-authenticator/rpc/auth" + "github.com/0xsequence/waas-authenticator/rpc/auth/email" + "github.com/0xsequence/waas-authenticator/rpc/auth/oidc" "github.com/0xsequence/waas-authenticator/rpc/awscreds" - "github.com/0xsequence/waas-authenticator/rpc/identity" "github.com/0xsequence/waas-authenticator/rpc/tenant" "github.com/0xsequence/waas-authenticator/rpc/tracing" "github.com/aws/aws-sdk-go-v2/aws" awsconfig "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/dynamodb" "github.com/aws/aws-sdk-go-v2/service/kms" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/go-chi/httplog" @@ -46,16 +51,17 @@ type HTTPClient interface { } type RPC struct { - Config *config.Config - Log zerolog.Logger - Server *http.Server - HTTPClient HTTPClient - Enclave *enclave.Enclave - Tenants *data.TenantTable - Sessions *data.SessionTable - Accounts *data.AccountTable - Wallets proto_wallet.WaaS - Verifier *identity.Verifier + Config *config.Config + Log zerolog.Logger + Server *http.Server + HTTPClient HTTPClient + Enclave *enclave.Enclave + Tenants *data.TenantTable + VerificationContexts *data.VerificationContextTable + Sessions *data.SessionTable + Accounts *data.AccountTable + Wallets proto_wallet.WaaS + AuthProviders map[intents.IdentityType]auth.Provider measurements *enclave.Measurements startTime time.Time @@ -123,8 +129,7 @@ func New(cfg *config.Config, client *http.Client) (*RPC, error) { return nil, err } - cacheBackend := memlru.Backend(1024) - verifier, err := identity.NewVerifier(cacheBackend, client) + authProviders, err := makeAuthProviders(wrappedClient, awsCfg, cfg) if err != nil { return nil, err } @@ -134,20 +139,21 @@ func New(cfg *config.Config, client *http.Client) (*RPC, error) { Log: httplog.NewLogger("waas-authenticator", httplog.Options{ LogLevel: zerolog.LevelDebugValue, }), - Config: cfg, - Server: httpServer, - HTTPClient: wrappedClient, - Enclave: enc, - Tenants: data.NewTenantTable(db, cfg.Database.TenantsTable), - Sessions: data.NewSessionTable(db, cfg.Database.SessionsTable, "UserID-Index"), + Config: cfg, + Server: httpServer, + HTTPClient: wrappedClient, + Enclave: enc, + Tenants: data.NewTenantTable(db, cfg.Database.TenantsTable), + Sessions: data.NewSessionTable(db, cfg.Database.SessionsTable, "UserID-Index"), + VerificationContexts: data.NewVerificationContextTable(db, cfg.Database.VerificationContextsTable), Accounts: data.NewAccountTable(db, cfg.Database.AccountsTable, data.AccountIndices{ ByUserID: "UserID-Index", ByEmail: "Email-Index", }), - Wallets: proto_wallet.NewWaaSClient(cfg.Endpoints.WaasAPIServer, wrappedClient), - Verifier: verifier, - startTime: time.Now(), - measurements: m, + Wallets: proto_wallet.NewWaaSClient(cfg.Endpoints.WaasAPIServer, wrappedClient), + AuthProviders: authProviders, + startTime: time.Now(), + measurements: m, } return s, nil } @@ -266,6 +272,29 @@ func emptyHandler(w http.ResponseWriter, r *http.Request) { w.Write([]byte("")) } +func makeAuthProviders(client HTTPClient, awsCfg aws.Config, cfg *config.Config) (map[intents.IdentityType]auth.Provider, error) { + cacheBackend := memlru.Backend(1024) + legacyVerifier, err := oidc.NewLegacyAuthProvider(cacheBackend, client) + if err != nil { + return nil, err + } + + sm := secretsmanager.NewFromConfig(awsCfg) + builderClient := builder.NewBuilderClient( + cfg.Builder.BaseURL, + builder.NewAuthenticatedClient(client, sm, cfg.Builder.SecretID), + ) + waasClient := proto_wallet.NewWaaSClient(cfg.Endpoints.WaasAPIServer, client) + sender := email.NewSESSender(awsCfg, cfg.SES) + emailVerifier := email.NewAuthProvider(sender, waasClient, builderClient) + + verifiers := map[intents.IdentityType]auth.Provider{ + intents.IdentityType_None: legacyVerifier, + intents.IdentityType_Email: emailVerifier, + } + return verifiers, nil +} + func newOtelTracerProvider(ctx context.Context, client *http.Client, cfg config.TracingConfig) (*trace.TracerProvider, error) { traceExporter, err := zipkin.New(cfg.Endpoint, zipkin.WithClient(client)) if err != nil { diff --git a/rpc/send_transaction.go b/rpc/send_transaction.go index b7223a41..8b8fc7ce 100644 --- a/rpc/send_transaction.go +++ b/rpc/send_transaction.go @@ -12,6 +12,7 @@ import ( "github.com/0xsequence/waas-authenticator/proto" proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" "github.com/0xsequence/waas-authenticator/rpc/tenant" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" ) func (s *RPC) sendTransaction( @@ -25,8 +26,8 @@ func (s *RPC) sendTransaction( } // use original intent otherwise we may experience lose of data because of outdated struct - apiIntent := convertToAPIIntent(&intent.Intent) - bundle, err := s.Wallets.GenTransaction(waasContext(ctx), apiIntent) + apiIntent := waasapi.ConvertToAPIIntent(&intent.Intent) + bundle, err := s.Wallets.GenTransaction(waasapi.Context(ctx), apiIntent) if err != nil { return nil, fmt.Errorf("generating transaction: %w", err) } @@ -97,7 +98,7 @@ func (s *RPC) sendTransaction( }, } - res, err := s.Wallets.SendTransaction(waasContext(ctx), apiIntent, bundle, signatures) + res, err := s.Wallets.SendTransaction(waasapi.Context(ctx), apiIntent, bundle, signatures) if err != nil { return nil, fmt.Errorf("sending transaction: %w", err) } diff --git a/rpc/sessions.go b/rpc/sessions.go index 57daa5af..389fac83 100644 --- a/rpc/sessions.go +++ b/rpc/sessions.go @@ -11,9 +11,11 @@ import ( "github.com/0xsequence/waas-authenticator/data" "github.com/0xsequence/waas-authenticator/proto" "github.com/0xsequence/waas-authenticator/rpc/attestation" + "github.com/0xsequence/waas-authenticator/rpc/auth" "github.com/0xsequence/waas-authenticator/rpc/crypto" "github.com/0xsequence/waas-authenticator/rpc/tenant" "github.com/0xsequence/waas-authenticator/rpc/tracing" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" ) func (s *RPC) RegisterSession( @@ -43,15 +45,59 @@ func (s *RPC) RegisterSession( return nil, nil, fmt.Errorf("signing session and session to register must match") } - idToken := intentTyped.Data.IdToken - if idToken == nil || *idToken == "" { - return nil, nil, fmt.Errorf("idToken is required") + authProvider, err := s.getAuthProvider(intentTyped.Data.IdentityType) + if err != nil { + return nil, nil, fmt.Errorf("get auth provider: %w", err) } sessionHash := ethcoder.Keccak256Hash([]byte(strings.ToLower(sessionID))).String() - ident, err := s.Verifier.Verify(ctx, *idToken, sessionHash) + answer := intentTyped.Data.Answer + if idToken := intentTyped.Data.IdToken; idToken != nil { + answer = *idToken + } + + var verifCtx *proto.VerificationContext + authID := data.AuthID{ + ProjectID: tntData.ProjectID, + IdentityType: intentTyped.Data.IdentityType, + Verifier: intentTyped.Data.Verifier, + } + dbVerifCtx, found, err := s.VerificationContexts.Get(ctx, authID) + if err != nil { + return nil, nil, fmt.Errorf("getting auth session: %w", err) + } + if found && dbVerifCtx != nil { + verifCtx, _, err = crypto.DecryptData[*proto.VerificationContext](ctx, dbVerifCtx.EncryptedKey, dbVerifCtx.Ciphertext, tntData.KMSKeys) + if err != nil { + return nil, nil, fmt.Errorf("decrypting auth session data: %w", err) + } + + if time.Now().After(verifCtx.ExpiresAt) { + return nil, nil, fmt.Errorf("auth session expired") + } + + if !dbVerifCtx.CorrespondsTo(verifCtx) { + return nil, nil, fmt.Errorf("malformed auth session data") + } + } + + ident, err := authProvider.Verify(ctx, verifCtx, sessionID, answer) if err != nil { - return nil, nil, fmt.Errorf("verifying identity: %w", err) + if verifCtx != nil { + now := time.Now() + verifCtx.Attempts += 1 + verifCtx.LastAttemptAt = &now + + encryptedKey, algorithm, ciphertext, err := crypto.EncryptData(ctx, att, tntData.KMSKeys[0], verifCtx) + if err != nil { + return nil, nil, fmt.Errorf("encrypt data: %w", err) + } + if err := s.VerificationContexts.UpdateData(ctx, dbVerifCtx, encryptedKey, algorithm, ciphertext); err != nil { + return nil, nil, fmt.Errorf("update verification context: %w", err) + } + } + + return nil, nil, fmt.Errorf("verifying answer: %w", err) } account, accountFound, err := s.Accounts.Get(ctx, tntData.ProjectID, ident) @@ -94,7 +140,7 @@ func (s *RPC) RegisterSession( } } - res, err := s.Wallets.RegisterSession(waasContext(ctx), account.UserID, convertToAPIIntent(intent)) + res, err := s.Wallets.RegisterSession(waasapi.Context(ctx), account.UserID, waasapi.ConvertToAPIIntent(intent)) if err != nil { return nil, nil, fmt.Errorf("registering session with WaaS API: %w", err) } @@ -150,6 +196,58 @@ func (s *RPC) RegisterSession( return retSess, convertIntentResponse(res), nil } +func (s *RPC) initiateAuth(ctx context.Context, intent *intents.IntentTyped[intents.IntentDataInitiateAuth]) (*intents.IntentResponseAuthInitiated, error) { + tnt := tenant.FromContext(ctx) + + authProvider, err := s.getAuthProvider(intent.Data.IdentityType) + if err != nil { + return nil, fmt.Errorf("get auth provider: %w", err) + } + + var verifCtx *proto.VerificationContext + authID := data.AuthID{ + ProjectID: tnt.ProjectID, + IdentityType: intent.Data.IdentityType, + Verifier: intent.Data.Verifier, + } + authSess, found, err := s.VerificationContexts.Get(ctx, authID) + if err != nil { + return nil, fmt.Errorf("getting auth session: %w", err) + } + if found && authSess != nil { + verifCtx, _, err = crypto.DecryptData[*proto.VerificationContext](ctx, authSess.EncryptedKey, authSess.Ciphertext, tnt.KMSKeys) + if err != nil { + return nil, fmt.Errorf("decrypting auth session data: %w", err) + } + } + + storeSessFn := func(ctx context.Context, verifCtx *proto.VerificationContext) error { + att := attestation.FromContext(ctx) + + encryptedKey, algorithm, ciphertext, err := crypto.EncryptData(ctx, att, tnt.KMSKeys[0], verifCtx) + if err != nil { + return fmt.Errorf("encrypting account data: %w", err) + } + + dbVerifCtx := &data.VerificationContext{ + ID: data.AuthID{ + ProjectID: tnt.ProjectID, + IdentityType: intents.IdentityType_Email, + Verifier: verifCtx.Verifier, + }, + EncryptedKey: encryptedKey, + Algorithm: algorithm, + Ciphertext: ciphertext, + } + if err := s.VerificationContexts.Put(ctx, dbVerifCtx); err != nil { + return fmt.Errorf("putting auth session: %w", err) + } + return nil + } + + return authProvider.InitiateAuth(ctx, verifCtx, intent.Data.Verifier, intent.ToIntent(), storeSessFn) +} + func (s *RPC) dropSession( ctx context.Context, sess *data.Session, intent *intents.IntentTyped[intents.IntentDataCloseSession], ) (bool, error) { @@ -160,7 +258,7 @@ func (s *RPC) dropSession( return true, nil } - if _, err := s.Wallets.InvalidateSession(waasContext(ctx), dropSess.ID); err != nil { + if _, err := s.Wallets.InvalidateSession(waasapi.Context(ctx), dropSess.ID); err != nil { return false, fmt.Errorf("invalidating session with WaaS API: %w", err) } @@ -206,3 +304,15 @@ func (s *RPC) listSessions( } return out, nil } + +func (s *RPC) getAuthProvider(identityType intents.IdentityType) (auth.Provider, error) { + if identityType == "" { + identityType = intents.IdentityType_None + } + + authProvider, ok := s.AuthProviders[identityType] + if !ok { + return nil, fmt.Errorf("unknown identity type: %v", identityType) + } + return authProvider, nil +} diff --git a/rpc/sessions_auth_proof.go b/rpc/sessions_auth_proof.go index 6975b032..125957ca 100644 --- a/rpc/sessions_auth_proof.go +++ b/rpc/sessions_auth_proof.go @@ -12,6 +12,7 @@ import ( "github.com/0xsequence/waas-authenticator/proto" proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" "github.com/0xsequence/waas-authenticator/rpc/tenant" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" ) func (s *RPC) sessionAuthProof( @@ -34,8 +35,8 @@ func (s *RPC) sessionAuthProof( return nil, fmt.Errorf("signing session register proof message: %w", err) } - apiIntent := convertToAPIIntent(&intent.Intent) - res, err := s.Wallets.SessionAuthProof(waasContext(ctx), apiIntent, proof) + apiIntent := waasapi.ConvertToAPIIntent(&intent.Intent) + res, err := s.Wallets.SessionAuthProof(waasapi.Context(ctx), apiIntent, proof) if err != nil { return nil, fmt.Errorf("signing message: %w", err) } diff --git a/rpc/sign_message.go b/rpc/sign_message.go index 58d0a0aa..d8b19786 100644 --- a/rpc/sign_message.go +++ b/rpc/sign_message.go @@ -12,6 +12,7 @@ import ( "github.com/0xsequence/waas-authenticator/proto" proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" "github.com/0xsequence/waas-authenticator/rpc/tenant" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" ) func (s *RPC) signMessage( @@ -64,8 +65,8 @@ func (s *RPC) signMessage( } // use original intent otherwise we may experience lose of data because of outdated struct - apiIntent := convertToAPIIntent(&intent.Intent) - res, err := s.Wallets.SignMessage(waasContext(ctx), apiIntent, signMessage, signatures) + apiIntent := waasapi.ConvertToAPIIntent(&intent.Intent) + res, err := s.Wallets.SignMessage(waasapi.Context(ctx), apiIntent, signMessage, signatures) if err != nil { return nil, fmt.Errorf("signing message: %w", err) } diff --git a/rpc/utils.go b/rpc/utils.go index 5c9f8e91..6adcd296 100644 --- a/rpc/utils.go +++ b/rpc/utils.go @@ -7,10 +7,11 @@ import ( "github.com/0xsequence/go-sequence/intents" "github.com/0xsequence/waas-authenticator/proto" api "github.com/0xsequence/waas-authenticator/proto/waas" + "github.com/0xsequence/waas-authenticator/rpc/waasapi" ) func (s *RPC) ChainList(ctx context.Context) ([]*proto.Chain, error) { - chains, err := s.Wallets.ChainList(waasContext(ctx)) + chains, err := s.Wallets.ChainList(waasapi.Context(ctx)) if err != nil { return nil, err } @@ -58,24 +59,6 @@ func convertProtoSignaturesToSignatures(signatures []*proto.Signature) []*intent return result } -func convertToAPIIntent(intent *intents.Intent) *api.Intent { - signatures := make([]*api.Signature, len(intent.Signatures)) - for i, s := range intent.Signatures { - signatures[i] = &api.Signature{ - SessionID: s.SessionID, - Signature: s.Signature, - } - } - return &api.Intent{ - Version: intent.Version, - Name: intent.Name.String(), - ExpiresAt: intent.ExpiresAt, - IssuedAt: intent.IssuedAt, - Data: intent.Data, - Signatures: signatures, - } -} - func convertIntentResponse(res *api.IntentResponse) *proto.IntentResponse { return &proto.IntentResponse{ Code: proto.IntentResponseCode(res.Code), diff --git a/rpc/waasapi/waasapi.go b/rpc/waasapi/waasapi.go new file mode 100644 index 00000000..2e587911 --- /dev/null +++ b/rpc/waasapi/waasapi.go @@ -0,0 +1,52 @@ +package waasapi + +import ( + "context" + "net/http" + + "github.com/0xsequence/go-sequence/intents" + proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" + "github.com/0xsequence/waas-authenticator/rpc/tenant" +) + +func Context(ctx context.Context, optJwtToken ...string) context.Context { + var jwtToken string + if len(optJwtToken) == 1 { + jwtToken = optJwtToken[0] + } else { + tntData := tenant.FromContext(ctx) + jwtToken = tntData.WaasAccessToken + } + + waasHeader := http.Header{} + waasHeader.Set("Authorization", "BEARER "+jwtToken) + + accessKey := tenant.AccessKeyFromContext(ctx) + if accessKey != "" { + waasHeader.Set("X-Access-Key", accessKey) + } + + waasCtx, err := proto_wallet.WithHTTPRequestHeaders(ctx, waasHeader) + if err != nil { + return ctx + } + return waasCtx +} + +func ConvertToAPIIntent(intent *intents.Intent) *proto_wallet.Intent { + signatures := make([]*proto_wallet.Signature, len(intent.Signatures)) + for i, s := range intent.Signatures { + signatures[i] = &proto_wallet.Signature{ + SessionID: s.SessionID, + Signature: s.Signature, + } + } + return &proto_wallet.Intent{ + Version: intent.Version, + Name: intent.Name.String(), + ExpiresAt: intent.ExpiresAt, + IssuedAt: intent.IssuedAt, + Data: intent.Data, + Signatures: signatures, + } +} From aba3868b0ccd2946a8214c598be9dee7767cc1f9 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 12:31:10 +0200 Subject: [PATCH 10/13] tests: fix broken tests --- rpc/admin_test.go | 14 +++++++------- rpc/helpers_test.go | 46 ++++++++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/rpc/admin_test.go b/rpc/admin_test.go index 21f6ee5f..b5fc2c82 100644 --- a/rpc/admin_test.go +++ b/rpc/admin_test.go @@ -99,7 +99,7 @@ func TestRPC_CreateTenant(t *testing.T) { allowedOrigins := []string{"http://localhost"} t.Run("TenantAlreadyExists", func(t *testing.T) { - tnt, code, err := c.CreateTenant(ctx, tenant.ProjectID, "WAAS_ACCESS_TOKEN", validOidcProviders, allowedOrigins, nil) + tnt, code, err := c.CreateTenant(ctx, tenant.ProjectID, "WAAS_ACCESS_TOKEN", false, validOidcProviders, allowedOrigins, nil) assert.Nil(t, tnt) assert.Empty(t, code) assert.ErrorContains(t, err, "tenant already exists") @@ -110,15 +110,15 @@ func TestRPC_CreateTenant(t *testing.T) { {Issuer: issuer, Audience: audience}, {Issuer: "INVALID", Audience: audience}, } - tnt, code, err := c.CreateTenant(ctx, 2, "WAAS_ACCESS_TOKEN", invalidOidcProviders, allowedOrigins, nil) + tnt, code, err := c.CreateTenant(ctx, 2, "WAAS_ACCESS_TOKEN", false, invalidOidcProviders, allowedOrigins, nil) assert.Nil(t, tnt) assert.Empty(t, code) - assert.ErrorContains(t, err, "invalid oidcProviders") + assert.ErrorContains(t, err, "invalid auth provider configuration") }) t.Run("InvalidOrigin", func(t *testing.T) { invalidOrigins := []string{"localhost"} - tnt, code, err := c.CreateTenant(ctx, 3, "WAAS_ACCESS_TOKEN", validOidcProviders, invalidOrigins, nil) + tnt, code, err := c.CreateTenant(ctx, 3, "WAAS_ACCESS_TOKEN", false, validOidcProviders, invalidOrigins, nil) assert.Nil(t, tnt) assert.Empty(t, code) assert.ErrorContains(t, err, "invalid allowedOrigins") @@ -126,14 +126,14 @@ func TestRPC_CreateTenant(t *testing.T) { t.Run("InvalidPassword", func(t *testing.T) { password := "Password123" - tnt, code, err := c.CreateTenant(ctx, 4, "WAAS_ACCESS_TOKEN", validOidcProviders, allowedOrigins, &password) + tnt, code, err := c.CreateTenant(ctx, 4, "WAAS_ACCESS_TOKEN", false, validOidcProviders, allowedOrigins, &password) assert.Nil(t, tnt) assert.Empty(t, code) assert.ErrorContains(t, err, "password must be at least 12 characters long") }) t.Run("Success", func(t *testing.T) { - tnt, code, err := c.CreateTenant(ctx, 5, "WAAS_ACCESS_TOKEN", validOidcProviders, allowedOrigins, nil) + tnt, code, err := c.CreateTenant(ctx, 5, "WAAS_ACCESS_TOKEN", false, validOidcProviders, allowedOrigins, nil) require.NoError(t, err) assert.NotEmpty(t, code) assert.NotNil(t, tnt) @@ -145,7 +145,7 @@ func TestRPC_CreateTenant(t *testing.T) { t.Run("SuccessWithPassword", func(t *testing.T) { password := "Password1234" - tnt, code, err := c.CreateTenant(ctx, 6, "WAAS_ACCESS_TOKEN", validOidcProviders, allowedOrigins, &password) + tnt, code, err := c.CreateTenant(ctx, 6, "WAAS_ACCESS_TOKEN", false, validOidcProviders, allowedOrigins, &password) require.NoError(t, err) assert.Equal(t, password, code) assert.NotNil(t, tnt) diff --git a/rpc/helpers_test.go b/rpc/helpers_test.go index 5a83e750..8dec2543 100644 --- a/rpc/helpers_test.go +++ b/rpc/helpers_test.go @@ -25,8 +25,9 @@ import ( "github.com/0xsequence/waas-authenticator/proto" proto_wallet "github.com/0xsequence/waas-authenticator/proto/waas" "github.com/0xsequence/waas-authenticator/rpc" + "github.com/0xsequence/waas-authenticator/rpc/auth" + "github.com/0xsequence/waas-authenticator/rpc/auth/oidc" "github.com/0xsequence/waas-authenticator/rpc/crypto" - "github.com/0xsequence/waas-authenticator/rpc/identity" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue" "github.com/aws/aws-sdk-go-v2/service/dynamodb" @@ -69,19 +70,20 @@ func getTestingCtxValue(ctx context.Context, k string) string { func initRPC(cfg *config.Config, enc *enclave.Enclave, dbClient *dbMock) *rpc.RPC { client := httpClient{} cacheBackend := memlru.Backend(1024) - verifier, err := identity.NewVerifier(cacheBackend, client) + legacyProvider, err := oidc.NewLegacyAuthProvider(cacheBackend, client) if err != nil { panic(err) } svc := &rpc.RPC{ - Config: cfg, - HTTPClient: client, - Enclave: enc, - Wallets: newWalletServiceMock(nil), - Tenants: data.NewTenantTable(dbClient, "Tenants"), - Sessions: data.NewSessionTable(dbClient, "Sessions", "UserID-Index"), - Accounts: data.NewAccountTable(dbClient, "Accounts", data.AccountIndices{}), - Verifier: verifier, + Config: cfg, + HTTPClient: client, + Enclave: enc, + Wallets: newWalletServiceMock(nil), + Tenants: data.NewTenantTable(dbClient, "Tenants"), + Sessions: data.NewSessionTable(dbClient, "Sessions", "UserID-Index"), + Accounts: data.NewAccountTable(dbClient, "Accounts", data.AccountIndices{}), + VerificationContexts: data.NewVerificationContextTable(dbClient, "VerificationContexts"), + AuthProviders: map[intents.IdentityType]auth.Provider{intents.IdentityType_None: legacyProvider}, } return svc } @@ -265,9 +267,10 @@ func (m *kmsMock) GenerateDataKey(ctx context.Context, params *kms.GenerateDataK } type dbMock struct { - tenants map[uint64][]*data.Tenant - sessions map[string]*data.Session - accounts map[uint64]map[string]*data.Account + tenants map[uint64][]*data.Tenant + sessions map[string]*data.Session + accounts map[uint64]map[string]*data.Account + verifContexts map[string]*data.VerificationContext } func (d *dbMock) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error) { @@ -343,6 +346,18 @@ func (d *dbMock) GetItem(ctx context.Context, params *dynamodb.GetItemInput, opt return nil, err } return out, nil + case "VerificationContexts": + id, err := getDynamoAttribute[*dynamodbtypes.AttributeValueMemberS](params.Key, "ID") + if err != nil { + return nil, err + } + out := &dynamodb.GetItemOutput{} + verifCtx := d.verifContexts[id.Value] + out.Item, err = attributevalue.MarshalMap(verifCtx) + if err != nil { + return nil, err + } + return out, nil } return nil, fmt.Errorf("invalid TableName: %q", *params.TableName) @@ -601,6 +616,11 @@ type walletServiceMock struct { registeredSessions map[string]struct{} } +func (w walletServiceMock) InitiateEmailAuth(ctx context.Context, intent *proto_wallet.Intent, answerHash string, salt string) (*proto_wallet.IntentResponse, error) { + //TODO implement me + panic("implement me") +} + func (w walletServiceMock) UpdateProjectUserMapRules(ctx context.Context, projectID uint64, userMapRules *proto_wallet.ProjectSessionUserMapRules) error { //TODO implement me panic("implement me") From 200b10fbfb445803090170a2906ff78e0a03ff41 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 31 May 2024 15:09:54 +0200 Subject: [PATCH 11/13] auth: tracing improvements --- rpc/auth/oidc/legacy.go | 16 ----------- rpc/auth/tracing.go | 59 +++++++++++++++++++++++++++++++++++++++++ rpc/rpc.go | 4 +-- 3 files changed, 61 insertions(+), 18 deletions(-) create mode 100644 rpc/auth/tracing.go diff --git a/rpc/auth/oidc/legacy.go b/rpc/auth/oidc/legacy.go index 105b9d22..fdafa016 100644 --- a/rpc/auth/oidc/legacy.go +++ b/rpc/auth/oidc/legacy.go @@ -70,14 +70,6 @@ func (v *LegacyAuthProvider) InitiateAuth( func (v *LegacyAuthProvider) Verify( ctx context.Context, verifCtx *proto.VerificationContext, sessionID string, answer string, ) (ident proto.Identity, err error) { - ctx, span := tracing.Span(ctx, "LegacyAuthProvider.Verify") - defer func() { - if err != nil { - span.RecordError(err) - } - span.End() - }() - if verifCtx != nil { return proto.Identity{}, fmt.Errorf("unexpected auth session for identity type that does not support it") } @@ -153,14 +145,6 @@ func (v *LegacyAuthProvider) ValidateTenant(ctx context.Context, tenant *proto.T } func (v *LegacyAuthProvider) GetKeySet(ctx context.Context, issuer string) (set jwk.Set, err error) { - ctx, span := tracing.Span(ctx, "LegacyAuthProvider.GetKeySet") - defer func() { - if err != nil { - span.RecordError(err) - } - span.End() - }() - jwksURL, err := fetchJWKSURL(ctx, v.client, issuer) if err != nil { return nil, fmt.Errorf("fetch issuer keys: %w", err) diff --git a/rpc/auth/tracing.go b/rpc/auth/tracing.go new file mode 100644 index 00000000..7e8c60d2 --- /dev/null +++ b/rpc/auth/tracing.go @@ -0,0 +1,59 @@ +package auth + +import ( + "context" + + "github.com/0xsequence/go-sequence/intents" + "github.com/0xsequence/waas-authenticator/proto" + "github.com/0xsequence/waas-authenticator/rpc/tracing" +) + +type tracedProvider struct { + name string + Provider +} + +func NewTracedProvider(name string, provider Provider) Provider { + return tracedProvider{name: name, Provider: provider} +} + +func (p tracedProvider) InitiateAuth( + ctx context.Context, + verifCtx *proto.VerificationContext, + verifier string, + intent *intents.Intent, + storeFn StoreVerificationContextFn, +) (*intents.IntentResponseAuthInitiated, error) { + ctx, span := tracing.Span(ctx, p.name+".InitiateAuth") + defer span.End() + + res, err := p.Provider.InitiateAuth(ctx, verifCtx, verifier, intent, storeFn) + if err != nil { + span.RecordError(err) + } + return res, err +} + +func (p tracedProvider) Verify( + ctx context.Context, verifCtx *proto.VerificationContext, sessionID string, answer string, +) (proto.Identity, error) { + ctx, span := tracing.Span(ctx, p.name+".Verify") + defer span.End() + + res, err := p.Provider.Verify(ctx, verifCtx, sessionID, answer) + if err != nil { + span.RecordError(err) + } + return res, err +} + +func (p tracedProvider) ValidateTenant(ctx context.Context, tenant *proto.TenantData) error { + ctx, span := tracing.Span(ctx, p.name+".ValidateTenant") + defer span.End() + + err := p.Provider.ValidateTenant(ctx, tenant) + if err != nil { + span.RecordError(err) + } + return err +} diff --git a/rpc/rpc.go b/rpc/rpc.go index 38ef7120..a1da18ee 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -289,8 +289,8 @@ func makeAuthProviders(client HTTPClient, awsCfg aws.Config, cfg *config.Config) emailVerifier := email.NewAuthProvider(sender, waasClient, builderClient) verifiers := map[intents.IdentityType]auth.Provider{ - intents.IdentityType_None: legacyVerifier, - intents.IdentityType_Email: emailVerifier, + intents.IdentityType_None: auth.NewTracedProvider("oidc.LegacyAuthProvider", legacyVerifier), + intents.IdentityType_Email: auth.NewTracedProvider("email.AuthProvider", emailVerifier), } return verifiers, nil } From f12d5ebd4a082faac07f05dd8871cfd970d7b057 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Mon, 3 Jun 2024 12:17:19 +0200 Subject: [PATCH 12/13] deps: update go-sequence --- go.mod | 2 +- go.sum | 4 +-- .../0xsequence/go-sequence/signature.go | 30 ++++++++++++++++++- vendor/modules.txt | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 6a6ff367..927e8c2a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.1 require ( github.com/0xsequence/ethkit v1.25.0 - github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e + github.com/0xsequence/go-sequence v0.33.0 github.com/0xsequence/nitrocontrol v0.3.0 github.com/BurntSushi/toml v1.3.2 github.com/aws/aws-sdk-go-v2 v1.27.0 diff --git a/go.sum b/go.sum index 00a18bef..1d9d03ed 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/0xsequence/ethkit v1.25.0 h1:auXjpJrpIckfzQ5jgVAD6GECLpFSViZWsJtz1F3E github.com/0xsequence/ethkit v1.25.0/go.mod h1:E3eymNtV0oJabgqM9R92xTQYOsT7rVHxFRju8A2CFJw= github.com/0xsequence/go-ethauth v0.13.0 h1:ZaqFEEqy574A2b1P7vjpcy5tb4W/izn+A3swwOYi9wA= github.com/0xsequence/go-ethauth v0.13.0/go.mod h1:f3kx39S9F+W+qvZEB6bkKKbpUstmyB7goUntO3wvlhg= -github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e h1:Lo/jJN5p69ockVAQVxfHSm3bDCYaWmgoBwZ8zStxv5g= -github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e/go.mod h1:7VGqBMoOGI43fzr3NDCMYxkXoz+qwdnnR3ocz4fHWjM= +github.com/0xsequence/go-sequence v0.33.0 h1:mAS4sz+ro7JQ+GYwdiPS5rseblUpr9+/dGZI6zzYTDQ= +github.com/0xsequence/go-sequence v0.33.0/go.mod h1:7VGqBMoOGI43fzr3NDCMYxkXoz+qwdnnR3ocz4fHWjM= github.com/0xsequence/nitrocontrol v0.3.0 h1:D0/gX576zQhitrJnBfBrOFFufEOzh6f2jO/+2ynwIUA= github.com/0xsequence/nitrocontrol v0.3.0/go.mod h1:sTG5akVPzoVr3unv/7h9aZGaT+BVGmvUMOdwXFeIEEA= github.com/0xsequence/nsm v0.1.0 h1:gVOViRWPUW/c5VEmGy2gCw1az/nqP3gY7VD9V2+069k= diff --git a/vendor/github.com/0xsequence/go-sequence/signature.go b/vendor/github.com/0xsequence/go-sequence/signature.go index 3debe7ce..561995ee 100644 --- a/vendor/github.com/0xsequence/go-sequence/signature.go +++ b/vendor/github.com/0xsequence/go-sequence/signature.go @@ -1,6 +1,7 @@ package sequence import ( + "bytes" "context" "fmt" "math/big" @@ -168,7 +169,7 @@ func IsValidMessageSignature(address common.Address, message []byte, signature [ return true, nil } - return IsValidSignature(log, address, MessageDigest(accounts.TextHash(message)), signature, SequenceContexts(), chainID, provider) + return IsValidSignature(log, address, common.BytesToHash(accounts.TextHash(message)), signature, SequenceContexts(), chainID, provider) } func IsValidSignature(log logger.Logger, walletAddress common.Address, digest common.Hash, seqSig []byte, walletContexts WalletContexts, chainID *big.Int, provider *ethrpc.Provider) (bool, error) { @@ -180,6 +181,13 @@ func IsValidSignature(log logger.Logger, walletAddress common.Address, digest co // NOTICE: This is legacy code, we only need it while we deploy EIP-6492 // on prod, otherwise we need to coordinate both. // as soon as we have EIP-6492 running on prod we can remove this. + + var err error + seqSig, err = UnwrapEIP6492Signature(seqSig) + if err != nil { + return false, err + } + generalIsValid, err := GeneralIsValidSignature(walletAddress, digest, seqSig, walletContexts, chainID, provider) if err != nil { return false, err @@ -262,3 +270,23 @@ func EIP6492Signature(signature []byte, config core.WalletConfig) ([]byte, error signature = append(signature, eip6492.EIP6492MagicBytes...) return signature, nil } + +func UnwrapEIP6492Signature(signature []byte) ([]byte, error) { + if !bytes.HasSuffix(signature, eip6492.EIP6492MagicBytes) { + return signature, nil + } + signature = bytes.TrimSuffix(signature, eip6492.EIP6492MagicBytes) + + var ( + to common.Address + data []byte + signature_ []byte + ) + + err := ethcoder.AbiDecoder([]string{"address", "bytes", "bytes"}, signature, []any{&to, &data, &signature_}) + if err != nil { + return nil, fmt.Errorf("unable to decode eip-6492 signature: %w", err) + } + + return signature_, nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 0d30e4a6..32fbdb82 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -36,7 +36,7 @@ github.com/0xsequence/ethkit/util # github.com/0xsequence/go-ethauth v0.13.0 ## explicit; go 1.17 github.com/0xsequence/go-ethauth -# github.com/0xsequence/go-sequence v0.32.3-0.20240530122133-eb49a20c089e +# github.com/0xsequence/go-sequence v0.33.0 ## explicit; go 1.21 github.com/0xsequence/go-sequence github.com/0xsequence/go-sequence/contracts From b09747181e6a2708d0f5bb6f9895f594705acb4e Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Thu, 6 Jun 2024 10:20:00 +0300 Subject: [PATCH 13/13] fix authenticated client & dev config --- etc/waas-auth.dev.conf | 11 +++++++++++ proto/builder/authenticated_client.go | 14 +++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/etc/waas-auth.dev.conf b/etc/waas-auth.dev.conf index 26f1f7c4..0cee1f83 100644 --- a/etc/waas-auth.dev.conf +++ b/etc/waas-auth.dev.conf @@ -33,7 +33,18 @@ QwIDAQAB tenants_table = "dev_tenants" accounts_table = "dev_accounts" sessions_table = "dev_sessions" + verification_contexts_table = "dev_verification_contexts" [kms] tenant_keys = ["arn:aws:kms:ca-central-1:767397863481:key/eea4d73b-f055-4941-9fc9-8ed3cff162be"] default_session_keys = ["arn:aws:kms:ca-central-1:767397863481:key/eea4d73b-f055-4941-9fc9-8ed3cff162be"] + +[ses] + region = "ca-central-1" + source = "noreply@dev-auth.sequence.app" + source_arn = "arn:aws:ses:ca-central-1:471112647196:identity/sequence.app" + access_role_arn = "arn:aws:iam::471112647196:role/dev-mailer-c797a23" + +[builder] + base_url = "https://dev-api.sequence.build" + secret_id = "dev-builder-jwt" diff --git a/proto/builder/authenticated_client.go b/proto/builder/authenticated_client.go index 4352da9d..5ea7f1e8 100644 --- a/proto/builder/authenticated_client.go +++ b/proto/builder/authenticated_client.go @@ -31,25 +31,17 @@ func NewAuthenticatedClient(httpClient HTTPClient, sm *secretsmanager.Client, se } func (c *AuthenticatedClient) Do(req *http.Request) (*http.Response, error) { - ctx := req.Context() - token, exp := c.getToken() if token == "" || time.Now().After(exp) { var err error - token, err = c.fetchToken(ctx) + token, err = c.fetchToken(req.Context()) if err != nil { return nil, err } } - h := http.Header{} - h.Set("Authorization", fmt.Sprintf("Bearer %s", token)) - ctx, err := WithHTTPRequestHeaders(ctx, h) - if err != nil { - return nil, err - } - - return c.Do(req.WithContext(ctx)) + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) + return c.HTTPClient.Do(req) } func (c *AuthenticatedClient) getToken() (string, time.Time) {