From 444bdffccd6dce18f60ae626b74c087641c3d052 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Fri, 15 Nov 2024 20:54:42 +0000 Subject: [PATCH] Regenerated Clients --- .../1ae49e4147b040ea9c2f01d958d2ae1b.json | 8 + .../3f9575d713c144a1a967955c25061925.json | 8 + .../41575353444b40ffbf474f4155544f00.json | 8 + .../6657e1196ca04ef6b7895f379a042562.json | 8 + .../6949b29dab2347af91bf4a40113dda18.json | 8 + .../6e4a3b8e6d7540dfb3708c81d5bb3f1b.json | 8 + .../71abdd3038ad4e99b6e511bb6da659d4.json | 8 + .../752e79e145e74d6dab8b0084f37af574.json | 8 + .../8b6434e8a3cc40eb903a9c14638072ba.json | 8 + .../91a729c9dfeb4b7eaf7fec18e6a2c4af.json | 8 + service/cloudwatch/api_op_ListMetrics.go | 2 +- service/cloudwatch/api_op_PutMetricAlarm.go | 4 + service/cloudwatch/api_op_PutMetricData.go | 80 +- service/cloudwatch/serializers.go | 105 + service/cloudwatch/types/types.go | 51 +- service/cloudwatch/validators.go | 43 +- service/connectcampaignsv2/LICENSE.txt | 202 + service/connectcampaignsv2/api_client.go | 913 ++ service/connectcampaignsv2/api_client_test.go | 127 + .../api_op_CreateCampaign.go | 194 + .../api_op_DeleteCampaign.go | 153 + ...i_op_DeleteCampaignChannelSubtypeConfig.go | 159 + ...pi_op_DeleteCampaignCommunicationLimits.go | 159 + .../api_op_DeleteCampaignCommunicationTime.go | 159 + .../api_op_DeleteConnectInstanceConfig.go | 158 + ...api_op_DeleteConnectInstanceIntegration.go | 159 + .../api_op_DeleteInstanceOnboardingJob.go | 154 + .../api_op_DescribeCampaign.go | 159 + .../api_op_GetCampaignState.go | 159 + .../api_op_GetCampaignStateBatch.go | 162 + .../api_op_GetConnectInstanceConfig.go | 159 + .../api_op_GetInstanceOnboardingJobStatus.go | 159 + .../api_op_ListCampaigns.go | 259 + .../api_op_ListConnectInstanceIntegrations.go | 265 + .../api_op_ListTagsForResource.go | 158 + .../api_op_PauseCampaign.go | 153 + .../api_op_PutConnectInstanceIntegration.go | 159 + .../api_op_PutOutboundRequestBatch.go | 168 + .../api_op_ResumeCampaign.go | 153 + .../api_op_StartCampaign.go | 153 + .../api_op_StartInstanceOnboardingJob.go | 167 + .../connectcampaignsv2/api_op_StopCampaign.go | 153 + .../connectcampaignsv2/api_op_TagResource.go | 158 + .../api_op_UntagResource.go | 158 + ...i_op_UpdateCampaignChannelSubtypeConfig.go | 159 + ...pi_op_UpdateCampaignCommunicationLimits.go | 159 + .../api_op_UpdateCampaignCommunicationTime.go | 159 + .../api_op_UpdateCampaignFlowAssociation.go | 158 + .../api_op_UpdateCampaignName.go | 158 + .../api_op_UpdateCampaignSchedule.go | 159 + .../api_op_UpdateCampaignSource.go | 159 + service/connectcampaignsv2/auth.go | 313 + service/connectcampaignsv2/deserializers.go | 7618 +++++++++++++++++ service/connectcampaignsv2/doc.go | 7 + service/connectcampaignsv2/endpoints.go | 537 ++ .../endpoints_config_test.go | 139 + service/connectcampaignsv2/endpoints_test.go | 820 ++ service/connectcampaignsv2/generated.json | 65 + service/connectcampaignsv2/go.mod | 16 + service/connectcampaignsv2/go.sum | 2 + .../connectcampaignsv2/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 346 + .../internal/endpoints/endpoints_test.go | 11 + service/connectcampaignsv2/options.go | 232 + service/connectcampaignsv2/protocol_test.go | 3 + service/connectcampaignsv2/serializers.go | 3729 ++++++++ .../snapshot/api_op_CreateCampaign.go.snap | 41 + .../snapshot/api_op_DeleteCampaign.go.snap | 41 + ...DeleteCampaignChannelSubtypeConfig.go.snap | 41 + ..._DeleteCampaignCommunicationLimits.go.snap | 41 + ...op_DeleteCampaignCommunicationTime.go.snap | 41 + ...api_op_DeleteConnectInstanceConfig.go.snap | 41 + ...p_DeleteConnectInstanceIntegration.go.snap | 41 + ...api_op_DeleteInstanceOnboardingJob.go.snap | 41 + .../snapshot/api_op_DescribeCampaign.go.snap | 41 + .../snapshot/api_op_GetCampaignState.go.snap | 41 + .../api_op_GetCampaignStateBatch.go.snap | 41 + .../api_op_GetConnectInstanceConfig.go.snap | 41 + ..._op_GetInstanceOnboardingJobStatus.go.snap | 41 + .../snapshot/api_op_ListCampaigns.go.snap | 41 + ...op_ListConnectInstanceIntegrations.go.snap | 41 + .../api_op_ListTagsForResource.go.snap | 41 + .../snapshot/api_op_PauseCampaign.go.snap | 41 + ...i_op_PutConnectInstanceIntegration.go.snap | 41 + .../api_op_PutOutboundRequestBatch.go.snap | 41 + .../snapshot/api_op_ResumeCampaign.go.snap | 41 + .../snapshot/api_op_StartCampaign.go.snap | 41 + .../api_op_StartInstanceOnboardingJob.go.snap | 41 + .../snapshot/api_op_StopCampaign.go.snap | 41 + .../snapshot/api_op_TagResource.go.snap | 41 + .../snapshot/api_op_UntagResource.go.snap | 41 + ...UpdateCampaignChannelSubtypeConfig.go.snap | 41 + ..._UpdateCampaignCommunicationLimits.go.snap | 41 + ...op_UpdateCampaignCommunicationTime.go.snap | 41 + ...i_op_UpdateCampaignFlowAssociation.go.snap | 41 + .../api_op_UpdateCampaignName.go.snap | 41 + .../api_op_UpdateCampaignSchedule.go.snap | 41 + .../api_op_UpdateCampaignSource.go.snap | 41 + service/connectcampaignsv2/snapshot_test.go | 830 ++ service/connectcampaignsv2/types/enums.go | 337 + service/connectcampaignsv2/types/errors.go | 263 + service/connectcampaignsv2/types/types.go | 1004 +++ .../types/types_exported_test.go | 234 + service/connectcampaignsv2/validators.go | 2147 +++++ service/datasync/api_op_CreateTask.go | 12 +- .../datasync/api_op_DescribeTaskExecution.go | 32 +- service/datasync/types/types.go | 2 +- service/ec2/types/enums.go | 4 - .../internal/endpoints/endpoints.go | 6 + service/internal/integrationtest/go.mod | 1 - service/iot/api_op_AttachThingPrincipal.go | 11 + service/iot/api_op_DescribeThingType.go | 3 +- service/iot/api_op_ListPrincipalThingsV2.go | 279 + service/iot/api_op_ListThingPrincipalsV2.go | 279 + service/iot/api_op_UpdateThingType.go | 157 + service/iot/deserializers.go | 792 +- service/iot/generated.json | 3 + service/iot/serializers.go | 328 + .../api_op_ListPrincipalThingsV2.go.snap | 41 + .../api_op_ListThingPrincipalsV2.go.snap | 41 + .../snapshot/api_op_UpdateThingType.go.snap | 41 + service/iot/snapshot_test.go | 72 + service/iot/types/enums.go | 19 + service/iot/types/types.go | 99 +- service/iot/validators.go | 117 + service/outposts/types/enums.go | 2 + .../api_op_DeleteConfigurationSet.go | 4 + ...otectConfigurationRuleSetNumberOverride.go | 195 + ...i_op_DescribeVerifiedDestinationNumbers.go | 4 +- ...tectConfigurationRuleSetNumberOverrides.go | 279 + .../api_op_ListRegistrationAssociations.go | 2 +- .../api_op_PutMessageFeedback.go | 175 + ...otectConfigurationRuleSetNumberOverride.go | 245 + .../api_op_SendMediaMessage.go | 6 +- .../api_op_SendTextMessage.go | 4 + .../api_op_SendVoiceMessage.go | 4 + ...api_op_SetDefaultMessageFeedbackEnabled.go | 168 + service/pinpointsmsvoicev2/deserializers.go | 1362 ++- service/pinpointsmsvoicev2/generated.json | 5 + service/pinpointsmsvoicev2/serializers.go | 465 + ...ConfigurationRuleSetNumberOverride.go.snap | 41 + ...onfigurationRuleSetNumberOverrides.go.snap | 41 + .../api_op_PutMessageFeedback.go.snap | 41 + ...ConfigurationRuleSetNumberOverride.go.snap | 42 + ...p_SetDefaultMessageFeedbackEnabled.go.snap | 41 + service/pinpointsmsvoicev2/snapshot_test.go | 120 + service/pinpointsmsvoicev2/types/enums.go | 87 +- service/pinpointsmsvoicev2/types/types.go | 51 + service/pinpointsmsvoicev2/validators.go | 250 + .../api_op_CreateFirewallRule.go | 35 +- .../api_op_DeleteFirewallRule.go | 11 +- .../api_op_ListFirewallRules.go | 6 +- .../api_op_UpdateFirewallRule.go | 44 +- service/route53resolver/deserializers.go | 30 + service/route53resolver/serializers.go | 30 + service/route53resolver/types/enums.go | 40 + service/route53resolver/types/types.go | 68 +- service/route53resolver/validators.go | 9 - .../transfer/internal/endpoints/endpoints.go | 3 + 159 files changed, 32889 insertions(+), 246 deletions(-) create mode 100644 .changelog/1ae49e4147b040ea9c2f01d958d2ae1b.json create mode 100644 .changelog/3f9575d713c144a1a967955c25061925.json create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/6657e1196ca04ef6b7895f379a042562.json create mode 100644 .changelog/6949b29dab2347af91bf4a40113dda18.json create mode 100644 .changelog/6e4a3b8e6d7540dfb3708c81d5bb3f1b.json create mode 100644 .changelog/71abdd3038ad4e99b6e511bb6da659d4.json create mode 100644 .changelog/752e79e145e74d6dab8b0084f37af574.json create mode 100644 .changelog/8b6434e8a3cc40eb903a9c14638072ba.json create mode 100644 .changelog/91a729c9dfeb4b7eaf7fec18e6a2c4af.json create mode 100644 service/connectcampaignsv2/LICENSE.txt create mode 100644 service/connectcampaignsv2/api_client.go create mode 100644 service/connectcampaignsv2/api_client_test.go create mode 100644 service/connectcampaignsv2/api_op_CreateCampaign.go create mode 100644 service/connectcampaignsv2/api_op_DeleteCampaign.go create mode 100644 service/connectcampaignsv2/api_op_DeleteCampaignChannelSubtypeConfig.go create mode 100644 service/connectcampaignsv2/api_op_DeleteCampaignCommunicationLimits.go create mode 100644 service/connectcampaignsv2/api_op_DeleteCampaignCommunicationTime.go create mode 100644 service/connectcampaignsv2/api_op_DeleteConnectInstanceConfig.go create mode 100644 service/connectcampaignsv2/api_op_DeleteConnectInstanceIntegration.go create mode 100644 service/connectcampaignsv2/api_op_DeleteInstanceOnboardingJob.go create mode 100644 service/connectcampaignsv2/api_op_DescribeCampaign.go create mode 100644 service/connectcampaignsv2/api_op_GetCampaignState.go create mode 100644 service/connectcampaignsv2/api_op_GetCampaignStateBatch.go create mode 100644 service/connectcampaignsv2/api_op_GetConnectInstanceConfig.go create mode 100644 service/connectcampaignsv2/api_op_GetInstanceOnboardingJobStatus.go create mode 100644 service/connectcampaignsv2/api_op_ListCampaigns.go create mode 100644 service/connectcampaignsv2/api_op_ListConnectInstanceIntegrations.go create mode 100644 service/connectcampaignsv2/api_op_ListTagsForResource.go create mode 100644 service/connectcampaignsv2/api_op_PauseCampaign.go create mode 100644 service/connectcampaignsv2/api_op_PutConnectInstanceIntegration.go create mode 100644 service/connectcampaignsv2/api_op_PutOutboundRequestBatch.go create mode 100644 service/connectcampaignsv2/api_op_ResumeCampaign.go create mode 100644 service/connectcampaignsv2/api_op_StartCampaign.go create mode 100644 service/connectcampaignsv2/api_op_StartInstanceOnboardingJob.go create mode 100644 service/connectcampaignsv2/api_op_StopCampaign.go create mode 100644 service/connectcampaignsv2/api_op_TagResource.go create mode 100644 service/connectcampaignsv2/api_op_UntagResource.go create mode 100644 service/connectcampaignsv2/api_op_UpdateCampaignChannelSubtypeConfig.go create mode 100644 service/connectcampaignsv2/api_op_UpdateCampaignCommunicationLimits.go create mode 100644 service/connectcampaignsv2/api_op_UpdateCampaignCommunicationTime.go create mode 100644 service/connectcampaignsv2/api_op_UpdateCampaignFlowAssociation.go create mode 100644 service/connectcampaignsv2/api_op_UpdateCampaignName.go create mode 100644 service/connectcampaignsv2/api_op_UpdateCampaignSchedule.go create mode 100644 service/connectcampaignsv2/api_op_UpdateCampaignSource.go create mode 100644 service/connectcampaignsv2/auth.go create mode 100644 service/connectcampaignsv2/deserializers.go create mode 100644 service/connectcampaignsv2/doc.go create mode 100644 service/connectcampaignsv2/endpoints.go create mode 100644 service/connectcampaignsv2/endpoints_config_test.go create mode 100644 service/connectcampaignsv2/endpoints_test.go create mode 100644 service/connectcampaignsv2/generated.json create mode 100644 service/connectcampaignsv2/go.mod create mode 100644 service/connectcampaignsv2/go.sum create mode 100644 service/connectcampaignsv2/go_module_metadata.go create mode 100644 service/connectcampaignsv2/internal/endpoints/endpoints.go create mode 100644 service/connectcampaignsv2/internal/endpoints/endpoints_test.go create mode 100644 service/connectcampaignsv2/options.go create mode 100644 service/connectcampaignsv2/protocol_test.go create mode 100644 service/connectcampaignsv2/serializers.go create mode 100644 service/connectcampaignsv2/snapshot/api_op_CreateCampaign.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DeleteCampaign.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DeleteCampaignChannelSubtypeConfig.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationLimits.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationTime.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceConfig.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceIntegration.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DeleteInstanceOnboardingJob.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_DescribeCampaign.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_GetCampaignState.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_GetCampaignStateBatch.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_GetConnectInstanceConfig.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_GetInstanceOnboardingJobStatus.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_ListCampaigns.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_ListConnectInstanceIntegrations.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_ListTagsForResource.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_PauseCampaign.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_PutConnectInstanceIntegration.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_PutOutboundRequestBatch.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_ResumeCampaign.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_StartCampaign.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_StartInstanceOnboardingJob.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_StopCampaign.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_TagResource.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UntagResource.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UpdateCampaignChannelSubtypeConfig.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationLimits.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationTime.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UpdateCampaignFlowAssociation.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UpdateCampaignName.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSchedule.go.snap create mode 100644 service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSource.go.snap create mode 100644 service/connectcampaignsv2/snapshot_test.go create mode 100644 service/connectcampaignsv2/types/enums.go create mode 100644 service/connectcampaignsv2/types/errors.go create mode 100644 service/connectcampaignsv2/types/types.go create mode 100644 service/connectcampaignsv2/types/types_exported_test.go create mode 100644 service/connectcampaignsv2/validators.go create mode 100644 service/iot/api_op_ListPrincipalThingsV2.go create mode 100644 service/iot/api_op_ListThingPrincipalsV2.go create mode 100644 service/iot/api_op_UpdateThingType.go create mode 100644 service/iot/snapshot/api_op_ListPrincipalThingsV2.go.snap create mode 100644 service/iot/snapshot/api_op_ListThingPrincipalsV2.go.snap create mode 100644 service/iot/snapshot/api_op_UpdateThingType.go.snap create mode 100644 service/pinpointsmsvoicev2/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go create mode 100644 service/pinpointsmsvoicev2/api_op_ListProtectConfigurationRuleSetNumberOverrides.go create mode 100644 service/pinpointsmsvoicev2/api_op_PutMessageFeedback.go create mode 100644 service/pinpointsmsvoicev2/api_op_PutProtectConfigurationRuleSetNumberOverride.go create mode 100644 service/pinpointsmsvoicev2/api_op_SetDefaultMessageFeedbackEnabled.go create mode 100644 service/pinpointsmsvoicev2/snapshot/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go.snap create mode 100644 service/pinpointsmsvoicev2/snapshot/api_op_ListProtectConfigurationRuleSetNumberOverrides.go.snap create mode 100644 service/pinpointsmsvoicev2/snapshot/api_op_PutMessageFeedback.go.snap create mode 100644 service/pinpointsmsvoicev2/snapshot/api_op_PutProtectConfigurationRuleSetNumberOverride.go.snap create mode 100644 service/pinpointsmsvoicev2/snapshot/api_op_SetDefaultMessageFeedbackEnabled.go.snap diff --git a/.changelog/1ae49e4147b040ea9c2f01d958d2ae1b.json b/.changelog/1ae49e4147b040ea9c2f01d958d2ae1b.json new file mode 100644 index 00000000000..425cf678f1e --- /dev/null +++ b/.changelog/1ae49e4147b040ea9c2f01d958d2ae1b.json @@ -0,0 +1,8 @@ +{ + "id": "1ae49e41-47b0-40ea-9c2f-01d958d2ae1b", + "type": "feature", + "description": "Added Amazon Connect Outbound Campaigns V2 SDK.", + "modules": [ + "service/connectcampaignsv2" + ] +} \ No newline at end of file diff --git a/.changelog/3f9575d713c144a1a967955c25061925.json b/.changelog/3f9575d713c144a1a967955c25061925.json new file mode 100644 index 00000000000..ed8a865297b --- /dev/null +++ b/.changelog/3f9575d713c144a1a967955c25061925.json @@ -0,0 +1,8 @@ +{ + "id": "3f9575d7-13c1-44a1-a967-955c25061925", + "type": "feature", + "description": "Use rule overrides to always allow or always block messages to specific phone numbers. Use message feedback to monitor if a customer interacts with your message.", + "modules": [ + "service/pinpointsmsvoicev2" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..0f304f3bade --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/connectcampaignsv2" + ] +} \ No newline at end of file diff --git a/.changelog/6657e1196ca04ef6b7895f379a042562.json b/.changelog/6657e1196ca04ef6b7895f379a042562.json new file mode 100644 index 00000000000..74feac7a06c --- /dev/null +++ b/.changelog/6657e1196ca04ef6b7895f379a042562.json @@ -0,0 +1,8 @@ +{ + "id": "6657e119-6ca0-4ef6-b789-5f379a042562", + "type": "feature", + "description": "Route 53 Resolver DNS Firewall Advanced Rules allows you to monitor and block suspicious DNS traffic based on anomalies detected in the queries, such as DNS tunneling and Domain Generation Algorithms (DGAs).", + "modules": [ + "service/route53resolver" + ] +} \ No newline at end of file diff --git a/.changelog/6949b29dab2347af91bf4a40113dda18.json b/.changelog/6949b29dab2347af91bf4a40113dda18.json new file mode 100644 index 00000000000..4d846e0702e --- /dev/null +++ b/.changelog/6949b29dab2347af91bf4a40113dda18.json @@ -0,0 +1,8 @@ +{ + "id": "6949b29d-ab23-47af-91bf-4a40113dda18", + "type": "feature", + "description": "This release allows AWS IoT Core users to enrich MQTT messages with propagating attributes, to associate a thing to a connection, and to enable Online Certificate Status Protocol (OCSP) stapling for TLS X.509 server certificates through private endpoints.", + "modules": [ + "service/iot" + ] +} \ No newline at end of file diff --git a/.changelog/6e4a3b8e6d7540dfb3708c81d5bb3f1b.json b/.changelog/6e4a3b8e6d7540dfb3708c81d5bb3f1b.json new file mode 100644 index 00000000000..4c4ea47e884 --- /dev/null +++ b/.changelog/6e4a3b8e6d7540dfb3708c81d5bb3f1b.json @@ -0,0 +1,8 @@ +{ + "id": "6e4a3b8e-6d75-40df-b370-8c81d5bb3f1b", + "type": "feature", + "description": "You can now purchase AWS Outposts rack or server capacity for a 5-year term with one of the following payment options: All Upfront, Partial Upfront, and No Upfront.", + "modules": [ + "service/outposts" + ] +} \ No newline at end of file diff --git a/.changelog/71abdd3038ad4e99b6e511bb6da659d4.json b/.changelog/71abdd3038ad4e99b6e511bb6da659d4.json new file mode 100644 index 00000000000..a4872157729 --- /dev/null +++ b/.changelog/71abdd3038ad4e99b6e511bb6da659d4.json @@ -0,0 +1,8 @@ +{ + "id": "71abdd30-38ad-4e99-b6e5-11bb6da659d4", + "type": "documentation", + "description": "Fixes PutLexicon usage example.", + "modules": [ + "service/polly" + ] +} \ No newline at end of file diff --git a/.changelog/752e79e145e74d6dab8b0084f37af574.json b/.changelog/752e79e145e74d6dab8b0084f37af574.json new file mode 100644 index 00000000000..69a3ffb6c9b --- /dev/null +++ b/.changelog/752e79e145e74d6dab8b0084f37af574.json @@ -0,0 +1,8 @@ +{ + "id": "752e79e1-45e7-4d6d-ab8b-0084f37af574", + "type": "feature", + "description": "Remove non-functional enum variants for FleetCapacityReservationUsageStrategy", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/8b6434e8a3cc40eb903a9c14638072ba.json b/.changelog/8b6434e8a3cc40eb903a9c14638072ba.json new file mode 100644 index 00000000000..452272b0d7f --- /dev/null +++ b/.changelog/8b6434e8a3cc40eb903a9c14638072ba.json @@ -0,0 +1,8 @@ +{ + "id": "8b6434e8-a3cc-40eb-903a-9c14638072ba", + "type": "feature", + "description": "Adds support for adding related Entity information to metrics ingested through PutMetricData.", + "modules": [ + "service/cloudwatch" + ] +} \ No newline at end of file diff --git a/.changelog/91a729c9dfeb4b7eaf7fec18e6a2c4af.json b/.changelog/91a729c9dfeb4b7eaf7fec18e6a2c4af.json new file mode 100644 index 00000000000..ce55d3e5aa0 --- /dev/null +++ b/.changelog/91a729c9dfeb4b7eaf7fec18e6a2c4af.json @@ -0,0 +1,8 @@ +{ + "id": "91a729c9-dfeb-4b7e-af7f-ec18e6a2c4af", + "type": "documentation", + "description": "Doc-only updates and enhancements related to creating DataSync tasks and describing task executions.", + "modules": [ + "service/datasync" + ] +} \ No newline at end of file diff --git a/service/cloudwatch/api_op_ListMetrics.go b/service/cloudwatch/api_op_ListMetrics.go index 8384983b480..d7885d5c8a1 100644 --- a/service/cloudwatch/api_op_ListMetrics.go +++ b/service/cloudwatch/api_op_ListMetrics.go @@ -80,7 +80,7 @@ type ListMetricsInput struct { // // The results that are returned are an approximation of the value you specify. // There is a low probability that the returned results include metrics with last - // published data as much as 40 minutes more than the specified time interval. + // published data as much as 50 minutes more than the specified time interval. RecentlyActive types.RecentlyActive noSmithyDocumentSerde diff --git a/service/cloudwatch/api_op_PutMetricAlarm.go b/service/cloudwatch/api_op_PutMetricAlarm.go index 7eeeab86842..4d520d7e765 100644 --- a/service/cloudwatch/api_op_PutMetricAlarm.go +++ b/service/cloudwatch/api_op_PutMetricAlarm.go @@ -389,6 +389,10 @@ type PutMetricAlarmInput struct { // specify in this parameter are ignored. To change the tags of an existing alarm, // use [TagResource]or [UntagResource]. // + // To use this field to set tags for an alarm when you create it, you must be + // signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource + // permissions. + // // [TagResource]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html // [UntagResource]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html Tags []types.Tag diff --git a/service/cloudwatch/api_op_PutMetricData.go b/service/cloudwatch/api_op_PutMetricData.go index b7d4860a94f..12ff10fee20 100644 --- a/service/cloudwatch/api_op_PutMetricData.go +++ b/service/cloudwatch/api_op_PutMetricData.go @@ -12,12 +12,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Publishes metric data points to Amazon CloudWatch. CloudWatch associates the -// data points with the specified metric. If the specified metric does not exist, -// CloudWatch creates the metric. When CloudWatch creates a metric, it can take up -// to fifteen minutes for the metric to appear in calls to [ListMetrics]. +// Publishes metric data to Amazon CloudWatch. CloudWatch associates the data with +// the specified metric. If the specified metric does not exist, CloudWatch creates +// the metric. When CloudWatch creates a metric, it can take up to fifteen minutes +// for the metric to appear in calls to [ListMetrics]. // -// You can publish either individual data points in the Value field, or arrays of +// You can publish metrics with associated entity data (so that related telemetry +// can be found and viewed together), or publish metric data by itself. To send +// entity data with your metrics, use the EntityMetricData parameter. To send +// metrics without entity data, use the MetricData parameter. The EntityMetricData +// structure includes MetricData structures for the metric data. +// +// You can publish either individual values in the Value field, or arrays of // values and the number of times each value occurred during the period by using // the Values and Counts fields in the MetricData structure. Using the Values and // Counts method enables you to publish up to 150 values per metric with one @@ -26,7 +32,8 @@ import ( // // Each PutMetricData request is limited to 1 MB in size for HTTP POST requests. // You can send a payload compressed by gzip. Each request is also limited to no -// more than 1000 different metrics. +// more than 1000 different metrics (across both the MetricData and +// EntityMetricData properties). // // Although the Value parameter accepts numbers of type Double , CloudWatch rejects // values that are either too small or too large. Values must be in the range of @@ -45,7 +52,7 @@ import ( // Data points with time stamps from 24 hours ago or longer can take at least 48 // hours to become available for [GetMetricData]or [GetMetricStatistics] from the time they are submitted. Data points // with time stamps between 3 and 24 hours ago can take as much as 2 hours to -// become available for for [GetMetricData]or [GetMetricStatistics]. +// become available for [GetMetricData]or [GetMetricStatistics]. // // CloudWatch needs raw data points to calculate percentile statistics. If you // publish data using a statistic set instead, you can only retrieve percentile @@ -78,12 +85,6 @@ func (c *Client) PutMetricData(ctx context.Context, params *PutMetricDataInput, type PutMetricDataInput struct { - // The data for the metric. The array can include no more than 1000 metrics per - // call. - // - // This member is required. - MetricData []types.MetricDatum - // The namespace for the metric data. You can use ASCII characters for the // namespace, except for control characters which are not supported. // @@ -93,6 +94,59 @@ type PutMetricDataInput struct { // This member is required. Namespace *string + // Data for metrics that contain associated entity information. You can include up + // to two EntityMetricData objects, each of which can contain a single Entity and + // associated metrics. + // + // The limit of metrics allowed, 1000, is the sum of both EntityMetricData and + // MetricData metrics. + EntityMetricData []types.EntityMetricData + + // The data for the metrics. Use this parameter if your metrics do not contain + // associated entities. The array can include no more than 1000 metrics per call. + // + // The limit of metrics allowed, 1000, is the sum of both EntityMetricData and + // MetricData metrics. + MetricData []types.MetricDatum + + // Whether to accept valid metric data when an invalid entity is sent. + // + // - When set to true : Any validation error (for entity or metric data) will + // fail the entire request, and no data will be ingested. The failed operation will + // return a 400 result with the error. + // + // - When set to false : Validation errors in the entity will not associate the + // metric with the entity, but the metric data will still be accepted and ingested. + // Validation errors in the metric data will fail the entire request, and no data + // will be ingested. + // + // In the case of an invalid entity, the operation will return a 200 status, but an + // additional response header will contain information about the validation errors. + // The new header, X-Amzn-Failure-Message is an enumeration of the following + // values: + // + // - InvalidEntity - The provided entity is invalid. + // + // - InvalidKeyAttributes - The provided KeyAttributes of an entity is invalid. + // + // - InvalidAttributes - The provided Attributes of an entity is invalid. + // + // - InvalidTypeValue - The provided Type in the KeyAttributes of an entity is + // invalid. + // + // - EntitySizeTooLarge - The number of EntityMetricData objects allowed is 2. + // + // - MissingRequiredFields - There are missing required fields in the + // KeyAttributes for the provided Type . + // + // For details of the requirements for specifying an entity, see [How to add related information to telemetry]in the CloudWatch + // User Guide. + // + // This parameter is required when EntityMetricData is included. + // + // [How to add related information to telemetry]: https://docs.aws.amazon.com/adding-your-own-related-telemetry.html + StrictEntityValidation *bool + noSmithyDocumentSerde } diff --git a/service/cloudwatch/serializers.go b/service/cloudwatch/serializers.go index 9114852486f..67d2fcffc3d 100644 --- a/service/cloudwatch/serializers.go +++ b/service/cloudwatch/serializers.go @@ -16,6 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "math" "path" + "sort" ) type awsAwsquery_serializeOpDeleteAlarms struct { @@ -2829,6 +2830,98 @@ func awsAwsquery_serializeDocumentDimensions(v []types.Dimension, value query.Va return nil } +func awsAwsquery_serializeDocumentEntity(v *types.Entity, value query.Value) error { + object := value.Object() + _ = object + + if v.Attributes != nil { + objectKey := object.Key("Attributes") + if err := awsAwsquery_serializeDocumentEntityAttributesMap(v.Attributes, objectKey); err != nil { + return err + } + } + + if v.KeyAttributes != nil { + objectKey := object.Key("KeyAttributes") + if err := awsAwsquery_serializeDocumentEntityKeyAttributesMap(v.KeyAttributes, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentEntityAttributesMap(v map[string]string, value query.Value) error { + if len(v) == 0 { + return nil + } + object := value.Map("key", "value") + + keys := make([]string, 0, len(v)) + for key := range v { + keys = append(keys, key) + } + sort.Strings(keys) + + for _, key := range keys { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsAwsquery_serializeDocumentEntityKeyAttributesMap(v map[string]string, value query.Value) error { + if len(v) == 0 { + return nil + } + object := value.Map("key", "value") + + keys := make([]string, 0, len(v)) + for key := range v { + keys = append(keys, key) + } + sort.Strings(keys) + + for _, key := range keys { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsAwsquery_serializeDocumentEntityMetricData(v *types.EntityMetricData, value query.Value) error { + object := value.Object() + _ = object + + if v.Entity != nil { + objectKey := object.Key("Entity") + if err := awsAwsquery_serializeDocumentEntity(v.Entity, objectKey); err != nil { + return err + } + } + + if v.MetricData != nil { + objectKey := object.Key("MetricData") + if err := awsAwsquery_serializeDocumentMetricData(v.MetricData, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentEntityMetricDataList(v []types.EntityMetricData, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentEntityMetricData(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsquery_serializeDocumentExtendedStatistics(v []string, value query.Value) error { array := value.Array("member") @@ -4456,6 +4549,13 @@ func awsAwsquery_serializeOpDocumentPutMetricDataInput(v *PutMetricDataInput, va object := value.Object() _ = object + if v.EntityMetricData != nil { + objectKey := object.Key("EntityMetricData") + if err := awsAwsquery_serializeDocumentEntityMetricDataList(v.EntityMetricData, objectKey); err != nil { + return err + } + } + if v.MetricData != nil { objectKey := object.Key("MetricData") if err := awsAwsquery_serializeDocumentMetricData(v.MetricData, objectKey); err != nil { @@ -4468,6 +4568,11 @@ func awsAwsquery_serializeOpDocumentPutMetricDataInput(v *PutMetricDataInput, va objectKey.String(*v.Namespace) } + if v.StrictEntityValidation != nil { + objectKey := object.Key("StrictEntityValidation") + objectKey.Boolean(*v.StrictEntityValidation) + } + return nil } diff --git a/service/cloudwatch/types/types.go b/service/cloudwatch/types/types.go index e5d7e8eff46..aedb4d7a432 100644 --- a/service/cloudwatch/types/types.go +++ b/service/cloudwatch/types/types.go @@ -296,6 +296,51 @@ type DimensionFilter struct { noSmithyDocumentSerde } +// An entity associated with metrics, to allow for finding related telemetry. An +// entity is typically a resource or service within your system. For example, +// metrics from an Amazon EC2 instance could be associated with that instance as +// the entity. Similarly, metrics from a service that you own could be associated +// with that service as the entity. +type Entity struct { + + // Additional attributes of the entity that are not used to specify the identity + // of the entity. A list of key-value pairs. + // + // For details about how to use the attributes, see [How to add related information to telemetry] in the CloudWatch User Guide. + // + // [How to add related information to telemetry]: https://docs.aws.amazon.com/adding-your-own-related-telemetry.html + Attributes map[string]string + + // The attributes of the entity which identify the specific entity, as a list of + // key-value pairs. Entities with the same KeyAttributes are considered to be the + // same entity. For an entity to be valid, the KeyAttributes must exist and be + // formatted correctly. + // + // There are five allowed attributes (key names): Type , ResourceType , Identifier + // , Name , and Environment . + // + // For details about how to use the key attributes to specify an entity, see [How to add related information to telemetry] in + // the CloudWatch User Guide. + // + // [How to add related information to telemetry]: https://docs.aws.amazon.com/adding-your-own-related-telemetry.html + KeyAttributes map[string]string + + noSmithyDocumentSerde +} + +// A set of metrics that are associated with an entity, such as a specific service +// or resource. Contains the entity and the list of metric data associated with it. +type EntityMetricData struct { + + // The entity associated with the metrics. + Entity *Entity + + // The metric data. + MetricData []MetricDatum + + noSmithyDocumentSerde +} + // This structure contains the definition for a Contributor Insights rule. For // more information about this rule, see[Using Constributor Insights to analyze high-cardinality data] in the Amazon CloudWatch User Guide. // @@ -638,10 +683,8 @@ type MetricAlarm struct { // An array of MetricDataQuery structures, used in an alarm based on a metric math // expression. Each structure either retrieves a metric or performs a math - // expression. - // - // One item in the Metrics array is the math expression that the alarm watches. - // This expression by designated by having ReturnData set to true. + // expression. One item in the Metrics array is the math expression that the alarm + // watches. This expression by designated by having ReturnData set to true. Metrics []MetricDataQuery // The namespace of the metric associated with the alarm. diff --git a/service/cloudwatch/validators.go b/service/cloudwatch/validators.go index bf0e7108c46..f111c810e94 100644 --- a/service/cloudwatch/validators.go +++ b/service/cloudwatch/validators.go @@ -903,6 +903,40 @@ func validateDimensions(v []types.Dimension) error { } } +func validateEntityMetricData(v *types.EntityMetricData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityMetricData"} + if v.MetricData != nil { + if err := validateMetricData(v.MetricData); err != nil { + invalidParams.AddNested("MetricData", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEntityMetricDataList(v []types.EntityMetricData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityMetricDataList"} + for i := range v { + if err := validateEntityMetricData(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateManagedRule(v *types.ManagedRule) error { if v == nil { return nil @@ -1768,13 +1802,16 @@ func validateOpPutMetricDataInput(v *PutMetricDataInput) error { if v.Namespace == nil { invalidParams.Add(smithy.NewErrParamRequired("Namespace")) } - if v.MetricData == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetricData")) - } else if v.MetricData != nil { + if v.MetricData != nil { if err := validateMetricData(v.MetricData); err != nil { invalidParams.AddNested("MetricData", err.(smithy.InvalidParamsError)) } } + if v.EntityMetricData != nil { + if err := validateEntityMetricDataList(v.EntityMetricData); err != nil { + invalidParams.AddNested("EntityMetricData", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/connectcampaignsv2/LICENSE.txt b/service/connectcampaignsv2/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/connectcampaignsv2/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/service/connectcampaignsv2/api_client.go b/service/connectcampaignsv2/api_client.go new file mode 100644 index 00000000000..78a2f2578ef --- /dev/null +++ b/service/connectcampaignsv2/api_client.go @@ -0,0 +1,913 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "errors" + "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" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "ConnectCampaignsV2" +const ServiceAPIVersion = "2024-04-23" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2") +} + +// Client provides the API client to make operations call for +// AmazonConnectCampaignServiceV2. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// 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) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + 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) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + 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 + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + 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{options: options}, "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, "connectcampaignsv2", 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 addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +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 addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2") + }) + 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 resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +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) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/service/connectcampaignsv2/api_client_test.go b/service/connectcampaignsv2/api_client_test.go new file mode 100644 index 00000000000..f026d8592eb --- /dev/null +++ b/service/connectcampaignsv2/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/connectcampaignsv2/api_op_CreateCampaign.go b/service/connectcampaignsv2/api_op_CreateCampaign.go new file mode 100644 index 00000000000..9d0ef36fab7 --- /dev/null +++ b/service/connectcampaignsv2/api_op_CreateCampaign.go @@ -0,0 +1,194 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a campaign for the specified Amazon Connect account. This API is +// idempotent. +func (c *Client) CreateCampaign(ctx context.Context, params *CreateCampaignInput, optFns ...func(*Options)) (*CreateCampaignOutput, error) { + if params == nil { + params = &CreateCampaignInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateCampaign", params, optFns, c.addOperationCreateCampaignMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateCampaignOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for CreateCampaign API. +type CreateCampaignInput struct { + + // Campaign Channel Subtype config + // + // This member is required. + ChannelSubtypeConfig *types.ChannelSubtypeConfig + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // The name of an Amazon Connect Campaign name. + // + // This member is required. + Name *string + + // Communication limits config + CommunicationLimitsOverride *types.CommunicationLimitsConfig + + // Campaign communication time config + CommunicationTimeConfig *types.CommunicationTimeConfig + + // Amazon Resource Names(ARN) + ConnectCampaignFlowArn *string + + // Campaign schedule + Schedule *types.Schedule + + // Source of the campaign + Source types.Source + + // Tag map with key and value. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The response for Create Campaign API +type CreateCampaignOutput struct { + + // The resource name of an Amazon Connect campaign. + Arn *string + + // Identifier representing a Campaign + Id *string + + // Tag map with key and value. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCampaign{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCampaign{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCampaign"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateCampaignValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCampaign(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateCampaign(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateCampaign", + } +} diff --git a/service/connectcampaignsv2/api_op_DeleteCampaign.go b/service/connectcampaignsv2/api_op_DeleteCampaign.go new file mode 100644 index 00000000000..1552860d850 --- /dev/null +++ b/service/connectcampaignsv2/api_op_DeleteCampaign.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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 campaign from the specified Amazon Connect account. +func (c *Client) DeleteCampaign(ctx context.Context, params *DeleteCampaignInput, optFns ...func(*Options)) (*DeleteCampaignOutput, error) { + if params == nil { + params = &DeleteCampaignInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCampaign", params, optFns, c.addOperationDeleteCampaignMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCampaignOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DeleteCampaign API. +type DeleteCampaignInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteCampaignOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCampaign{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCampaign{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCampaign"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteCampaignValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCampaign(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCampaign(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCampaign", + } +} diff --git a/service/connectcampaignsv2/api_op_DeleteCampaignChannelSubtypeConfig.go b/service/connectcampaignsv2/api_op_DeleteCampaignChannelSubtypeConfig.go new file mode 100644 index 00000000000..55121afdaeb --- /dev/null +++ b/service/connectcampaignsv2/api_op_DeleteCampaignChannelSubtypeConfig.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the channel subtype config of a campaign. This API is idempotent. +func (c *Client) DeleteCampaignChannelSubtypeConfig(ctx context.Context, params *DeleteCampaignChannelSubtypeConfigInput, optFns ...func(*Options)) (*DeleteCampaignChannelSubtypeConfigOutput, error) { + if params == nil { + params = &DeleteCampaignChannelSubtypeConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCampaignChannelSubtypeConfig", params, optFns, c.addOperationDeleteCampaignChannelSubtypeConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCampaignChannelSubtypeConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DeleteCampaignChannelSubtypeConfig API. +type DeleteCampaignChannelSubtypeConfigInput struct { + + // The type of campaign channel subtype. + // + // This member is required. + ChannelSubtype types.ChannelSubtype + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteCampaignChannelSubtypeConfigOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCampaignChannelSubtypeConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCampaignChannelSubtypeConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCampaignChannelSubtypeConfig{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCampaignChannelSubtypeConfig"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteCampaignChannelSubtypeConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCampaignChannelSubtypeConfig(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCampaignChannelSubtypeConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCampaignChannelSubtypeConfig", + } +} diff --git a/service/connectcampaignsv2/api_op_DeleteCampaignCommunicationLimits.go b/service/connectcampaignsv2/api_op_DeleteCampaignCommunicationLimits.go new file mode 100644 index 00000000000..a522bc83056 --- /dev/null +++ b/service/connectcampaignsv2/api_op_DeleteCampaignCommunicationLimits.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the communication limits config for a campaign. This API is idempotent. +func (c *Client) DeleteCampaignCommunicationLimits(ctx context.Context, params *DeleteCampaignCommunicationLimitsInput, optFns ...func(*Options)) (*DeleteCampaignCommunicationLimitsOutput, error) { + if params == nil { + params = &DeleteCampaignCommunicationLimitsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCampaignCommunicationLimits", params, optFns, c.addOperationDeleteCampaignCommunicationLimitsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCampaignCommunicationLimitsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DeleteCampaignCommunicationLimits API. +type DeleteCampaignCommunicationLimitsInput struct { + + // The type of campaign communication limits config. + // + // This member is required. + Config types.CommunicationLimitsConfigType + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteCampaignCommunicationLimitsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCampaignCommunicationLimitsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCampaignCommunicationLimits{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCampaignCommunicationLimits{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCampaignCommunicationLimits"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteCampaignCommunicationLimitsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCampaignCommunicationLimits(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCampaignCommunicationLimits(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCampaignCommunicationLimits", + } +} diff --git a/service/connectcampaignsv2/api_op_DeleteCampaignCommunicationTime.go b/service/connectcampaignsv2/api_op_DeleteCampaignCommunicationTime.go new file mode 100644 index 00000000000..f0d63e653ae --- /dev/null +++ b/service/connectcampaignsv2/api_op_DeleteCampaignCommunicationTime.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the communication time config for a campaign. This API is idempotent. +func (c *Client) DeleteCampaignCommunicationTime(ctx context.Context, params *DeleteCampaignCommunicationTimeInput, optFns ...func(*Options)) (*DeleteCampaignCommunicationTimeOutput, error) { + if params == nil { + params = &DeleteCampaignCommunicationTimeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCampaignCommunicationTime", params, optFns, c.addOperationDeleteCampaignCommunicationTimeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCampaignCommunicationTimeOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DeleteCampaignCommunicationTime API. +type DeleteCampaignCommunicationTimeInput struct { + + // The type of campaign communication time config + // + // This member is required. + Config types.CommunicationTimeConfigType + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteCampaignCommunicationTimeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCampaignCommunicationTimeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCampaignCommunicationTime{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCampaignCommunicationTime{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCampaignCommunicationTime"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteCampaignCommunicationTimeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCampaignCommunicationTime(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCampaignCommunicationTime(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCampaignCommunicationTime", + } +} diff --git a/service/connectcampaignsv2/api_op_DeleteConnectInstanceConfig.go b/service/connectcampaignsv2/api_op_DeleteConnectInstanceConfig.go new file mode 100644 index 00000000000..477d658af56 --- /dev/null +++ b/service/connectcampaignsv2/api_op_DeleteConnectInstanceConfig.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a connect instance config from the specified AWS account. +func (c *Client) DeleteConnectInstanceConfig(ctx context.Context, params *DeleteConnectInstanceConfigInput, optFns ...func(*Options)) (*DeleteConnectInstanceConfigOutput, error) { + if params == nil { + params = &DeleteConnectInstanceConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteConnectInstanceConfig", params, optFns, c.addOperationDeleteConnectInstanceConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteConnectInstanceConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DeleteConnectInstanceConfig API. +type DeleteConnectInstanceConfigInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Enumeration of the policies to enact on existing campaigns during instance + // config deletion + CampaignDeletionPolicy types.CampaignDeletionPolicy + + noSmithyDocumentSerde +} + +type DeleteConnectInstanceConfigOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteConnectInstanceConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteConnectInstanceConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteConnectInstanceConfig{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteConnectInstanceConfig"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteConnectInstanceConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConnectInstanceConfig(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteConnectInstanceConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteConnectInstanceConfig", + } +} diff --git a/service/connectcampaignsv2/api_op_DeleteConnectInstanceIntegration.go b/service/connectcampaignsv2/api_op_DeleteConnectInstanceIntegration.go new file mode 100644 index 00000000000..940dda2e737 --- /dev/null +++ b/service/connectcampaignsv2/api_op_DeleteConnectInstanceIntegration.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete the integration for the specified Amazon Connect instance. +func (c *Client) DeleteConnectInstanceIntegration(ctx context.Context, params *DeleteConnectInstanceIntegrationInput, optFns ...func(*Options)) (*DeleteConnectInstanceIntegrationOutput, error) { + if params == nil { + params = &DeleteConnectInstanceIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteConnectInstanceIntegration", params, optFns, c.addOperationDeleteConnectInstanceIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteConnectInstanceIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DeleteConnectInstanceIntegration API. +type DeleteConnectInstanceIntegrationInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Integration identifier for Connect instance + // + // This member is required. + IntegrationIdentifier types.IntegrationIdentifier + + noSmithyDocumentSerde +} + +type DeleteConnectInstanceIntegrationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteConnectInstanceIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteConnectInstanceIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteConnectInstanceIntegration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteConnectInstanceIntegration"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteConnectInstanceIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConnectInstanceIntegration(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteConnectInstanceIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteConnectInstanceIntegration", + } +} diff --git a/service/connectcampaignsv2/api_op_DeleteInstanceOnboardingJob.go b/service/connectcampaignsv2/api_op_DeleteInstanceOnboardingJob.go new file mode 100644 index 00000000000..f66bac7013d --- /dev/null +++ b/service/connectcampaignsv2/api_op_DeleteInstanceOnboardingJob.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// Delete the Connect Campaigns onboarding job for the specified Amazon Connect +// instance. +func (c *Client) DeleteInstanceOnboardingJob(ctx context.Context, params *DeleteInstanceOnboardingJobInput, optFns ...func(*Options)) (*DeleteInstanceOnboardingJobOutput, error) { + if params == nil { + params = &DeleteInstanceOnboardingJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteInstanceOnboardingJob", params, optFns, c.addOperationDeleteInstanceOnboardingJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteInstanceOnboardingJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DeleteInstanceOnboardingJob API. +type DeleteInstanceOnboardingJobInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + noSmithyDocumentSerde +} + +type DeleteInstanceOnboardingJobOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteInstanceOnboardingJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteInstanceOnboardingJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteInstanceOnboardingJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteInstanceOnboardingJob"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteInstanceOnboardingJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInstanceOnboardingJob(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteInstanceOnboardingJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteInstanceOnboardingJob", + } +} diff --git a/service/connectcampaignsv2/api_op_DescribeCampaign.go b/service/connectcampaignsv2/api_op_DescribeCampaign.go new file mode 100644 index 00000000000..79f565da035 --- /dev/null +++ b/service/connectcampaignsv2/api_op_DescribeCampaign.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specific campaign. +func (c *Client) DescribeCampaign(ctx context.Context, params *DescribeCampaignInput, optFns ...func(*Options)) (*DescribeCampaignOutput, error) { + if params == nil { + params = &DescribeCampaignInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeCampaign", params, optFns, c.addOperationDescribeCampaignMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeCampaignOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for DescribeCampaign API. +type DescribeCampaignInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +// The response for DescribeCampaign API. +type DescribeCampaignOutput struct { + + // An Amazon Connect campaign. + Campaign *types.Campaign + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCampaign{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCampaign{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCampaign"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeCampaignValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCampaign(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeCampaign(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeCampaign", + } +} diff --git a/service/connectcampaignsv2/api_op_GetCampaignState.go b/service/connectcampaignsv2/api_op_GetCampaignState.go new file mode 100644 index 00000000000..09598b7637b --- /dev/null +++ b/service/connectcampaignsv2/api_op_GetCampaignState.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get state of a campaign for the specified Amazon Connect account. +func (c *Client) GetCampaignState(ctx context.Context, params *GetCampaignStateInput, optFns ...func(*Options)) (*GetCampaignStateOutput, error) { + if params == nil { + params = &GetCampaignStateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCampaignState", params, optFns, c.addOperationGetCampaignStateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCampaignStateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for GetCampaignState API. +type GetCampaignStateInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +// The response for GetCampaignState API. +type GetCampaignStateOutput struct { + + // State of a campaign + State types.CampaignState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCampaignStateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCampaignState{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCampaignState{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCampaignState"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetCampaignStateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCampaignState(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCampaignState(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCampaignState", + } +} diff --git a/service/connectcampaignsv2/api_op_GetCampaignStateBatch.go b/service/connectcampaignsv2/api_op_GetCampaignStateBatch.go new file mode 100644 index 00000000000..944aaa2b6e8 --- /dev/null +++ b/service/connectcampaignsv2/api_op_GetCampaignStateBatch.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get state of campaigns for the specified Amazon Connect account. +func (c *Client) GetCampaignStateBatch(ctx context.Context, params *GetCampaignStateBatchInput, optFns ...func(*Options)) (*GetCampaignStateBatchOutput, error) { + if params == nil { + params = &GetCampaignStateBatchInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCampaignStateBatch", params, optFns, c.addOperationGetCampaignStateBatchMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCampaignStateBatchOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for GetCampaignStateBatch API. +type GetCampaignStateBatchInput struct { + + // List of CampaignId + // + // This member is required. + CampaignIds []string + + noSmithyDocumentSerde +} + +// The response for GetCampaignStateBatch API. +type GetCampaignStateBatchOutput struct { + + // List of failed requests of campaign state + FailedRequests []types.FailedCampaignStateResponse + + // List of successful response of campaign state + SuccessfulRequests []types.SuccessfulCampaignStateResponse + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCampaignStateBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCampaignStateBatch{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCampaignStateBatch{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCampaignStateBatch"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetCampaignStateBatchValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCampaignStateBatch(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCampaignStateBatch(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCampaignStateBatch", + } +} diff --git a/service/connectcampaignsv2/api_op_GetConnectInstanceConfig.go b/service/connectcampaignsv2/api_op_GetConnectInstanceConfig.go new file mode 100644 index 00000000000..3e872fe81cf --- /dev/null +++ b/service/connectcampaignsv2/api_op_GetConnectInstanceConfig.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get the specific Connect instance config. +func (c *Client) GetConnectInstanceConfig(ctx context.Context, params *GetConnectInstanceConfigInput, optFns ...func(*Options)) (*GetConnectInstanceConfigOutput, error) { + if params == nil { + params = &GetConnectInstanceConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetConnectInstanceConfig", params, optFns, c.addOperationGetConnectInstanceConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetConnectInstanceConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for GetConnectInstanceConfig API. +type GetConnectInstanceConfigInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + noSmithyDocumentSerde +} + +// The response for GetConnectInstanceConfig API. +type GetConnectInstanceConfigOutput struct { + + // Instance config object + ConnectInstanceConfig *types.InstanceConfig + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetConnectInstanceConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetConnectInstanceConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetConnectInstanceConfig{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetConnectInstanceConfig"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetConnectInstanceConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConnectInstanceConfig(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetConnectInstanceConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetConnectInstanceConfig", + } +} diff --git a/service/connectcampaignsv2/api_op_GetInstanceOnboardingJobStatus.go b/service/connectcampaignsv2/api_op_GetInstanceOnboardingJobStatus.go new file mode 100644 index 00000000000..cd3da6687ab --- /dev/null +++ b/service/connectcampaignsv2/api_op_GetInstanceOnboardingJobStatus.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get the specific instance onboarding job status. +func (c *Client) GetInstanceOnboardingJobStatus(ctx context.Context, params *GetInstanceOnboardingJobStatusInput, optFns ...func(*Options)) (*GetInstanceOnboardingJobStatusOutput, error) { + if params == nil { + params = &GetInstanceOnboardingJobStatusInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetInstanceOnboardingJobStatus", params, optFns, c.addOperationGetInstanceOnboardingJobStatusMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetInstanceOnboardingJobStatusOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for GetInstanceOnboardingJobStatus API. +type GetInstanceOnboardingJobStatusInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + noSmithyDocumentSerde +} + +// The response for GetInstanceOnboardingJobStatus API. +type GetInstanceOnboardingJobStatusOutput struct { + + // Instance onboarding job status object + ConnectInstanceOnboardingJobStatus *types.InstanceOnboardingJobStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetInstanceOnboardingJobStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetInstanceOnboardingJobStatus{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetInstanceOnboardingJobStatus{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetInstanceOnboardingJobStatus"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetInstanceOnboardingJobStatusValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInstanceOnboardingJobStatus(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetInstanceOnboardingJobStatus(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetInstanceOnboardingJobStatus", + } +} diff --git a/service/connectcampaignsv2/api_op_ListCampaigns.go b/service/connectcampaignsv2/api_op_ListCampaigns.go new file mode 100644 index 00000000000..f0ac4c47c64 --- /dev/null +++ b/service/connectcampaignsv2/api_op_ListCampaigns.go @@ -0,0 +1,259 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides summary information about the campaigns under the specified Amazon +// Connect account. +func (c *Client) ListCampaigns(ctx context.Context, params *ListCampaignsInput, optFns ...func(*Options)) (*ListCampaignsOutput, error) { + if params == nil { + params = &ListCampaignsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCampaigns", params, optFns, c.addOperationListCampaignsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCampaignsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for ListCampaigns API. +type ListCampaignsInput struct { + + // Filter model by type + Filters *types.CampaignFilters + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +// The response for ListCampaigns API. +type ListCampaignsOutput struct { + + // A list of Amazon Connect campaigns. + CampaignSummaryList []types.CampaignSummary + + // The token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCampaignsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCampaigns{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCampaigns{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCampaigns"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListCampaignsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCampaigns(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListCampaignsPaginatorOptions is the paginator options for ListCampaigns +type ListCampaignsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListCampaignsPaginator is a paginator for ListCampaigns +type ListCampaignsPaginator struct { + options ListCampaignsPaginatorOptions + client ListCampaignsAPIClient + params *ListCampaignsInput + nextToken *string + firstPage bool +} + +// NewListCampaignsPaginator returns a new ListCampaignsPaginator +func NewListCampaignsPaginator(client ListCampaignsAPIClient, params *ListCampaignsInput, optFns ...func(*ListCampaignsPaginatorOptions)) *ListCampaignsPaginator { + if params == nil { + params = &ListCampaignsInput{} + } + + options := ListCampaignsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCampaignsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCampaignsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCampaigns page. +func (p *ListCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCampaignsOutput, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListCampaigns(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 +} + +// ListCampaignsAPIClient is a client that implements the ListCampaigns operation. +type ListCampaignsAPIClient interface { + ListCampaigns(context.Context, *ListCampaignsInput, ...func(*Options)) (*ListCampaignsOutput, error) +} + +var _ ListCampaignsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListCampaigns(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCampaigns", + } +} diff --git a/service/connectcampaignsv2/api_op_ListConnectInstanceIntegrations.go b/service/connectcampaignsv2/api_op_ListConnectInstanceIntegrations.go new file mode 100644 index 00000000000..64fedc4fd6d --- /dev/null +++ b/service/connectcampaignsv2/api_op_ListConnectInstanceIntegrations.go @@ -0,0 +1,265 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides summary information about the integration under the specified Connect +// instance. +func (c *Client) ListConnectInstanceIntegrations(ctx context.Context, params *ListConnectInstanceIntegrationsInput, optFns ...func(*Options)) (*ListConnectInstanceIntegrationsOutput, error) { + if params == nil { + params = &ListConnectInstanceIntegrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListConnectInstanceIntegrations", params, optFns, c.addOperationListConnectInstanceIntegrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListConnectInstanceIntegrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for ListConnectInstanceIntegrations API. +type ListConnectInstanceIntegrationsInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +// The response for ListConnectInstanceIntegrations API. +type ListConnectInstanceIntegrationsOutput struct { + + // A list of Amazon Connect Instance Integrations. + IntegrationSummaryList []types.IntegrationSummary + + // The token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListConnectInstanceIntegrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListConnectInstanceIntegrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConnectInstanceIntegrations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListConnectInstanceIntegrations"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListConnectInstanceIntegrationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListConnectInstanceIntegrations(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListConnectInstanceIntegrationsPaginatorOptions is the paginator options for +// ListConnectInstanceIntegrations +type ListConnectInstanceIntegrationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListConnectInstanceIntegrationsPaginator is a paginator for +// ListConnectInstanceIntegrations +type ListConnectInstanceIntegrationsPaginator struct { + options ListConnectInstanceIntegrationsPaginatorOptions + client ListConnectInstanceIntegrationsAPIClient + params *ListConnectInstanceIntegrationsInput + nextToken *string + firstPage bool +} + +// NewListConnectInstanceIntegrationsPaginator returns a new +// ListConnectInstanceIntegrationsPaginator +func NewListConnectInstanceIntegrationsPaginator(client ListConnectInstanceIntegrationsAPIClient, params *ListConnectInstanceIntegrationsInput, optFns ...func(*ListConnectInstanceIntegrationsPaginatorOptions)) *ListConnectInstanceIntegrationsPaginator { + if params == nil { + params = &ListConnectInstanceIntegrationsInput{} + } + + options := ListConnectInstanceIntegrationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListConnectInstanceIntegrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConnectInstanceIntegrationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListConnectInstanceIntegrations page. +func (p *ListConnectInstanceIntegrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConnectInstanceIntegrationsOutput, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListConnectInstanceIntegrations(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 +} + +// ListConnectInstanceIntegrationsAPIClient is a client that implements the +// ListConnectInstanceIntegrations operation. +type ListConnectInstanceIntegrationsAPIClient interface { + ListConnectInstanceIntegrations(context.Context, *ListConnectInstanceIntegrationsInput, ...func(*Options)) (*ListConnectInstanceIntegrationsOutput, error) +} + +var _ ListConnectInstanceIntegrationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListConnectInstanceIntegrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListConnectInstanceIntegrations", + } +} diff --git a/service/connectcampaignsv2/api_op_ListTagsForResource.go b/service/connectcampaignsv2/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..f1d1fa70c15 --- /dev/null +++ b/service/connectcampaignsv2/api_op_ListTagsForResource.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// List tags for a resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for ListTagsForResource API. +type ListTagsForResourceInput struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +// The request for ListTagsForResource API. +type ListTagsForResourceOutput struct { + + // Tag map with key and value. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = 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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/connectcampaignsv2/api_op_PauseCampaign.go b/service/connectcampaignsv2/api_op_PauseCampaign.go new file mode 100644 index 00000000000..4e3391a4a52 --- /dev/null +++ b/service/connectcampaignsv2/api_op_PauseCampaign.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// Pauses a campaign for the specified Amazon Connect account. +func (c *Client) PauseCampaign(ctx context.Context, params *PauseCampaignInput, optFns ...func(*Options)) (*PauseCampaignOutput, error) { + if params == nil { + params = &PauseCampaignInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PauseCampaign", params, optFns, c.addOperationPauseCampaignMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PauseCampaignOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for PauseCampaign API. +type PauseCampaignInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type PauseCampaignOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPauseCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPauseCampaign{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPauseCampaign{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PauseCampaign"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPauseCampaignValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPauseCampaign(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPauseCampaign(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PauseCampaign", + } +} diff --git a/service/connectcampaignsv2/api_op_PutConnectInstanceIntegration.go b/service/connectcampaignsv2/api_op_PutConnectInstanceIntegration.go new file mode 100644 index 00000000000..4461ab54206 --- /dev/null +++ b/service/connectcampaignsv2/api_op_PutConnectInstanceIntegration.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Put or update the integration for the specified Amazon Connect instance. +func (c *Client) PutConnectInstanceIntegration(ctx context.Context, params *PutConnectInstanceIntegrationInput, optFns ...func(*Options)) (*PutConnectInstanceIntegrationOutput, error) { + if params == nil { + params = &PutConnectInstanceIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutConnectInstanceIntegration", params, optFns, c.addOperationPutConnectInstanceIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutConnectInstanceIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for PutConnectInstanceIntegration API. +type PutConnectInstanceIntegrationInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Integration config for Connect Instance + // + // This member is required. + IntegrationConfig types.IntegrationConfig + + noSmithyDocumentSerde +} + +type PutConnectInstanceIntegrationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutConnectInstanceIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConnectInstanceIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConnectInstanceIntegration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutConnectInstanceIntegration"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPutConnectInstanceIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConnectInstanceIntegration(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutConnectInstanceIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutConnectInstanceIntegration", + } +} diff --git a/service/connectcampaignsv2/api_op_PutOutboundRequestBatch.go b/service/connectcampaignsv2/api_op_PutOutboundRequestBatch.go new file mode 100644 index 00000000000..14ba2f01c83 --- /dev/null +++ b/service/connectcampaignsv2/api_op_PutOutboundRequestBatch.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates outbound requests for the specified campaign Amazon Connect account. +// This API is idempotent. +func (c *Client) PutOutboundRequestBatch(ctx context.Context, params *PutOutboundRequestBatchInput, optFns ...func(*Options)) (*PutOutboundRequestBatchOutput, error) { + if params == nil { + params = &PutOutboundRequestBatchInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutOutboundRequestBatch", params, optFns, c.addOperationPutOutboundRequestBatchMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutOutboundRequestBatchOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for PutOutboundRequestBatch API. +type PutOutboundRequestBatchInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + // A list of outbound requests. + // + // This member is required. + OutboundRequests []types.OutboundRequest + + noSmithyDocumentSerde +} + +// The response for PutOutboundRequestBatch API. +type PutOutboundRequestBatchOutput struct { + + // A list of failed requests. + FailedRequests []types.FailedRequest + + // A list of successful requests identified by the unique client token. + SuccessfulRequests []types.SuccessfulRequest + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutOutboundRequestBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutOutboundRequestBatch{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutOutboundRequestBatch{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutOutboundRequestBatch"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPutOutboundRequestBatchValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutOutboundRequestBatch(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutOutboundRequestBatch(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutOutboundRequestBatch", + } +} diff --git a/service/connectcampaignsv2/api_op_ResumeCampaign.go b/service/connectcampaignsv2/api_op_ResumeCampaign.go new file mode 100644 index 00000000000..0a918a8d1f2 --- /dev/null +++ b/service/connectcampaignsv2/api_op_ResumeCampaign.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// Stops a campaign for the specified Amazon Connect account. +func (c *Client) ResumeCampaign(ctx context.Context, params *ResumeCampaignInput, optFns ...func(*Options)) (*ResumeCampaignOutput, error) { + if params == nil { + params = &ResumeCampaignInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ResumeCampaign", params, optFns, c.addOperationResumeCampaignMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ResumeCampaignOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for ResumeCampaign API. +type ResumeCampaignInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type ResumeCampaignOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationResumeCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpResumeCampaign{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpResumeCampaign{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ResumeCampaign"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpResumeCampaignValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResumeCampaign(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opResumeCampaign(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ResumeCampaign", + } +} diff --git a/service/connectcampaignsv2/api_op_StartCampaign.go b/service/connectcampaignsv2/api_op_StartCampaign.go new file mode 100644 index 00000000000..995a53a6182 --- /dev/null +++ b/service/connectcampaignsv2/api_op_StartCampaign.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// Starts a campaign for the specified Amazon Connect account. +func (c *Client) StartCampaign(ctx context.Context, params *StartCampaignInput, optFns ...func(*Options)) (*StartCampaignOutput, error) { + if params == nil { + params = &StartCampaignInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartCampaign", params, optFns, c.addOperationStartCampaignMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartCampaignOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for StartCampaign API. +type StartCampaignInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type StartCampaignOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartCampaign{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartCampaign{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartCampaign"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartCampaignValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCampaign(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartCampaign(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartCampaign", + } +} diff --git a/service/connectcampaignsv2/api_op_StartInstanceOnboardingJob.go b/service/connectcampaignsv2/api_op_StartInstanceOnboardingJob.go new file mode 100644 index 00000000000..bc113fbbcab --- /dev/null +++ b/service/connectcampaignsv2/api_op_StartInstanceOnboardingJob.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Onboard the specific Amazon Connect instance to Connect Campaigns. +func (c *Client) StartInstanceOnboardingJob(ctx context.Context, params *StartInstanceOnboardingJobInput, optFns ...func(*Options)) (*StartInstanceOnboardingJobOutput, error) { + if params == nil { + params = &StartInstanceOnboardingJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartInstanceOnboardingJob", params, optFns, c.addOperationStartInstanceOnboardingJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartInstanceOnboardingJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for StartInstanceOnboardingJob API. +type StartInstanceOnboardingJobInput struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Encryption config for Connect Instance. Note that sensitive data will always be + // encrypted. If disabled, service will perform encryption with its own key. If + // enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is + // only type supported + // + // This member is required. + EncryptionConfig *types.EncryptionConfig + + noSmithyDocumentSerde +} + +// The response for StartInstanceOnboardingJob API. +type StartInstanceOnboardingJobOutput struct { + + // Instance onboarding job status object + ConnectInstanceOnboardingJobStatus *types.InstanceOnboardingJobStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartInstanceOnboardingJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartInstanceOnboardingJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartInstanceOnboardingJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartInstanceOnboardingJob"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartInstanceOnboardingJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartInstanceOnboardingJob(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartInstanceOnboardingJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartInstanceOnboardingJob", + } +} diff --git a/service/connectcampaignsv2/api_op_StopCampaign.go b/service/connectcampaignsv2/api_op_StopCampaign.go new file mode 100644 index 00000000000..ffe0ee3299d --- /dev/null +++ b/service/connectcampaignsv2/api_op_StopCampaign.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// Stops a campaign for the specified Amazon Connect account. +func (c *Client) StopCampaign(ctx context.Context, params *StopCampaignInput, optFns ...func(*Options)) (*StopCampaignOutput, error) { + if params == nil { + params = &StopCampaignInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopCampaign", params, optFns, c.addOperationStopCampaignMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopCampaignOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for StopCampaign API. +type StopCampaignInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type StopCampaignOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopCampaign{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopCampaign{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopCampaign"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStopCampaignValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopCampaign(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopCampaign(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopCampaign", + } +} diff --git a/service/connectcampaignsv2/api_op_TagResource.go b/service/connectcampaignsv2/api_op_TagResource.go new file mode 100644 index 00000000000..5d99c33df42 --- /dev/null +++ b/service/connectcampaignsv2/api_op_TagResource.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// Tag a resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for TagResource API. +type TagResourceInput struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + Arn *string + + // Tag map with key and value. + // + // This member is required. + Tags map[string]string + + 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(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); 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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); 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/service/connectcampaignsv2/api_op_UntagResource.go b/service/connectcampaignsv2/api_op_UntagResource.go new file mode 100644 index 00000000000..afadae34add --- /dev/null +++ b/service/connectcampaignsv2/api_op_UntagResource.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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" +) + +// Untag a resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UntagResource API. +type UntagResourceInput struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + Arn *string + + // List of tag keys. + // + // 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(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); 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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); 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/service/connectcampaignsv2/api_op_UpdateCampaignChannelSubtypeConfig.go b/service/connectcampaignsv2/api_op_UpdateCampaignChannelSubtypeConfig.go new file mode 100644 index 00000000000..ac6a31740c8 --- /dev/null +++ b/service/connectcampaignsv2/api_op_UpdateCampaignChannelSubtypeConfig.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the channel subtype config of a campaign. This API is idempotent. +func (c *Client) UpdateCampaignChannelSubtypeConfig(ctx context.Context, params *UpdateCampaignChannelSubtypeConfigInput, optFns ...func(*Options)) (*UpdateCampaignChannelSubtypeConfigOutput, error) { + if params == nil { + params = &UpdateCampaignChannelSubtypeConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCampaignChannelSubtypeConfig", params, optFns, c.addOperationUpdateCampaignChannelSubtypeConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCampaignChannelSubtypeConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UpdateCampaignChannelSubtypeConfig API. +type UpdateCampaignChannelSubtypeConfigInput struct { + + // Campaign Channel Subtype config + // + // This member is required. + ChannelSubtypeConfig *types.ChannelSubtypeConfig + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type UpdateCampaignChannelSubtypeConfigOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCampaignChannelSubtypeConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCampaignChannelSubtypeConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCampaignChannelSubtypeConfig{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCampaignChannelSubtypeConfig"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCampaignChannelSubtypeConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCampaignChannelSubtypeConfig(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCampaignChannelSubtypeConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCampaignChannelSubtypeConfig", + } +} diff --git a/service/connectcampaignsv2/api_op_UpdateCampaignCommunicationLimits.go b/service/connectcampaignsv2/api_op_UpdateCampaignCommunicationLimits.go new file mode 100644 index 00000000000..27143c49a5e --- /dev/null +++ b/service/connectcampaignsv2/api_op_UpdateCampaignCommunicationLimits.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the communication limits config for a campaign. This API is idempotent. +func (c *Client) UpdateCampaignCommunicationLimits(ctx context.Context, params *UpdateCampaignCommunicationLimitsInput, optFns ...func(*Options)) (*UpdateCampaignCommunicationLimitsOutput, error) { + if params == nil { + params = &UpdateCampaignCommunicationLimitsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCampaignCommunicationLimits", params, optFns, c.addOperationUpdateCampaignCommunicationLimitsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCampaignCommunicationLimitsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UpdateCampaignCommunicationLimits API. +type UpdateCampaignCommunicationLimitsInput struct { + + // Communication limits config + // + // This member is required. + CommunicationLimitsOverride *types.CommunicationLimitsConfig + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type UpdateCampaignCommunicationLimitsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCampaignCommunicationLimitsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCampaignCommunicationLimits{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCampaignCommunicationLimits{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCampaignCommunicationLimits"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCampaignCommunicationLimitsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCampaignCommunicationLimits(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCampaignCommunicationLimits(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCampaignCommunicationLimits", + } +} diff --git a/service/connectcampaignsv2/api_op_UpdateCampaignCommunicationTime.go b/service/connectcampaignsv2/api_op_UpdateCampaignCommunicationTime.go new file mode 100644 index 00000000000..589570df110 --- /dev/null +++ b/service/connectcampaignsv2/api_op_UpdateCampaignCommunicationTime.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the communication time config for a campaign. This API is idempotent. +func (c *Client) UpdateCampaignCommunicationTime(ctx context.Context, params *UpdateCampaignCommunicationTimeInput, optFns ...func(*Options)) (*UpdateCampaignCommunicationTimeOutput, error) { + if params == nil { + params = &UpdateCampaignCommunicationTimeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCampaignCommunicationTime", params, optFns, c.addOperationUpdateCampaignCommunicationTimeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCampaignCommunicationTimeOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UpdateCampaignCommunicationTime API. +type UpdateCampaignCommunicationTimeInput struct { + + // Campaign communication time config + // + // This member is required. + CommunicationTimeConfig *types.CommunicationTimeConfig + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type UpdateCampaignCommunicationTimeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCampaignCommunicationTimeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCampaignCommunicationTime{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCampaignCommunicationTime{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCampaignCommunicationTime"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCampaignCommunicationTimeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCampaignCommunicationTime(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCampaignCommunicationTime(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCampaignCommunicationTime", + } +} diff --git a/service/connectcampaignsv2/api_op_UpdateCampaignFlowAssociation.go b/service/connectcampaignsv2/api_op_UpdateCampaignFlowAssociation.go new file mode 100644 index 00000000000..d854738cbe3 --- /dev/null +++ b/service/connectcampaignsv2/api_op_UpdateCampaignFlowAssociation.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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 the campaign flow associated with a campaign. This API is idempotent. +func (c *Client) UpdateCampaignFlowAssociation(ctx context.Context, params *UpdateCampaignFlowAssociationInput, optFns ...func(*Options)) (*UpdateCampaignFlowAssociationOutput, error) { + if params == nil { + params = &UpdateCampaignFlowAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCampaignFlowAssociation", params, optFns, c.addOperationUpdateCampaignFlowAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCampaignFlowAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UpdateCampaignFlowAssociation API. +type UpdateCampaignFlowAssociationInput struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + ConnectCampaignFlowArn *string + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type UpdateCampaignFlowAssociationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCampaignFlowAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCampaignFlowAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCampaignFlowAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCampaignFlowAssociation"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCampaignFlowAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCampaignFlowAssociation(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCampaignFlowAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCampaignFlowAssociation", + } +} diff --git a/service/connectcampaignsv2/api_op_UpdateCampaignName.go b/service/connectcampaignsv2/api_op_UpdateCampaignName.go new file mode 100644 index 00000000000..6df10ec8665 --- /dev/null +++ b/service/connectcampaignsv2/api_op_UpdateCampaignName.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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 the name of a campaign. This API is idempotent. +func (c *Client) UpdateCampaignName(ctx context.Context, params *UpdateCampaignNameInput, optFns ...func(*Options)) (*UpdateCampaignNameOutput, error) { + if params == nil { + params = &UpdateCampaignNameInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCampaignName", params, optFns, c.addOperationUpdateCampaignNameMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCampaignNameOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UpdateCampaignName API. +type UpdateCampaignNameInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + // The name of an Amazon Connect Campaign name. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type UpdateCampaignNameOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCampaignNameMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCampaignName{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCampaignName{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCampaignName"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCampaignNameValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCampaignName(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCampaignName(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCampaignName", + } +} diff --git a/service/connectcampaignsv2/api_op_UpdateCampaignSchedule.go b/service/connectcampaignsv2/api_op_UpdateCampaignSchedule.go new file mode 100644 index 00000000000..1d278b54709 --- /dev/null +++ b/service/connectcampaignsv2/api_op_UpdateCampaignSchedule.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the schedule for a campaign. This API is idempotent. +func (c *Client) UpdateCampaignSchedule(ctx context.Context, params *UpdateCampaignScheduleInput, optFns ...func(*Options)) (*UpdateCampaignScheduleOutput, error) { + if params == nil { + params = &UpdateCampaignScheduleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCampaignSchedule", params, optFns, c.addOperationUpdateCampaignScheduleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCampaignScheduleOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UpdateCampaignSchedule API. +type UpdateCampaignScheduleInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + // Campaign schedule + // + // This member is required. + Schedule *types.Schedule + + noSmithyDocumentSerde +} + +type UpdateCampaignScheduleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCampaignScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCampaignSchedule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCampaignSchedule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCampaignSchedule"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCampaignScheduleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCampaignSchedule(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCampaignSchedule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCampaignSchedule", + } +} diff --git a/service/connectcampaignsv2/api_op_UpdateCampaignSource.go b/service/connectcampaignsv2/api_op_UpdateCampaignSource.go new file mode 100644 index 00000000000..7276ac94678 --- /dev/null +++ b/service/connectcampaignsv2/api_op_UpdateCampaignSource.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the campaign source with a campaign. This API is idempotent. +func (c *Client) UpdateCampaignSource(ctx context.Context, params *UpdateCampaignSourceInput, optFns ...func(*Options)) (*UpdateCampaignSourceOutput, error) { + if params == nil { + params = &UpdateCampaignSourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCampaignSource", params, optFns, c.addOperationUpdateCampaignSourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCampaignSourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request for UpdateCampaignSource API. +type UpdateCampaignSourceInput struct { + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + // Source of the campaign + // + // This member is required. + Source types.Source + + noSmithyDocumentSerde +} + +type UpdateCampaignSourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCampaignSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCampaignSource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCampaignSource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCampaignSource"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCampaignSourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCampaignSource(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCampaignSource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCampaignSource", + } +} diff --git a/service/connectcampaignsv2/auth.go b/service/connectcampaignsv2/auth.go new file mode 100644 index 00000000000..9180fa05a67 --- /dev/null +++ b/service/connectcampaignsv2/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, 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(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, 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, "connect-campaigns") + 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, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, 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) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + 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, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + 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 := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + 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 { + options Options +} + +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, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + 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") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/connectcampaignsv2/deserializers.go b/service/connectcampaignsv2/deserializers.go new file mode 100644 index 00000000000..d36829c8826 --- /dev/null +++ b/service/connectcampaignsv2/deserializers.go @@ -0,0 +1,7618 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/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" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "math" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpCreateCampaign struct { +} + +func (*awsRestjson1_deserializeOpCreateCampaign) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateCampaign) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateCampaign(response, &metadata) + } + output := &CreateCampaignOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateCampaignOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateCampaignOutput(v **CreateCampaignOutput, 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 *CreateCampaignOutput + if *v == nil { + sv = &CreateCampaignOutput{} + } 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 CampaignArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteCampaign struct { +} + +func (*awsRestjson1_deserializeOpDeleteCampaign) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteCampaign) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCampaign(response, &metadata) + } + output := &DeleteCampaignOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteCampaignChannelSubtypeConfig struct { +} + +func (*awsRestjson1_deserializeOpDeleteCampaignChannelSubtypeConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteCampaignChannelSubtypeConfig) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCampaignChannelSubtypeConfig(response, &metadata) + } + output := &DeleteCampaignChannelSubtypeConfigOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteCampaignChannelSubtypeConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteCampaignCommunicationLimits struct { +} + +func (*awsRestjson1_deserializeOpDeleteCampaignCommunicationLimits) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteCampaignCommunicationLimits) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCampaignCommunicationLimits(response, &metadata) + } + output := &DeleteCampaignCommunicationLimitsOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteCampaignCommunicationLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteCampaignCommunicationTime struct { +} + +func (*awsRestjson1_deserializeOpDeleteCampaignCommunicationTime) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteCampaignCommunicationTime) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCampaignCommunicationTime(response, &metadata) + } + output := &DeleteCampaignCommunicationTimeOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteCampaignCommunicationTime(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteConnectInstanceConfig struct { +} + +func (*awsRestjson1_deserializeOpDeleteConnectInstanceConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteConnectInstanceConfig) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteConnectInstanceConfig(response, &metadata) + } + output := &DeleteConnectInstanceConfigOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteConnectInstanceConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteConnectInstanceIntegration struct { +} + +func (*awsRestjson1_deserializeOpDeleteConnectInstanceIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteConnectInstanceIntegration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteConnectInstanceIntegration(response, &metadata) + } + output := &DeleteConnectInstanceIntegrationOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteConnectInstanceIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteInstanceOnboardingJob struct { +} + +func (*awsRestjson1_deserializeOpDeleteInstanceOnboardingJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteInstanceOnboardingJob) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteInstanceOnboardingJob(response, &metadata) + } + output := &DeleteInstanceOnboardingJobOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteInstanceOnboardingJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDescribeCampaign struct { +} + +func (*awsRestjson1_deserializeOpDescribeCampaign) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeCampaign) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDescribeCampaign(response, &metadata) + } + output := &DescribeCampaignOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDescribeCampaignOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeCampaignOutput(v **DescribeCampaignOutput, 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 *DescribeCampaignOutput + if *v == nil { + sv = &DescribeCampaignOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "campaign": + if err := awsRestjson1_deserializeDocumentCampaign(&sv.Campaign, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetCampaignState struct { +} + +func (*awsRestjson1_deserializeOpGetCampaignState) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetCampaignState) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetCampaignState(response, &metadata) + } + output := &GetCampaignStateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetCampaignStateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetCampaignState(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetCampaignStateOutput(v **GetCampaignStateOutput, 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 *GetCampaignStateOutput + if *v == nil { + sv = &GetCampaignStateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignState to be of type string, got %T instead", value) + } + sv.State = types.CampaignState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetCampaignStateBatch struct { +} + +func (*awsRestjson1_deserializeOpGetCampaignStateBatch) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetCampaignStateBatch) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetCampaignStateBatch(response, &metadata) + } + output := &GetCampaignStateBatchOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetCampaignStateBatchOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetCampaignStateBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetCampaignStateBatchOutput(v **GetCampaignStateBatchOutput, 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 *GetCampaignStateBatchOutput + if *v == nil { + sv = &GetCampaignStateBatchOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failedRequests": + if err := awsRestjson1_deserializeDocumentFailedCampaignStateResponseList(&sv.FailedRequests, value); err != nil { + return err + } + + case "successfulRequests": + if err := awsRestjson1_deserializeDocumentSuccessfulCampaignStateResponseList(&sv.SuccessfulRequests, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetConnectInstanceConfig struct { +} + +func (*awsRestjson1_deserializeOpGetConnectInstanceConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetConnectInstanceConfig) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetConnectInstanceConfig(response, &metadata) + } + output := &GetConnectInstanceConfigOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetConnectInstanceConfigOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetConnectInstanceConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetConnectInstanceConfigOutput(v **GetConnectInstanceConfigOutput, 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 *GetConnectInstanceConfigOutput + if *v == nil { + sv = &GetConnectInstanceConfigOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectInstanceConfig": + if err := awsRestjson1_deserializeDocumentInstanceConfig(&sv.ConnectInstanceConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetInstanceOnboardingJobStatus struct { +} + +func (*awsRestjson1_deserializeOpGetInstanceOnboardingJobStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetInstanceOnboardingJobStatus) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetInstanceOnboardingJobStatus(response, &metadata) + } + output := &GetInstanceOnboardingJobStatusOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetInstanceOnboardingJobStatusOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetInstanceOnboardingJobStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetInstanceOnboardingJobStatusOutput(v **GetInstanceOnboardingJobStatusOutput, 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 *GetInstanceOnboardingJobStatusOutput + if *v == nil { + sv = &GetInstanceOnboardingJobStatusOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectInstanceOnboardingJobStatus": + if err := awsRestjson1_deserializeDocumentInstanceOnboardingJobStatus(&sv.ConnectInstanceOnboardingJobStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListCampaigns struct { +} + +func (*awsRestjson1_deserializeOpListCampaigns) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCampaigns) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListCampaigns(response, &metadata) + } + output := &ListCampaignsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListCampaignsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListCampaigns(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListCampaignsOutput(v **ListCampaignsOutput, 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 *ListCampaignsOutput + if *v == nil { + sv = &ListCampaignsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "campaignSummaryList": + if err := awsRestjson1_deserializeDocumentCampaignSummaryList(&sv.CampaignSummaryList, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListConnectInstanceIntegrations struct { +} + +func (*awsRestjson1_deserializeOpListConnectInstanceIntegrations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListConnectInstanceIntegrations) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListConnectInstanceIntegrations(response, &metadata) + } + output := &ListConnectInstanceIntegrationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListConnectInstanceIntegrationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListConnectInstanceIntegrations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListConnectInstanceIntegrationsOutput(v **ListConnectInstanceIntegrationsOutput, 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 *ListConnectInstanceIntegrationsOutput + if *v == nil { + sv = &ListConnectInstanceIntegrationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "integrationSummaryList": + if err := awsRestjson1_deserializeDocumentIntegrationSummaryList(&sv.IntegrationSummaryList, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPauseCampaign struct { +} + +func (*awsRestjson1_deserializeOpPauseCampaign) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPauseCampaign) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPauseCampaign(response, &metadata) + } + output := &PauseCampaignOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPauseCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpPutConnectInstanceIntegration struct { +} + +func (*awsRestjson1_deserializeOpPutConnectInstanceIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutConnectInstanceIntegration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutConnectInstanceIntegration(response, &metadata) + } + output := &PutConnectInstanceIntegrationOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutConnectInstanceIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpPutOutboundRequestBatch struct { +} + +func (*awsRestjson1_deserializeOpPutOutboundRequestBatch) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutOutboundRequestBatch) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutOutboundRequestBatch(response, &metadata) + } + output := &PutOutboundRequestBatchOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentPutOutboundRequestBatchOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutOutboundRequestBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutOutboundRequestBatchOutput(v **PutOutboundRequestBatchOutput, 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 *PutOutboundRequestBatchOutput + if *v == nil { + sv = &PutOutboundRequestBatchOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failedRequests": + if err := awsRestjson1_deserializeDocumentFailedRequestList(&sv.FailedRequests, value); err != nil { + return err + } + + case "successfulRequests": + if err := awsRestjson1_deserializeDocumentSuccessfulRequestList(&sv.SuccessfulRequests, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpResumeCampaign struct { +} + +func (*awsRestjson1_deserializeOpResumeCampaign) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpResumeCampaign) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorResumeCampaign(response, &metadata) + } + output := &ResumeCampaignOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorResumeCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpStartCampaign struct { +} + +func (*awsRestjson1_deserializeOpStartCampaign) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartCampaign) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartCampaign(response, &metadata) + } + output := &StartCampaignOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpStartInstanceOnboardingJob struct { +} + +func (*awsRestjson1_deserializeOpStartInstanceOnboardingJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartInstanceOnboardingJob) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartInstanceOnboardingJob(response, &metadata) + } + output := &StartInstanceOnboardingJobOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentStartInstanceOnboardingJobOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartInstanceOnboardingJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartInstanceOnboardingJobOutput(v **StartInstanceOnboardingJobOutput, 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 *StartInstanceOnboardingJobOutput + if *v == nil { + sv = &StartInstanceOnboardingJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectInstanceOnboardingJobStatus": + if err := awsRestjson1_deserializeDocumentInstanceOnboardingJobStatus(&sv.ConnectInstanceOnboardingJobStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStopCampaign struct { +} + +func (*awsRestjson1_deserializeOpStopCampaign) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStopCampaign) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStopCampaign(response, &metadata) + } + output := &StopCampaignOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStopCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCampaignChannelSubtypeConfig struct { +} + +func (*awsRestjson1_deserializeOpUpdateCampaignChannelSubtypeConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCampaignChannelSubtypeConfig) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCampaignChannelSubtypeConfig(response, &metadata) + } + output := &UpdateCampaignChannelSubtypeConfigOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCampaignChannelSubtypeConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCampaignCommunicationLimits struct { +} + +func (*awsRestjson1_deserializeOpUpdateCampaignCommunicationLimits) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCampaignCommunicationLimits) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCampaignCommunicationLimits(response, &metadata) + } + output := &UpdateCampaignCommunicationLimitsOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCampaignCommunicationLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCampaignCommunicationTime struct { +} + +func (*awsRestjson1_deserializeOpUpdateCampaignCommunicationTime) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCampaignCommunicationTime) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCampaignCommunicationTime(response, &metadata) + } + output := &UpdateCampaignCommunicationTimeOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCampaignCommunicationTime(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCampaignFlowAssociation struct { +} + +func (*awsRestjson1_deserializeOpUpdateCampaignFlowAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCampaignFlowAssociation) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCampaignFlowAssociation(response, &metadata) + } + output := &UpdateCampaignFlowAssociationOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCampaignFlowAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCampaignName struct { +} + +func (*awsRestjson1_deserializeOpUpdateCampaignName) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCampaignName) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCampaignName(response, &metadata) + } + output := &UpdateCampaignNameOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCampaignName(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCampaignSchedule struct { +} + +func (*awsRestjson1_deserializeOpUpdateCampaignSchedule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCampaignSchedule) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCampaignSchedule(response, &metadata) + } + output := &UpdateCampaignScheduleOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCampaignSchedule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCampaignSource struct { +} + +func (*awsRestjson1_deserializeOpUpdateCampaignSource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCampaignSource) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCampaignSource(response, &metadata) + } + output := &UpdateCampaignSourceOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCampaignSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidCampaignStateException", errorCode): + return awsRestjson1_deserializeErrorInvalidCampaignStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsAccessDeniedException(v *types.AccessDeniedException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsConflictException(v *types.ConflictException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsInvalidCampaignStateException(v *types.InvalidCampaignStateException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsInvalidStateException(v *types.InvalidStateException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsResourceNotFoundException(v *types.ResourceNotFoundException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsServiceQuotaExceededException(v *types.ServiceQuotaExceededException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsValidationException(v *types.ValidationException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amzn-ErrorType"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.XAmzErrorType = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + 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 + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsAccessDeniedException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + 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 + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsConflictException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + 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 + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorInvalidCampaignStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidCampaignStateException{} + 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 + } + + err := awsRestjson1_deserializeDocumentInvalidCampaignStateException(&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) + + if err := awsRestjson1_deserializeOpHttpBindingsInvalidCampaignStateException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorInvalidStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidStateException{} + 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 + } + + err := awsRestjson1_deserializeDocumentInvalidStateException(&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) + + if err := awsRestjson1_deserializeOpHttpBindingsInvalidStateException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + 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 + } + + err := awsRestjson1_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) + + if err := awsRestjson1_deserializeOpHttpBindingsResourceNotFoundException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + 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 + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsServiceQuotaExceededException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + 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 + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + 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 + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsValidationException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAgentlessConfig(v **types.AgentlessConfig, 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.AgentlessConfig + if *v == nil { + sv = &types.AgentlessConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAnswerMachineDetectionConfig(v **types.AnswerMachineDetectionConfig, 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.AnswerMachineDetectionConfig + if *v == nil { + sv = &types.AnswerMachineDetectionConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "awaitAnswerMachinePrompt": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AwaitAnswerMachinePrompt = ptr.Bool(jtv) + } + + case "enableAnswerMachineDetection": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableAnswerMachineDetection = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCampaign(v **types.Campaign, 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.Campaign + if *v == nil { + sv = &types.Campaign{} + } 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 CampaignArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "channelSubtypeConfig": + if err := awsRestjson1_deserializeDocumentChannelSubtypeConfig(&sv.ChannelSubtypeConfig, value); err != nil { + return err + } + + case "communicationLimitsOverride": + if err := awsRestjson1_deserializeDocumentCommunicationLimitsConfig(&sv.CommunicationLimitsOverride, value); err != nil { + return err + } + + case "communicationTimeConfig": + if err := awsRestjson1_deserializeDocumentCommunicationTimeConfig(&sv.CommunicationTimeConfig, value); err != nil { + return err + } + + case "connectCampaignFlowArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ConnectCampaignFlowArn = ptr.String(jtv) + } + + case "connectInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + } + sv.ConnectInstanceId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "schedule": + if err := awsRestjson1_deserializeDocumentSchedule(&sv.Schedule, value); err != nil { + return err + } + + case "source": + if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCampaignSummary(v **types.CampaignSummary, 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.CampaignSummary + if *v == nil { + sv = &types.CampaignSummary{} + } 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 CampaignArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "channelSubtypes": + if err := awsRestjson1_deserializeDocumentChannelSubtypeList(&sv.ChannelSubtypes, value); err != nil { + return err + } + + case "connectCampaignFlowArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ConnectCampaignFlowArn = ptr.String(jtv) + } + + case "connectInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + } + sv.ConnectInstanceId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "schedule": + if err := awsRestjson1_deserializeDocumentSchedule(&sv.Schedule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCampaignSummaryList(v *[]types.CampaignSummary, 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.CampaignSummary + if *v == nil { + cv = []types.CampaignSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CampaignSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCampaignSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentChannelSubtypeConfig(v **types.ChannelSubtypeConfig, 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.ChannelSubtypeConfig + if *v == nil { + sv = &types.ChannelSubtypeConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "email": + if err := awsRestjson1_deserializeDocumentEmailChannelSubtypeConfig(&sv.Email, value); err != nil { + return err + } + + case "sms": + if err := awsRestjson1_deserializeDocumentSmsChannelSubtypeConfig(&sv.Sms, value); err != nil { + return err + } + + case "telephony": + if err := awsRestjson1_deserializeDocumentTelephonyChannelSubtypeConfig(&sv.Telephony, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChannelSubtypeList(v *[]types.ChannelSubtype, 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.ChannelSubtype + if *v == nil { + cv = []types.ChannelSubtype{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ChannelSubtype + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChannelSubtype to be of type string, got %T instead", value) + } + col = types.ChannelSubtype(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCommunicationLimit(v **types.CommunicationLimit, 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.CommunicationLimit + if *v == nil { + sv = &types.CommunicationLimit{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "frequency": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Frequency = ptr.Int32(int32(i64)) + } + + case "maxCountPerRecipient": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxCountPerRecipient = ptr.Int32(int32(i64)) + } + + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommunicationLimitTimeUnit to be of type string, got %T instead", value) + } + sv.Unit = types.CommunicationLimitTimeUnit(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCommunicationLimitList(v *[]types.CommunicationLimit, 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.CommunicationLimit + if *v == nil { + cv = []types.CommunicationLimit{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CommunicationLimit + destAddr := &col + if err := awsRestjson1_deserializeDocumentCommunicationLimit(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCommunicationLimits(v *types.CommunicationLimits, 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 uv types.CommunicationLimits +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "communicationLimitsList": + var mv []types.CommunicationLimit + if err := awsRestjson1_deserializeDocumentCommunicationLimitList(&mv, value); err != nil { + return err + } + uv = &types.CommunicationLimitsMemberCommunicationLimitsList{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentCommunicationLimitsConfig(v **types.CommunicationLimitsConfig, 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.CommunicationLimitsConfig + if *v == nil { + sv = &types.CommunicationLimitsConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "allChannelSubtypes": + if err := awsRestjson1_deserializeDocumentCommunicationLimits(&sv.AllChannelSubtypes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCommunicationTimeConfig(v **types.CommunicationTimeConfig, 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.CommunicationTimeConfig + if *v == nil { + sv = &types.CommunicationTimeConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "email": + if err := awsRestjson1_deserializeDocumentTimeWindow(&sv.Email, value); err != nil { + return err + } + + case "localTimeZoneConfig": + if err := awsRestjson1_deserializeDocumentLocalTimeZoneConfig(&sv.LocalTimeZoneConfig, value); err != nil { + return err + } + + case "sms": + if err := awsRestjson1_deserializeDocumentTimeWindow(&sv.Sms, value); err != nil { + return err + } + + case "telephony": + if err := awsRestjson1_deserializeDocumentTimeWindow(&sv.Telephony, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCustomerProfilesIntegrationSummary(v **types.CustomerProfilesIntegrationSummary, 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.CustomerProfilesIntegrationSummary + if *v == nil { + sv = &types.CustomerProfilesIntegrationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "domainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "objectTypeNames": + if err := awsRestjson1_deserializeDocumentObjectTypeNamesMap(&sv.ObjectTypeNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDailyHours(v *map[string][]types.TimeRange, 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][]types.TimeRange + if *v == nil { + mv = map[string][]types.TimeRange{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal []types.TimeRange + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentTimeRangeList(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentEmailChannelSubtypeConfig(v **types.EmailChannelSubtypeConfig, 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.EmailChannelSubtypeConfig + if *v == nil { + sv = &types.EmailChannelSubtypeConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "capacity": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Capacity = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Capacity = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Capacity to be a JSON Number, got %T instead", value) + + } + } + + case "defaultOutboundConfig": + if err := awsRestjson1_deserializeDocumentEmailOutboundConfig(&sv.DefaultOutboundConfig, value); err != nil { + return err + } + + case "outboundMode": + if err := awsRestjson1_deserializeDocumentEmailOutboundMode(&sv.OutboundMode, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEmailOutboundConfig(v **types.EmailOutboundConfig, 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.EmailOutboundConfig + if *v == nil { + sv = &types.EmailOutboundConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectSourceEmailAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) + } + sv.ConnectSourceEmailAddress = ptr.String(jtv) + } + + case "sourceEmailAddressDisplayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EmailDisplayName to be of type string, got %T instead", value) + } + sv.SourceEmailAddressDisplayName = ptr.String(jtv) + } + + case "wisdomTemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.WisdomTemplateArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEmailOutboundMode(v *types.EmailOutboundMode, 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 uv types.EmailOutboundMode +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "agentless": + var mv types.AgentlessConfig + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAgentlessConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.EmailOutboundModeMemberAgentless{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentEncryptionConfig(v **types.EncryptionConfig, 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.EncryptionConfig + if *v == nil { + sv = &types.EncryptionConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + case "encryptionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) + } + sv.EncryptionType = types.EncryptionType(jtv) + } + + case "keyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EncryptionKey to be of type string, got %T instead", value) + } + sv.KeyArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFailedCampaignStateResponse(v **types.FailedCampaignStateResponse, 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.FailedCampaignStateResponse + if *v == nil { + sv = &types.FailedCampaignStateResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "campaignId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignId to be of type string, got %T instead", value) + } + sv.CampaignId = ptr.String(jtv) + } + + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GetCampaignStateBatchFailureCode to be of type string, got %T instead", value) + } + sv.FailureCode = types.GetCampaignStateBatchFailureCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFailedCampaignStateResponseList(v *[]types.FailedCampaignStateResponse, 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.FailedCampaignStateResponse + if *v == nil { + cv = []types.FailedCampaignStateResponse{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FailedCampaignStateResponse + destAddr := &col + if err := awsRestjson1_deserializeDocumentFailedCampaignStateResponse(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFailedRequest(v **types.FailedRequest, 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.FailedRequest + if *v == nil { + sv = &types.FailedRequest{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value) + } + sv.FailureCode = types.FailureCode(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DialRequestId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFailedRequestList(v *[]types.FailedRequest, 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.FailedRequest + if *v == nil { + cv = []types.FailedRequest{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FailedRequest + destAddr := &col + if err := awsRestjson1_deserializeDocumentFailedRequest(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInstanceConfig(v **types.InstanceConfig, 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.InstanceConfig + if *v == nil { + sv = &types.InstanceConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + } + sv.ConnectInstanceId = ptr.String(jtv) + } + + case "encryptionConfig": + if err := awsRestjson1_deserializeDocumentEncryptionConfig(&sv.EncryptionConfig, value); err != nil { + return err + } + + case "serviceLinkedRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceLinkedRoleArn to be of type string, got %T instead", value) + } + sv.ServiceLinkedRoleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInstanceOnboardingJobStatus(v **types.InstanceOnboardingJobStatus, 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.InstanceOnboardingJobStatus + if *v == nil { + sv = &types.InstanceOnboardingJobStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectInstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + } + sv.ConnectInstanceId = ptr.String(jtv) + } + + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceOnboardingJobFailureCode to be of type string, got %T instead", value) + } + sv.FailureCode = types.InstanceOnboardingJobFailureCode(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceOnboardingJobStatusCode to be of type string, got %T instead", value) + } + sv.Status = types.InstanceOnboardingJobStatusCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIntegrationSummary(v *types.IntegrationSummary, 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 uv types.IntegrationSummary +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "customerProfiles": + var mv types.CustomerProfilesIntegrationSummary + destAddr := &mv + if err := awsRestjson1_deserializeDocumentCustomerProfilesIntegrationSummary(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.IntegrationSummaryMemberCustomerProfiles{Value: mv} + break loop + + case "qConnect": + var mv types.QConnectIntegrationSummary + destAddr := &mv + if err := awsRestjson1_deserializeDocumentQConnectIntegrationSummary(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.IntegrationSummaryMemberQConnect{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentIntegrationSummaryList(v *[]types.IntegrationSummary, 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.IntegrationSummary + if *v == nil { + cv = []types.IntegrationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IntegrationSummary + if err := awsRestjson1_deserializeDocumentIntegrationSummary(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidCampaignStateException(v **types.InvalidCampaignStateException, 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.InvalidCampaignStateException + if *v == nil { + sv = &types.InvalidCampaignStateException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignState to be of type string, got %T instead", value) + } + sv.State = types.CampaignState(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidStateException(v **types.InvalidStateException, 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.InvalidStateException + if *v == nil { + sv = &types.InvalidStateException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLocalTimeZoneConfig(v **types.LocalTimeZoneConfig, 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.LocalTimeZoneConfig + if *v == nil { + sv = &types.LocalTimeZoneConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "defaultTimeZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeZone to be of type string, got %T instead", value) + } + sv.DefaultTimeZone = ptr.String(jtv) + } + + case "localTimeZoneDetection": + if err := awsRestjson1_deserializeDocumentLocalTimeZoneDetection(&sv.LocalTimeZoneDetection, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLocalTimeZoneDetection(v *[]types.LocalTimeZoneDetectionType, 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.LocalTimeZoneDetectionType + if *v == nil { + cv = []types.LocalTimeZoneDetectionType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LocalTimeZoneDetectionType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocalTimeZoneDetectionType to be of type string, got %T instead", value) + } + col = types.LocalTimeZoneDetectionType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentObjectTypeNamesMap(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 + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ObjectTypeName to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentOpenHours(v *types.OpenHours, 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 uv types.OpenHours +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "dailyHours": + var mv map[string][]types.TimeRange + if err := awsRestjson1_deserializeDocumentDailyHours(&mv, value); err != nil { + return err + } + uv = &types.OpenHoursMemberDailyHours{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentPredictiveConfig(v **types.PredictiveConfig, 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.PredictiveConfig + if *v == nil { + sv = &types.PredictiveConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bandwidthAllocation": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.BandwidthAllocation = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.BandwidthAllocation = ptr.Float64(f64) + + default: + return fmt.Errorf("expected BandwidthAllocation to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProgressiveConfig(v **types.ProgressiveConfig, 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.ProgressiveConfig + if *v == nil { + sv = &types.ProgressiveConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bandwidthAllocation": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.BandwidthAllocation = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.BandwidthAllocation = ptr.Float64(f64) + + default: + return fmt.Errorf("expected BandwidthAllocation to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQConnectIntegrationSummary(v **types.QConnectIntegrationSummary, 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.QConnectIntegrationSummary + if *v == nil { + sv = &types.QConnectIntegrationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBaseArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.KnowledgeBaseArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRestrictedPeriod(v **types.RestrictedPeriod, 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.RestrictedPeriod + if *v == nil { + sv = &types.RestrictedPeriod{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Date to be of type string, got %T instead", value) + } + sv.EndDate = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RestrictedPeriodName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "startDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Date to be of type string, got %T instead", value) + } + sv.StartDate = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRestrictedPeriodList(v *[]types.RestrictedPeriod, 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.RestrictedPeriod + if *v == nil { + cv = []types.RestrictedPeriod{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RestrictedPeriod + destAddr := &col + if err := awsRestjson1_deserializeDocumentRestrictedPeriod(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRestrictedPeriods(v *types.RestrictedPeriods, 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 uv types.RestrictedPeriods +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "restrictedPeriodList": + var mv []types.RestrictedPeriod + if err := awsRestjson1_deserializeDocumentRestrictedPeriodList(&mv, value); err != nil { + return err + } + uv = &types.RestrictedPeriodsMemberRestrictedPeriodList{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, 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.Schedule + if *v == nil { + sv = &types.Schedule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeStamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) + } + + case "refreshFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Duration to be of type string, got %T instead", value) + } + sv.RefreshFrequency = ptr.String(jtv) + } + + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeStamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartTime = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSmsChannelSubtypeConfig(v **types.SmsChannelSubtypeConfig, 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.SmsChannelSubtypeConfig + if *v == nil { + sv = &types.SmsChannelSubtypeConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "capacity": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Capacity = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Capacity = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Capacity to be a JSON Number, got %T instead", value) + + } + } + + case "defaultOutboundConfig": + if err := awsRestjson1_deserializeDocumentSmsOutboundConfig(&sv.DefaultOutboundConfig, value); err != nil { + return err + } + + case "outboundMode": + if err := awsRestjson1_deserializeDocumentSmsOutboundMode(&sv.OutboundMode, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSmsOutboundConfig(v **types.SmsOutboundConfig, 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.SmsOutboundConfig + if *v == nil { + sv = &types.SmsOutboundConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectSourcePhoneNumberArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ConnectSourcePhoneNumberArn = ptr.String(jtv) + } + + case "wisdomTemplateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.WisdomTemplateArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSmsOutboundMode(v *types.SmsOutboundMode, 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 uv types.SmsOutboundMode +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "agentless": + var mv types.AgentlessConfig + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAgentlessConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.SmsOutboundModeMemberAgentless{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentSource(v *types.Source, 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 uv types.Source +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "customerProfilesSegmentArn": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.SourceMemberCustomerProfilesSegmentArn{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentSuccessfulCampaignStateResponse(v **types.SuccessfulCampaignStateResponse, 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.SuccessfulCampaignStateResponse + if *v == nil { + sv = &types.SuccessfulCampaignStateResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "campaignId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignId to be of type string, got %T instead", value) + } + sv.CampaignId = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CampaignState to be of type string, got %T instead", value) + } + sv.State = types.CampaignState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuccessfulCampaignStateResponseList(v *[]types.SuccessfulCampaignStateResponse, 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.SuccessfulCampaignStateResponse + if *v == nil { + cv = []types.SuccessfulCampaignStateResponse{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SuccessfulCampaignStateResponse + destAddr := &col + if err := awsRestjson1_deserializeDocumentSuccessfulCampaignStateResponse(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSuccessfulRequest(v **types.SuccessfulRequest, 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.SuccessfulRequest + if *v == nil { + sv = &types.SuccessfulRequest{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DialRequestId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuccessfulRequestList(v *[]types.SuccessfulRequest, 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.SuccessfulRequest + if *v == nil { + cv = []types.SuccessfulRequest{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SuccessfulRequest + destAddr := &col + if err := awsRestjson1_deserializeDocumentSuccessfulRequest(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(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 + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTelephonyChannelSubtypeConfig(v **types.TelephonyChannelSubtypeConfig, 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.TelephonyChannelSubtypeConfig + if *v == nil { + sv = &types.TelephonyChannelSubtypeConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "capacity": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Capacity = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Capacity = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Capacity to be a JSON Number, got %T instead", value) + + } + } + + case "connectQueueId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueueId to be of type string, got %T instead", value) + } + sv.ConnectQueueId = ptr.String(jtv) + } + + case "defaultOutboundConfig": + if err := awsRestjson1_deserializeDocumentTelephonyOutboundConfig(&sv.DefaultOutboundConfig, value); err != nil { + return err + } + + case "outboundMode": + if err := awsRestjson1_deserializeDocumentTelephonyOutboundMode(&sv.OutboundMode, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTelephonyOutboundConfig(v **types.TelephonyOutboundConfig, 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.TelephonyOutboundConfig + if *v == nil { + sv = &types.TelephonyOutboundConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "answerMachineDetectionConfig": + if err := awsRestjson1_deserializeDocumentAnswerMachineDetectionConfig(&sv.AnswerMachineDetectionConfig, value); err != nil { + return err + } + + case "connectContactFlowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContactFlowId to be of type string, got %T instead", value) + } + sv.ConnectContactFlowId = ptr.String(jtv) + } + + case "connectSourcePhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourcePhoneNumber to be of type string, got %T instead", value) + } + sv.ConnectSourcePhoneNumber = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTelephonyOutboundMode(v *types.TelephonyOutboundMode, 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 uv types.TelephonyOutboundMode +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "agentless": + var mv types.AgentlessConfig + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAgentlessConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.TelephonyOutboundModeMemberAgentless{Value: mv} + break loop + + case "predictive": + var mv types.PredictiveConfig + destAddr := &mv + if err := awsRestjson1_deserializeDocumentPredictiveConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.TelephonyOutboundModeMemberPredictive{Value: mv} + break loop + + case "progressive": + var mv types.ProgressiveConfig + destAddr := &mv + if err := awsRestjson1_deserializeDocumentProgressiveConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.TelephonyOutboundModeMemberProgressive{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTimeRange(v **types.TimeRange, 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.TimeRange + if *v == nil { + sv = &types.TimeRange{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Time to be of type string, got %T instead", value) + } + sv.EndTime = ptr.String(jtv) + } + + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Time to be of type string, got %T instead", value) + } + sv.StartTime = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTimeRangeList(v *[]types.TimeRange, 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.TimeRange + if *v == nil { + cv = []types.TimeRange{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TimeRange + destAddr := &col + if err := awsRestjson1_deserializeDocumentTimeRange(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTimeWindow(v **types.TimeWindow, 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.TimeWindow + if *v == nil { + sv = &types.TimeWindow{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "openHours": + if err := awsRestjson1_deserializeDocumentOpenHours(&sv.OpenHours, value); err != nil { + return err + } + + case "restrictedPeriods": + if err := awsRestjson1_deserializeDocumentRestrictedPeriods(&sv.RestrictedPeriods, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "xAmzErrorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XAmazonErrorType to be of type string, got %T instead", value) + } + sv.XAmzErrorType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/connectcampaignsv2/doc.go b/service/connectcampaignsv2/doc.go new file mode 100644 index 00000000000..3b6aee9407d --- /dev/null +++ b/service/connectcampaignsv2/doc.go @@ -0,0 +1,7 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package connectcampaignsv2 provides the API client, operations, and parameter +// types for AmazonConnectCampaignServiceV2. +// +// Provide APIs to create and manage Amazon Connect Campaigns. +package connectcampaignsv2 diff --git a/service/connectcampaignsv2/endpoints.go b/service/connectcampaignsv2/endpoints.go new file mode 100644 index 00000000000..d671b747037 --- /dev/null +++ b/service/connectcampaignsv2/endpoints.go @@ -0,0 +1,537 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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/connectcampaignsv2/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" + "github.com/aws/smithy-go/tracing" + 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 = "connect-campaigns" + } + 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_CONNECTCAMPAIGNSV2") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "ConnectCampaignsV2", 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 +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// 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://connect-campaigns-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://connect-campaigns-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://connect-campaigns.") + 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://connect-campaigns.") + 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(ctx context.Context, 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, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + 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(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + 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) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/connectcampaignsv2/endpoints_config_test.go b/service/connectcampaignsv2/endpoints_config_test.go new file mode 100644 index 00000000000..662e0aa3194 --- /dev/null +++ b/service/connectcampaignsv2/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-connectcampaignsv2.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-connectcampaignsv2.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-connectcampaignsv2.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-connectcampaignsv2.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-connectcampaignsv2.dev", + expectURL: aws.String("https://env-connectcampaignsv2.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-connectcampaignsv2.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-connectcampaignsv2.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-connectcampaignsv2.dev", + expectURL: aws.String("http://config-connectcampaignsv2.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-connectcampaignsv2.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-connectcampaignsv2.dev", + clientEndpoint: aws.String("https://client-connectcampaignsv2.dev"), + expectURL: aws.String("https://client-connectcampaignsv2.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_CONNECTCAMPAIGNSV2", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/connectcampaignsv2/endpoints_test.go b/service/connectcampaignsv2/endpoints_test.go new file mode 100644 index 00000000000..3967687bc45 --- /dev/null +++ b/service/connectcampaignsv2/endpoints_test.go @@ -0,0 +1,820 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack disabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://connect-campaigns.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with region not set and fips disabled and dualstack disabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled and dualstack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/connectcampaignsv2/generated.json b/service/connectcampaignsv2/generated.json new file mode 100644 index 00000000000..dc1153e0e5e --- /dev/null +++ b/service/connectcampaignsv2/generated.json @@ -0,0 +1,65 @@ +{ + "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_CreateCampaign.go", + "api_op_DeleteCampaign.go", + "api_op_DeleteCampaignChannelSubtypeConfig.go", + "api_op_DeleteCampaignCommunicationLimits.go", + "api_op_DeleteCampaignCommunicationTime.go", + "api_op_DeleteConnectInstanceConfig.go", + "api_op_DeleteConnectInstanceIntegration.go", + "api_op_DeleteInstanceOnboardingJob.go", + "api_op_DescribeCampaign.go", + "api_op_GetCampaignState.go", + "api_op_GetCampaignStateBatch.go", + "api_op_GetConnectInstanceConfig.go", + "api_op_GetInstanceOnboardingJobStatus.go", + "api_op_ListCampaigns.go", + "api_op_ListConnectInstanceIntegrations.go", + "api_op_ListTagsForResource.go", + "api_op_PauseCampaign.go", + "api_op_PutConnectInstanceIntegration.go", + "api_op_PutOutboundRequestBatch.go", + "api_op_ResumeCampaign.go", + "api_op_StartCampaign.go", + "api_op_StartInstanceOnboardingJob.go", + "api_op_StopCampaign.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateCampaignChannelSubtypeConfig.go", + "api_op_UpdateCampaignCommunicationLimits.go", + "api_op_UpdateCampaignCommunicationTime.go", + "api_op_UpdateCampaignFlowAssociation.go", + "api_op_UpdateCampaignName.go", + "api_op_UpdateCampaignSchedule.go", + "api_op_UpdateCampaignSource.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", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2", + "unstable": false +} diff --git a/service/connectcampaignsv2/go.mod b/service/connectcampaignsv2/go.mod new file mode 100644 index 00000000000..7361f56806d --- /dev/null +++ b/service/connectcampaignsv2/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2 + +go 1.21 + +require ( + github.com/aws/aws-sdk-go-v2 v1.32.4 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 + github.com/aws/smithy-go v1.22.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/connectcampaignsv2/go.sum b/service/connectcampaignsv2/go.sum new file mode 100644 index 00000000000..70a20636e37 --- /dev/null +++ b/service/connectcampaignsv2/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/connectcampaignsv2/go_module_metadata.go b/service/connectcampaignsv2/go_module_metadata.go new file mode 100644 index 00000000000..f5640406dc1 --- /dev/null +++ b/service/connectcampaignsv2/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package connectcampaignsv2 + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/connectcampaignsv2/internal/endpoints/endpoints.go b/service/connectcampaignsv2/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..65192f880c1 --- /dev/null +++ b/service/connectcampaignsv2/internal/endpoints/endpoints.go @@ -0,0 +1,346 @@ +// 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 ConnectCampaignsV2 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|mx)\\-\\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: "connect-campaigns.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "connect-campaigns-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "connect-campaigns-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "connect-campaigns.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "connect-campaigns-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "connect-campaigns-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "connect-campaigns-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "connect-campaigns-fips.us-west-2.amazonaws.com", + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "connect-campaigns.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "connect-campaigns-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "connect-campaigns-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "connect-campaigns.{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: "connect-campaigns-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "connect-campaigns.{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: "connect-campaigns-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "connect-campaigns.{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: "connect-campaigns-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "connect-campaigns.{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: "connect-campaigns-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "connect-campaigns.{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: "connect-campaigns.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "connect-campaigns-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "connect-campaigns-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "connect-campaigns.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/connectcampaignsv2/internal/endpoints/endpoints_test.go b/service/connectcampaignsv2/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/connectcampaignsv2/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/connectcampaignsv2/options.go b/service/connectcampaignsv2/options.go new file mode 100644 index 00000000000..d4b574c28a1 --- /dev/null +++ b/service/connectcampaignsv2/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +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/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + 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 client meter provider. + MeterProvider metrics.MeterProvider + + // 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 client tracer provider. + TracerProvider tracing.TracerProvider + + // 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/service/connectcampaignsv2/protocol_test.go b/service/connectcampaignsv2/protocol_test.go new file mode 100644 index 00000000000..6c1bbf80c8d --- /dev/null +++ b/service/connectcampaignsv2/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 diff --git a/service/connectcampaignsv2/serializers.go b/service/connectcampaignsv2/serializers.go new file mode 100644 index 00000000000..aa75272cdc5 --- /dev/null +++ b/service/connectcampaignsv2/serializers.go @@ -0,0 +1,3729 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "math" +) + +type awsRestjson1_serializeOpCreateCampaign struct { +} + +func (*awsRestjson1_serializeOpCreateCampaign) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateCampaign) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateCampaignInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateCampaignInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateCampaignInput(v *CreateCampaignInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateCampaignInput(v *CreateCampaignInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChannelSubtypeConfig != nil { + ok := object.Key("channelSubtypeConfig") + if err := awsRestjson1_serializeDocumentChannelSubtypeConfig(v.ChannelSubtypeConfig, ok); err != nil { + return err + } + } + + if v.CommunicationLimitsOverride != nil { + ok := object.Key("communicationLimitsOverride") + if err := awsRestjson1_serializeDocumentCommunicationLimitsConfig(v.CommunicationLimitsOverride, ok); err != nil { + return err + } + } + + if v.CommunicationTimeConfig != nil { + ok := object.Key("communicationTimeConfig") + if err := awsRestjson1_serializeDocumentCommunicationTimeConfig(v.CommunicationTimeConfig, ok); err != nil { + return err + } + } + + if v.ConnectCampaignFlowArn != nil { + ok := object.Key("connectCampaignFlowArn") + ok.String(*v.ConnectCampaignFlowArn) + } + + if v.ConnectInstanceId != nil { + ok := object.Key("connectInstanceId") + ok.String(*v.ConnectInstanceId) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Schedule != nil { + ok := object.Key("schedule") + if err := awsRestjson1_serializeDocumentSchedule(v.Schedule, ok); err != nil { + return err + } + } + + if v.Source != nil { + ok := object.Key("source") + if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteCampaign struct { +} + +func (*awsRestjson1_serializeOpDeleteCampaign) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCampaign) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteCampaignInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteCampaignInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteCampaignInput(v *DeleteCampaignInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteCampaignChannelSubtypeConfig struct { +} + +func (*awsRestjson1_serializeOpDeleteCampaignChannelSubtypeConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCampaignChannelSubtypeConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteCampaignChannelSubtypeConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/channel-subtype-config") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteCampaignChannelSubtypeConfigInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteCampaignChannelSubtypeConfigInput(v *DeleteCampaignChannelSubtypeConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ChannelSubtype) > 0 { + encoder.SetQuery("channelSubtype").String(string(v.ChannelSubtype)) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteCampaignCommunicationLimits struct { +} + +func (*awsRestjson1_serializeOpDeleteCampaignCommunicationLimits) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCampaignCommunicationLimits) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteCampaignCommunicationLimitsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/communication-limits") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteCampaignCommunicationLimitsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteCampaignCommunicationLimitsInput(v *DeleteCampaignCommunicationLimitsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.Config) > 0 { + encoder.SetQuery("config").String(string(v.Config)) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteCampaignCommunicationTime struct { +} + +func (*awsRestjson1_serializeOpDeleteCampaignCommunicationTime) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCampaignCommunicationTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteCampaignCommunicationTimeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/communication-time") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteCampaignCommunicationTimeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteCampaignCommunicationTimeInput(v *DeleteCampaignCommunicationTimeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.Config) > 0 { + encoder.SetQuery("config").String(string(v.Config)) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteConnectInstanceConfig struct { +} + +func (*awsRestjson1_serializeOpDeleteConnectInstanceConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteConnectInstanceConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteConnectInstanceConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/config") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteConnectInstanceConfigInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteConnectInstanceConfigInput(v *DeleteConnectInstanceConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.CampaignDeletionPolicy) > 0 { + encoder.SetQuery("campaignDeletionPolicy").String(string(v.CampaignDeletionPolicy)) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteConnectInstanceIntegration struct { +} + +func (*awsRestjson1_serializeOpDeleteConnectInstanceIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteConnectInstanceIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteConnectInstanceIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/integrations/delete") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteConnectInstanceIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteConnectInstanceIntegrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteConnectInstanceIntegrationInput(v *DeleteConnectInstanceIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteConnectInstanceIntegrationInput(v *DeleteConnectInstanceIntegrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IntegrationIdentifier != nil { + ok := object.Key("integrationIdentifier") + if err := awsRestjson1_serializeDocumentIntegrationIdentifier(v.IntegrationIdentifier, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteInstanceOnboardingJob struct { +} + +func (*awsRestjson1_serializeOpDeleteInstanceOnboardingJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteInstanceOnboardingJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteInstanceOnboardingJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/onboarding") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteInstanceOnboardingJobInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteInstanceOnboardingJobInput(v *DeleteInstanceOnboardingJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribeCampaign struct { +} + +func (*awsRestjson1_serializeOpDescribeCampaign) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeCampaign) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DescribeCampaignInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeCampaignInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribeCampaignInput(v *DescribeCampaignInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetCampaignState struct { +} + +func (*awsRestjson1_serializeOpGetCampaignState) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCampaignState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetCampaignStateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/state") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetCampaignStateInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetCampaignStateInput(v *GetCampaignStateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetCampaignStateBatch struct { +} + +func (*awsRestjson1_serializeOpGetCampaignStateBatch) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCampaignStateBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetCampaignStateBatchInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns-state") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetCampaignStateBatchInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetCampaignStateBatchInput(v *GetCampaignStateBatchInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetCampaignStateBatchInput(v *GetCampaignStateBatchInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CampaignIds != nil { + ok := object.Key("campaignIds") + if err := awsRestjson1_serializeDocumentCampaignIdList(v.CampaignIds, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetConnectInstanceConfig struct { +} + +func (*awsRestjson1_serializeOpGetConnectInstanceConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetConnectInstanceConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetConnectInstanceConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/config") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetConnectInstanceConfigInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetConnectInstanceConfigInput(v *GetConnectInstanceConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetInstanceOnboardingJobStatus struct { +} + +func (*awsRestjson1_serializeOpGetInstanceOnboardingJobStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetInstanceOnboardingJobStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetInstanceOnboardingJobStatusInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/onboarding") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetInstanceOnboardingJobStatusInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetInstanceOnboardingJobStatusInput(v *GetInstanceOnboardingJobStatusInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListCampaigns struct { +} + +func (*awsRestjson1_serializeOpListCampaigns) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCampaigns) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListCampaignsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns-summary") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListCampaignsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListCampaignsInput(v *ListCampaignsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListCampaignsInput(v *ListCampaignsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentCampaignFilters(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) + } + + return nil +} + +type awsRestjson1_serializeOpListConnectInstanceIntegrations struct { +} + +func (*awsRestjson1_serializeOpListConnectInstanceIntegrations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListConnectInstanceIntegrations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListConnectInstanceIntegrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/integrations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListConnectInstanceIntegrationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListConnectInstanceIntegrationsInput(v *ListConnectInstanceIntegrationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPauseCampaign struct { +} + +func (*awsRestjson1_serializeOpPauseCampaign) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPauseCampaign) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*PauseCampaignInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/pause") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPauseCampaignInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPauseCampaignInput(v *PauseCampaignInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutConnectInstanceIntegration struct { +} + +func (*awsRestjson1_serializeOpPutConnectInstanceIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutConnectInstanceIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*PutConnectInstanceIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/integrations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutConnectInstanceIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutConnectInstanceIntegrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutConnectInstanceIntegrationInput(v *PutConnectInstanceIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutConnectInstanceIntegrationInput(v *PutConnectInstanceIntegrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IntegrationConfig != nil { + ok := object.Key("integrationConfig") + if err := awsRestjson1_serializeDocumentIntegrationConfig(v.IntegrationConfig, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutOutboundRequestBatch struct { +} + +func (*awsRestjson1_serializeOpPutOutboundRequestBatch) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutOutboundRequestBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*PutOutboundRequestBatchInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/outbound-requests") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutOutboundRequestBatchInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutOutboundRequestBatchInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutOutboundRequestBatchInput(v *PutOutboundRequestBatchInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutOutboundRequestBatchInput(v *PutOutboundRequestBatchInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OutboundRequests != nil { + ok := object.Key("outboundRequests") + if err := awsRestjson1_serializeDocumentOutboundRequestList(v.OutboundRequests, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpResumeCampaign struct { +} + +func (*awsRestjson1_serializeOpResumeCampaign) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpResumeCampaign) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ResumeCampaignInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/resume") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsResumeCampaignInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsResumeCampaignInput(v *ResumeCampaignInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStartCampaign struct { +} + +func (*awsRestjson1_serializeOpStartCampaign) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartCampaign) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*StartCampaignInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/start") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartCampaignInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartCampaignInput(v *StartCampaignInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStartInstanceOnboardingJob struct { +} + +func (*awsRestjson1_serializeOpStartInstanceOnboardingJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartInstanceOnboardingJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*StartInstanceOnboardingJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/connect-instance/{connectInstanceId}/onboarding") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartInstanceOnboardingJobInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartInstanceOnboardingJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartInstanceOnboardingJobInput(v *StartInstanceOnboardingJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectInstanceId == nil || len(*v.ConnectInstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectInstanceId must not be empty")} + } + if v.ConnectInstanceId != nil { + if err := encoder.SetURI("connectInstanceId").String(*v.ConnectInstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartInstanceOnboardingJobInput(v *StartInstanceOnboardingJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EncryptionConfig != nil { + ok := object.Key("encryptionConfig") + if err := awsRestjson1_serializeDocumentEncryptionConfig(v.EncryptionConfig, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStopCampaign struct { +} + +func (*awsRestjson1_serializeOpStopCampaign) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStopCampaign) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*StopCampaignInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/stop") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStopCampaignInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStopCampaignInput(v *StopCampaignInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_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 = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCampaignChannelSubtypeConfig struct { +} + +func (*awsRestjson1_serializeOpUpdateCampaignChannelSubtypeConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCampaignChannelSubtypeConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateCampaignChannelSubtypeConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/channel-subtype-config") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCampaignChannelSubtypeConfigInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCampaignChannelSubtypeConfigInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCampaignChannelSubtypeConfigInput(v *UpdateCampaignChannelSubtypeConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCampaignChannelSubtypeConfigInput(v *UpdateCampaignChannelSubtypeConfigInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChannelSubtypeConfig != nil { + ok := object.Key("channelSubtypeConfig") + if err := awsRestjson1_serializeDocumentChannelSubtypeConfig(v.ChannelSubtypeConfig, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCampaignCommunicationLimits struct { +} + +func (*awsRestjson1_serializeOpUpdateCampaignCommunicationLimits) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCampaignCommunicationLimits) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateCampaignCommunicationLimitsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/communication-limits") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCampaignCommunicationLimitsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCampaignCommunicationLimitsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCampaignCommunicationLimitsInput(v *UpdateCampaignCommunicationLimitsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCampaignCommunicationLimitsInput(v *UpdateCampaignCommunicationLimitsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CommunicationLimitsOverride != nil { + ok := object.Key("communicationLimitsOverride") + if err := awsRestjson1_serializeDocumentCommunicationLimitsConfig(v.CommunicationLimitsOverride, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCampaignCommunicationTime struct { +} + +func (*awsRestjson1_serializeOpUpdateCampaignCommunicationTime) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCampaignCommunicationTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateCampaignCommunicationTimeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/communication-time") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCampaignCommunicationTimeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCampaignCommunicationTimeInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCampaignCommunicationTimeInput(v *UpdateCampaignCommunicationTimeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCampaignCommunicationTimeInput(v *UpdateCampaignCommunicationTimeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CommunicationTimeConfig != nil { + ok := object.Key("communicationTimeConfig") + if err := awsRestjson1_serializeDocumentCommunicationTimeConfig(v.CommunicationTimeConfig, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCampaignFlowAssociation struct { +} + +func (*awsRestjson1_serializeOpUpdateCampaignFlowAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCampaignFlowAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateCampaignFlowAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/flow") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCampaignFlowAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCampaignFlowAssociationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCampaignFlowAssociationInput(v *UpdateCampaignFlowAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCampaignFlowAssociationInput(v *UpdateCampaignFlowAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectCampaignFlowArn != nil { + ok := object.Key("connectCampaignFlowArn") + ok.String(*v.ConnectCampaignFlowArn) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCampaignName struct { +} + +func (*awsRestjson1_serializeOpUpdateCampaignName) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCampaignName) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateCampaignNameInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/name") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCampaignNameInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCampaignNameInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCampaignNameInput(v *UpdateCampaignNameInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCampaignNameInput(v *UpdateCampaignNameInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCampaignSchedule struct { +} + +func (*awsRestjson1_serializeOpUpdateCampaignSchedule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCampaignSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateCampaignScheduleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/schedule") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCampaignScheduleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCampaignScheduleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCampaignScheduleInput(v *UpdateCampaignScheduleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCampaignScheduleInput(v *UpdateCampaignScheduleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Schedule != nil { + ok := object.Key("schedule") + if err := awsRestjson1_serializeDocumentSchedule(v.Schedule, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCampaignSource struct { +} + +func (*awsRestjson1_serializeOpUpdateCampaignSource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCampaignSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateCampaignSourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/campaigns/{id}/source") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCampaignSourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCampaignSourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCampaignSourceInput(v *UpdateCampaignSourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCampaignSourceInput(v *UpdateCampaignSourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Source != nil { + ok := object.Key("source") + if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAgentlessConfig(v *types.AgentlessConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsRestjson1_serializeDocumentAnswerMachineDetectionConfig(v *types.AnswerMachineDetectionConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwaitAnswerMachinePrompt != nil { + ok := object.Key("awaitAnswerMachinePrompt") + ok.Boolean(*v.AwaitAnswerMachinePrompt) + } + + if v.EnableAnswerMachineDetection != nil { + ok := object.Key("enableAnswerMachineDetection") + ok.Boolean(*v.EnableAnswerMachineDetection) + } + + return nil +} + +func awsRestjson1_serializeDocumentAttributes(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentCampaignFilters(v *types.CampaignFilters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InstanceIdFilter != nil { + ok := object.Key("instanceIdFilter") + if err := awsRestjson1_serializeDocumentInstanceIdFilter(v.InstanceIdFilter, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCampaignIdList(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 awsRestjson1_serializeDocumentChannelSubtypeConfig(v *types.ChannelSubtypeConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Email != nil { + ok := object.Key("email") + if err := awsRestjson1_serializeDocumentEmailChannelSubtypeConfig(v.Email, ok); err != nil { + return err + } + } + + if v.Sms != nil { + ok := object.Key("sms") + if err := awsRestjson1_serializeDocumentSmsChannelSubtypeConfig(v.Sms, ok); err != nil { + return err + } + } + + if v.Telephony != nil { + ok := object.Key("telephony") + if err := awsRestjson1_serializeDocumentTelephonyChannelSubtypeConfig(v.Telephony, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentChannelSubtypeParameters(v types.ChannelSubtypeParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ChannelSubtypeParametersMemberEmail: + av := object.Key("email") + if err := awsRestjson1_serializeDocumentEmailChannelSubtypeParameters(&uv.Value, av); err != nil { + return err + } + + case *types.ChannelSubtypeParametersMemberSms: + av := object.Key("sms") + if err := awsRestjson1_serializeDocumentSmsChannelSubtypeParameters(&uv.Value, av); err != nil { + return err + } + + case *types.ChannelSubtypeParametersMemberTelephony: + av := object.Key("telephony") + if err := awsRestjson1_serializeDocumentTelephonyChannelSubtypeParameters(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentCommunicationLimit(v *types.CommunicationLimit, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Frequency != nil { + ok := object.Key("frequency") + ok.Integer(*v.Frequency) + } + + if v.MaxCountPerRecipient != nil { + ok := object.Key("maxCountPerRecipient") + ok.Integer(*v.MaxCountPerRecipient) + } + + if len(v.Unit) > 0 { + ok := object.Key("unit") + ok.String(string(v.Unit)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCommunicationLimitList(v []types.CommunicationLimit, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCommunicationLimit(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCommunicationLimits(v types.CommunicationLimits, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.CommunicationLimitsMemberCommunicationLimitsList: + av := object.Key("communicationLimitsList") + if err := awsRestjson1_serializeDocumentCommunicationLimitList(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentCommunicationLimitsConfig(v *types.CommunicationLimitsConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AllChannelSubtypes != nil { + ok := object.Key("allChannelSubtypes") + if err := awsRestjson1_serializeDocumentCommunicationLimits(v.AllChannelSubtypes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCommunicationTimeConfig(v *types.CommunicationTimeConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Email != nil { + ok := object.Key("email") + if err := awsRestjson1_serializeDocumentTimeWindow(v.Email, ok); err != nil { + return err + } + } + + if v.LocalTimeZoneConfig != nil { + ok := object.Key("localTimeZoneConfig") + if err := awsRestjson1_serializeDocumentLocalTimeZoneConfig(v.LocalTimeZoneConfig, ok); err != nil { + return err + } + } + + if v.Sms != nil { + ok := object.Key("sms") + if err := awsRestjson1_serializeDocumentTimeWindow(v.Sms, ok); err != nil { + return err + } + } + + if v.Telephony != nil { + ok := object.Key("telephony") + if err := awsRestjson1_serializeDocumentTimeWindow(v.Telephony, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCustomerProfilesIntegrationConfig(v *types.CustomerProfilesIntegrationConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainArn != nil { + ok := object.Key("domainArn") + ok.String(*v.DomainArn) + } + + if v.ObjectTypeNames != nil { + ok := object.Key("objectTypeNames") + if err := awsRestjson1_serializeDocumentObjectTypeNamesMap(v.ObjectTypeNames, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCustomerProfilesIntegrationIdentifier(v *types.CustomerProfilesIntegrationIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainArn != nil { + ok := object.Key("domainArn") + ok.String(*v.DomainArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentDailyHours(v map[string][]types.TimeRange, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentTimeRangeList(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentEmailChannelSubtypeConfig(v *types.EmailChannelSubtypeConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Capacity != nil { + ok := object.Key("capacity") + switch { + case math.IsNaN(*v.Capacity): + ok.String("NaN") + + case math.IsInf(*v.Capacity, 1): + ok.String("Infinity") + + case math.IsInf(*v.Capacity, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Capacity) + + } + } + + if v.DefaultOutboundConfig != nil { + ok := object.Key("defaultOutboundConfig") + if err := awsRestjson1_serializeDocumentEmailOutboundConfig(v.DefaultOutboundConfig, ok); err != nil { + return err + } + } + + if v.OutboundMode != nil { + ok := object.Key("outboundMode") + if err := awsRestjson1_serializeDocumentEmailOutboundMode(v.OutboundMode, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEmailChannelSubtypeParameters(v *types.EmailChannelSubtypeParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectSourceEmailAddress != nil { + ok := object.Key("connectSourceEmailAddress") + ok.String(*v.ConnectSourceEmailAddress) + } + + if v.DestinationEmailAddress != nil { + ok := object.Key("destinationEmailAddress") + ok.String(*v.DestinationEmailAddress) + } + + if v.TemplateArn != nil { + ok := object.Key("templateArn") + ok.String(*v.TemplateArn) + } + + if v.TemplateParameters != nil { + ok := object.Key("templateParameters") + if err := awsRestjson1_serializeDocumentAttributes(v.TemplateParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEmailOutboundConfig(v *types.EmailOutboundConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectSourceEmailAddress != nil { + ok := object.Key("connectSourceEmailAddress") + ok.String(*v.ConnectSourceEmailAddress) + } + + if v.SourceEmailAddressDisplayName != nil { + ok := object.Key("sourceEmailAddressDisplayName") + ok.String(*v.SourceEmailAddressDisplayName) + } + + if v.WisdomTemplateArn != nil { + ok := object.Key("wisdomTemplateArn") + ok.String(*v.WisdomTemplateArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentEmailOutboundMode(v types.EmailOutboundMode, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.EmailOutboundModeMemberAgentless: + av := object.Key("agentless") + if err := awsRestjson1_serializeDocumentAgentlessConfig(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentEncryptionConfig(v *types.EncryptionConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + { + ok := object.Key("enabled") + ok.Boolean(v.Enabled) + } + + if len(v.EncryptionType) > 0 { + ok := object.Key("encryptionType") + ok.String(string(v.EncryptionType)) + } + + if v.KeyArn != nil { + ok := object.Key("keyArn") + ok.String(*v.KeyArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentInstanceIdFilter(v *types.InstanceIdFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Operator) > 0 { + ok := object.Key("operator") + ok.String(string(v.Operator)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentIntegrationConfig(v types.IntegrationConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.IntegrationConfigMemberCustomerProfiles: + av := object.Key("customerProfiles") + if err := awsRestjson1_serializeDocumentCustomerProfilesIntegrationConfig(&uv.Value, av); err != nil { + return err + } + + case *types.IntegrationConfigMemberQConnect: + av := object.Key("qConnect") + if err := awsRestjson1_serializeDocumentQConnectIntegrationConfig(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentIntegrationIdentifier(v types.IntegrationIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.IntegrationIdentifierMemberCustomerProfiles: + av := object.Key("customerProfiles") + if err := awsRestjson1_serializeDocumentCustomerProfilesIntegrationIdentifier(&uv.Value, av); err != nil { + return err + } + + case *types.IntegrationIdentifierMemberQConnect: + av := object.Key("qConnect") + if err := awsRestjson1_serializeDocumentQConnectIntegrationIdentifier(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentLocalTimeZoneConfig(v *types.LocalTimeZoneConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DefaultTimeZone != nil { + ok := object.Key("defaultTimeZone") + ok.String(*v.DefaultTimeZone) + } + + if v.LocalTimeZoneDetection != nil { + ok := object.Key("localTimeZoneDetection") + if err := awsRestjson1_serializeDocumentLocalTimeZoneDetection(v.LocalTimeZoneDetection, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentLocalTimeZoneDetection(v []types.LocalTimeZoneDetectionType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentObjectTypeNamesMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentOpenHours(v types.OpenHours, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.OpenHoursMemberDailyHours: + av := object.Key("dailyHours") + if err := awsRestjson1_serializeDocumentDailyHours(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentOutboundRequest(v *types.OutboundRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChannelSubtypeParameters != nil { + ok := object.Key("channelSubtypeParameters") + if err := awsRestjson1_serializeDocumentChannelSubtypeParameters(v.ChannelSubtypeParameters, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.ExpirationTime != nil { + ok := object.Key("expirationTime") + ok.String(smithytime.FormatDateTime(*v.ExpirationTime)) + } + + return nil +} + +func awsRestjson1_serializeDocumentOutboundRequestList(v []types.OutboundRequest, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentOutboundRequest(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPredictiveConfig(v *types.PredictiveConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BandwidthAllocation != nil { + ok := object.Key("bandwidthAllocation") + switch { + case math.IsNaN(*v.BandwidthAllocation): + ok.String("NaN") + + case math.IsInf(*v.BandwidthAllocation, 1): + ok.String("Infinity") + + case math.IsInf(*v.BandwidthAllocation, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.BandwidthAllocation) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentProgressiveConfig(v *types.ProgressiveConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BandwidthAllocation != nil { + ok := object.Key("bandwidthAllocation") + switch { + case math.IsNaN(*v.BandwidthAllocation): + ok.String("NaN") + + case math.IsInf(*v.BandwidthAllocation, 1): + ok.String("Infinity") + + case math.IsInf(*v.BandwidthAllocation, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.BandwidthAllocation) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentQConnectIntegrationConfig(v *types.QConnectIntegrationConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KnowledgeBaseArn != nil { + ok := object.Key("knowledgeBaseArn") + ok.String(*v.KnowledgeBaseArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentQConnectIntegrationIdentifier(v *types.QConnectIntegrationIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KnowledgeBaseArn != nil { + ok := object.Key("knowledgeBaseArn") + ok.String(*v.KnowledgeBaseArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentRestrictedPeriod(v *types.RestrictedPeriod, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndDate != nil { + ok := object.Key("endDate") + ok.String(*v.EndDate) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.StartDate != nil { + ok := object.Key("startDate") + ok.String(*v.StartDate) + } + + return nil +} + +func awsRestjson1_serializeDocumentRestrictedPeriodList(v []types.RestrictedPeriod, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRestrictedPeriod(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRestrictedPeriods(v types.RestrictedPeriods, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.RestrictedPeriodsMemberRestrictedPeriodList: + av := object.Key("restrictedPeriodList") + if err := awsRestjson1_serializeDocumentRestrictedPeriodList(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentSchedule(v *types.Schedule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("endTime") + ok.String(smithytime.FormatDateTime(*v.EndTime)) + } + + if v.RefreshFrequency != nil { + ok := object.Key("refreshFrequency") + ok.String(*v.RefreshFrequency) + } + + if v.StartTime != nil { + ok := object.Key("startTime") + ok.String(smithytime.FormatDateTime(*v.StartTime)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSmsChannelSubtypeConfig(v *types.SmsChannelSubtypeConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Capacity != nil { + ok := object.Key("capacity") + switch { + case math.IsNaN(*v.Capacity): + ok.String("NaN") + + case math.IsInf(*v.Capacity, 1): + ok.String("Infinity") + + case math.IsInf(*v.Capacity, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Capacity) + + } + } + + if v.DefaultOutboundConfig != nil { + ok := object.Key("defaultOutboundConfig") + if err := awsRestjson1_serializeDocumentSmsOutboundConfig(v.DefaultOutboundConfig, ok); err != nil { + return err + } + } + + if v.OutboundMode != nil { + ok := object.Key("outboundMode") + if err := awsRestjson1_serializeDocumentSmsOutboundMode(v.OutboundMode, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSmsChannelSubtypeParameters(v *types.SmsChannelSubtypeParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectSourcePhoneNumberArn != nil { + ok := object.Key("connectSourcePhoneNumberArn") + ok.String(*v.ConnectSourcePhoneNumberArn) + } + + if v.DestinationPhoneNumber != nil { + ok := object.Key("destinationPhoneNumber") + ok.String(*v.DestinationPhoneNumber) + } + + if v.TemplateArn != nil { + ok := object.Key("templateArn") + ok.String(*v.TemplateArn) + } + + if v.TemplateParameters != nil { + ok := object.Key("templateParameters") + if err := awsRestjson1_serializeDocumentAttributes(v.TemplateParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSmsOutboundConfig(v *types.SmsOutboundConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectSourcePhoneNumberArn != nil { + ok := object.Key("connectSourcePhoneNumberArn") + ok.String(*v.ConnectSourcePhoneNumberArn) + } + + if v.WisdomTemplateArn != nil { + ok := object.Key("wisdomTemplateArn") + ok.String(*v.WisdomTemplateArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentSmsOutboundMode(v types.SmsOutboundMode, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SmsOutboundModeMemberAgentless: + av := object.Key("agentless") + if err := awsRestjson1_serializeDocumentAgentlessConfig(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentSource(v types.Source, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SourceMemberCustomerProfilesSegmentArn: + av := object.Key("customerProfilesSegmentArn") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentTelephonyChannelSubtypeConfig(v *types.TelephonyChannelSubtypeConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Capacity != nil { + ok := object.Key("capacity") + switch { + case math.IsNaN(*v.Capacity): + ok.String("NaN") + + case math.IsInf(*v.Capacity, 1): + ok.String("Infinity") + + case math.IsInf(*v.Capacity, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Capacity) + + } + } + + if v.ConnectQueueId != nil { + ok := object.Key("connectQueueId") + ok.String(*v.ConnectQueueId) + } + + if v.DefaultOutboundConfig != nil { + ok := object.Key("defaultOutboundConfig") + if err := awsRestjson1_serializeDocumentTelephonyOutboundConfig(v.DefaultOutboundConfig, ok); err != nil { + return err + } + } + + if v.OutboundMode != nil { + ok := object.Key("outboundMode") + if err := awsRestjson1_serializeDocumentTelephonyOutboundMode(v.OutboundMode, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTelephonyChannelSubtypeParameters(v *types.TelephonyChannelSubtypeParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnswerMachineDetectionConfig != nil { + ok := object.Key("answerMachineDetectionConfig") + if err := awsRestjson1_serializeDocumentAnswerMachineDetectionConfig(v.AnswerMachineDetectionConfig, ok); err != nil { + return err + } + } + + if v.Attributes != nil { + ok := object.Key("attributes") + if err := awsRestjson1_serializeDocumentAttributes(v.Attributes, ok); err != nil { + return err + } + } + + if v.ConnectSourcePhoneNumber != nil { + ok := object.Key("connectSourcePhoneNumber") + ok.String(*v.ConnectSourcePhoneNumber) + } + + if v.DestinationPhoneNumber != nil { + ok := object.Key("destinationPhoneNumber") + ok.String(*v.DestinationPhoneNumber) + } + + return nil +} + +func awsRestjson1_serializeDocumentTelephonyOutboundConfig(v *types.TelephonyOutboundConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnswerMachineDetectionConfig != nil { + ok := object.Key("answerMachineDetectionConfig") + if err := awsRestjson1_serializeDocumentAnswerMachineDetectionConfig(v.AnswerMachineDetectionConfig, ok); err != nil { + return err + } + } + + if v.ConnectContactFlowId != nil { + ok := object.Key("connectContactFlowId") + ok.String(*v.ConnectContactFlowId) + } + + if v.ConnectSourcePhoneNumber != nil { + ok := object.Key("connectSourcePhoneNumber") + ok.String(*v.ConnectSourcePhoneNumber) + } + + return nil +} + +func awsRestjson1_serializeDocumentTelephonyOutboundMode(v types.TelephonyOutboundMode, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.TelephonyOutboundModeMemberAgentless: + av := object.Key("agentless") + if err := awsRestjson1_serializeDocumentAgentlessConfig(&uv.Value, av); err != nil { + return err + } + + case *types.TelephonyOutboundModeMemberPredictive: + av := object.Key("predictive") + if err := awsRestjson1_serializeDocumentPredictiveConfig(&uv.Value, av); err != nil { + return err + } + + case *types.TelephonyOutboundModeMemberProgressive: + av := object.Key("progressive") + if err := awsRestjson1_serializeDocumentProgressiveConfig(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentTimeRange(v *types.TimeRange, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("endTime") + ok.String(*v.EndTime) + } + + if v.StartTime != nil { + ok := object.Key("startTime") + ok.String(*v.StartTime) + } + + return nil +} + +func awsRestjson1_serializeDocumentTimeRangeList(v []types.TimeRange, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTimeRange(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTimeWindow(v *types.TimeWindow, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OpenHours != nil { + ok := object.Key("openHours") + if err := awsRestjson1_serializeDocumentOpenHours(v.OpenHours, ok); err != nil { + return err + } + } + + if v.RestrictedPeriods != nil { + ok := object.Key("restrictedPeriods") + if err := awsRestjson1_serializeDocumentRestrictedPeriods(v.RestrictedPeriods, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/connectcampaignsv2/snapshot/api_op_CreateCampaign.go.snap b/service/connectcampaignsv2/snapshot/api_op_CreateCampaign.go.snap new file mode 100644 index 00000000000..3e55792ac74 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_CreateCampaign.go.snap @@ -0,0 +1,41 @@ +CreateCampaign + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DeleteCampaign.go.snap b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaign.go.snap new file mode 100644 index 00000000000..7cff1050ddf --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaign.go.snap @@ -0,0 +1,41 @@ +DeleteCampaign + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignChannelSubtypeConfig.go.snap b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignChannelSubtypeConfig.go.snap new file mode 100644 index 00000000000..aaf5241c54d --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignChannelSubtypeConfig.go.snap @@ -0,0 +1,41 @@ +DeleteCampaignChannelSubtypeConfig + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationLimits.go.snap b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationLimits.go.snap new file mode 100644 index 00000000000..59c9f5da585 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationLimits.go.snap @@ -0,0 +1,41 @@ +DeleteCampaignCommunicationLimits + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationTime.go.snap b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationTime.go.snap new file mode 100644 index 00000000000..8167bb8418e --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DeleteCampaignCommunicationTime.go.snap @@ -0,0 +1,41 @@ +DeleteCampaignCommunicationTime + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceConfig.go.snap b/service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceConfig.go.snap new file mode 100644 index 00000000000..45c867aea00 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceConfig.go.snap @@ -0,0 +1,41 @@ +DeleteConnectInstanceConfig + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceIntegration.go.snap b/service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceIntegration.go.snap new file mode 100644 index 00000000000..f22e9de1b42 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DeleteConnectInstanceIntegration.go.snap @@ -0,0 +1,41 @@ +DeleteConnectInstanceIntegration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DeleteInstanceOnboardingJob.go.snap b/service/connectcampaignsv2/snapshot/api_op_DeleteInstanceOnboardingJob.go.snap new file mode 100644 index 00000000000..4262fe8e082 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DeleteInstanceOnboardingJob.go.snap @@ -0,0 +1,41 @@ +DeleteInstanceOnboardingJob + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_DescribeCampaign.go.snap b/service/connectcampaignsv2/snapshot/api_op_DescribeCampaign.go.snap new file mode 100644 index 00000000000..173b7549776 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_DescribeCampaign.go.snap @@ -0,0 +1,41 @@ +DescribeCampaign + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_GetCampaignState.go.snap b/service/connectcampaignsv2/snapshot/api_op_GetCampaignState.go.snap new file mode 100644 index 00000000000..5bd14f7834f --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_GetCampaignState.go.snap @@ -0,0 +1,41 @@ +GetCampaignState + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_GetCampaignStateBatch.go.snap b/service/connectcampaignsv2/snapshot/api_op_GetCampaignStateBatch.go.snap new file mode 100644 index 00000000000..0a2734f3c31 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_GetCampaignStateBatch.go.snap @@ -0,0 +1,41 @@ +GetCampaignStateBatch + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_GetConnectInstanceConfig.go.snap b/service/connectcampaignsv2/snapshot/api_op_GetConnectInstanceConfig.go.snap new file mode 100644 index 00000000000..89916b17d4f --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_GetConnectInstanceConfig.go.snap @@ -0,0 +1,41 @@ +GetConnectInstanceConfig + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_GetInstanceOnboardingJobStatus.go.snap b/service/connectcampaignsv2/snapshot/api_op_GetInstanceOnboardingJobStatus.go.snap new file mode 100644 index 00000000000..267e6078216 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_GetInstanceOnboardingJobStatus.go.snap @@ -0,0 +1,41 @@ +GetInstanceOnboardingJobStatus + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_ListCampaigns.go.snap b/service/connectcampaignsv2/snapshot/api_op_ListCampaigns.go.snap new file mode 100644 index 00000000000..5ed7bd3f7c7 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_ListCampaigns.go.snap @@ -0,0 +1,41 @@ +ListCampaigns + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_ListConnectInstanceIntegrations.go.snap b/service/connectcampaignsv2/snapshot/api_op_ListConnectInstanceIntegrations.go.snap new file mode 100644 index 00000000000..24dd425ae8f --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_ListConnectInstanceIntegrations.go.snap @@ -0,0 +1,41 @@ +ListConnectInstanceIntegrations + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_ListTagsForResource.go.snap b/service/connectcampaignsv2/snapshot/api_op_ListTagsForResource.go.snap new file mode 100644 index 00000000000..071d3ac4e96 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_ListTagsForResource.go.snap @@ -0,0 +1,41 @@ +ListTagsForResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_PauseCampaign.go.snap b/service/connectcampaignsv2/snapshot/api_op_PauseCampaign.go.snap new file mode 100644 index 00000000000..fb816bf7635 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_PauseCampaign.go.snap @@ -0,0 +1,41 @@ +PauseCampaign + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_PutConnectInstanceIntegration.go.snap b/service/connectcampaignsv2/snapshot/api_op_PutConnectInstanceIntegration.go.snap new file mode 100644 index 00000000000..115509b3865 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_PutConnectInstanceIntegration.go.snap @@ -0,0 +1,41 @@ +PutConnectInstanceIntegration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_PutOutboundRequestBatch.go.snap b/service/connectcampaignsv2/snapshot/api_op_PutOutboundRequestBatch.go.snap new file mode 100644 index 00000000000..ff225ebec3d --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_PutOutboundRequestBatch.go.snap @@ -0,0 +1,41 @@ +PutOutboundRequestBatch + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_ResumeCampaign.go.snap b/service/connectcampaignsv2/snapshot/api_op_ResumeCampaign.go.snap new file mode 100644 index 00000000000..80cf7a88614 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_ResumeCampaign.go.snap @@ -0,0 +1,41 @@ +ResumeCampaign + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_StartCampaign.go.snap b/service/connectcampaignsv2/snapshot/api_op_StartCampaign.go.snap new file mode 100644 index 00000000000..fd54ee7b726 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_StartCampaign.go.snap @@ -0,0 +1,41 @@ +StartCampaign + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_StartInstanceOnboardingJob.go.snap b/service/connectcampaignsv2/snapshot/api_op_StartInstanceOnboardingJob.go.snap new file mode 100644 index 00000000000..d5102b6591e --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_StartInstanceOnboardingJob.go.snap @@ -0,0 +1,41 @@ +StartInstanceOnboardingJob + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_StopCampaign.go.snap b/service/connectcampaignsv2/snapshot/api_op_StopCampaign.go.snap new file mode 100644 index 00000000000..a21404643d4 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_StopCampaign.go.snap @@ -0,0 +1,41 @@ +StopCampaign + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_TagResource.go.snap b/service/connectcampaignsv2/snapshot/api_op_TagResource.go.snap new file mode 100644 index 00000000000..ae6f8e0846c --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_TagResource.go.snap @@ -0,0 +1,41 @@ +TagResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UntagResource.go.snap b/service/connectcampaignsv2/snapshot/api_op_UntagResource.go.snap new file mode 100644 index 00000000000..c7bbe038d98 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UntagResource.go.snap @@ -0,0 +1,41 @@ +UntagResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignChannelSubtypeConfig.go.snap b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignChannelSubtypeConfig.go.snap new file mode 100644 index 00000000000..91ae8373059 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignChannelSubtypeConfig.go.snap @@ -0,0 +1,41 @@ +UpdateCampaignChannelSubtypeConfig + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationLimits.go.snap b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationLimits.go.snap new file mode 100644 index 00000000000..e5b31b4db3d --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationLimits.go.snap @@ -0,0 +1,41 @@ +UpdateCampaignCommunicationLimits + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationTime.go.snap b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationTime.go.snap new file mode 100644 index 00000000000..60867539fb2 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignCommunicationTime.go.snap @@ -0,0 +1,41 @@ +UpdateCampaignCommunicationTime + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignFlowAssociation.go.snap b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignFlowAssociation.go.snap new file mode 100644 index 00000000000..22adf7d730a --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignFlowAssociation.go.snap @@ -0,0 +1,41 @@ +UpdateCampaignFlowAssociation + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignName.go.snap b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignName.go.snap new file mode 100644 index 00000000000..127414bff6d --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignName.go.snap @@ -0,0 +1,41 @@ +UpdateCampaignName + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSchedule.go.snap b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSchedule.go.snap new file mode 100644 index 00000000000..8808712e7ae --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSchedule.go.snap @@ -0,0 +1,41 @@ +UpdateCampaignSchedule + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSource.go.snap b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSource.go.snap new file mode 100644 index 00000000000..d3ad2653422 --- /dev/null +++ b/service/connectcampaignsv2/snapshot/api_op_UpdateCampaignSource.go.snap @@ -0,0 +1,41 @@ +UpdateCampaignSource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/connectcampaignsv2/snapshot_test.go b/service/connectcampaignsv2/snapshot_test.go new file mode 100644 index 00000000000..67b38ad1f7a --- /dev/null +++ b/service/connectcampaignsv2/snapshot_test.go @@ -0,0 +1,830 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package connectcampaignsv2 + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_CreateCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteCampaignChannelSubtypeConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaignChannelSubtypeConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteCampaignChannelSubtypeConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteCampaignCommunicationLimits(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaignCommunicationLimits(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteCampaignCommunicationLimits") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteCampaignCommunicationTime(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaignCommunicationTime(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteCampaignCommunicationTime") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteConnectInstanceConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteConnectInstanceConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteConnectInstanceConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteConnectInstanceIntegration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteConnectInstanceIntegration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteConnectInstanceIntegration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteInstanceOnboardingJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteInstanceOnboardingJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteInstanceOnboardingJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DescribeCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetCampaignState(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCampaignState(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetCampaignState") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetCampaignStateBatch(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCampaignStateBatch(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetCampaignStateBatch") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetConnectInstanceConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetConnectInstanceConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetConnectInstanceConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetInstanceOnboardingJobStatus(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetInstanceOnboardingJobStatus(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetInstanceOnboardingJobStatus") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListCampaigns(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCampaigns(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListCampaigns") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListConnectInstanceIntegrations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConnectInstanceIntegrations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListConnectInstanceIntegrations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_PauseCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.PauseCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PauseCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_PutConnectInstanceIntegration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutConnectInstanceIntegration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutConnectInstanceIntegration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_PutOutboundRequestBatch(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutOutboundRequestBatch(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutOutboundRequestBatch") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ResumeCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.ResumeCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ResumeCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_StartCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_StartInstanceOnboardingJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartInstanceOnboardingJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartInstanceOnboardingJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_StopCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.StopCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StopCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateCampaignChannelSubtypeConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignChannelSubtypeConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCampaignChannelSubtypeConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateCampaignCommunicationLimits(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignCommunicationLimits(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCampaignCommunicationLimits") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateCampaignCommunicationTime(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignCommunicationTime(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCampaignCommunicationTime") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateCampaignFlowAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignFlowAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCampaignFlowAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateCampaignName(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignName(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCampaignName") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateCampaignSchedule(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignSchedule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCampaignSchedule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateCampaignSource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignSource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCampaignSource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_CreateCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteCampaignChannelSubtypeConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaignChannelSubtypeConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteCampaignChannelSubtypeConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteCampaignCommunicationLimits(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaignCommunicationLimits(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteCampaignCommunicationLimits") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteCampaignCommunicationTime(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCampaignCommunicationTime(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteCampaignCommunicationTime") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteConnectInstanceConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteConnectInstanceConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteConnectInstanceConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteConnectInstanceIntegration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteConnectInstanceIntegration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteConnectInstanceIntegration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteInstanceOnboardingJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteInstanceOnboardingJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteInstanceOnboardingJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DescribeCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetCampaignState(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCampaignState(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetCampaignState") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetCampaignStateBatch(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCampaignStateBatch(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetCampaignStateBatch") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetConnectInstanceConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetConnectInstanceConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetConnectInstanceConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetInstanceOnboardingJobStatus(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetInstanceOnboardingJobStatus(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetInstanceOnboardingJobStatus") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListCampaigns(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCampaigns(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListCampaigns") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListConnectInstanceIntegrations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConnectInstanceIntegrations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListConnectInstanceIntegrations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_PauseCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.PauseCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PauseCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_PutConnectInstanceIntegration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutConnectInstanceIntegration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutConnectInstanceIntegration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_PutOutboundRequestBatch(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutOutboundRequestBatch(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutOutboundRequestBatch") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ResumeCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.ResumeCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ResumeCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_StartCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_StartInstanceOnboardingJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartInstanceOnboardingJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartInstanceOnboardingJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_StopCampaign(t *testing.T) { + svc := New(Options{}) + _, err := svc.StopCampaign(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StopCampaign") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateCampaignChannelSubtypeConfig(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignChannelSubtypeConfig(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCampaignChannelSubtypeConfig") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateCampaignCommunicationLimits(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignCommunicationLimits(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCampaignCommunicationLimits") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateCampaignCommunicationTime(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignCommunicationTime(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCampaignCommunicationTime") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateCampaignFlowAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignFlowAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCampaignFlowAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateCampaignName(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignName(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCampaignName") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateCampaignSchedule(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignSchedule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCampaignSchedule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateCampaignSource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCampaignSource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCampaignSource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/connectcampaignsv2/types/enums.go b/service/connectcampaignsv2/types/enums.go new file mode 100644 index 00000000000..3716e6a455a --- /dev/null +++ b/service/connectcampaignsv2/types/enums.go @@ -0,0 +1,337 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type CampaignDeletionPolicy string + +// Enum values for CampaignDeletionPolicy +const ( + CampaignDeletionPolicyRetainAll CampaignDeletionPolicy = "RETAIN_ALL" + CampaignDeletionPolicyDeleteAll CampaignDeletionPolicy = "DELETE_ALL" +) + +// Values returns all known values for CampaignDeletionPolicy. 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 (CampaignDeletionPolicy) Values() []CampaignDeletionPolicy { + return []CampaignDeletionPolicy{ + "RETAIN_ALL", + "DELETE_ALL", + } +} + +type CampaignState string + +// Enum values for CampaignState +const ( + // Campaign is in initialized state + CampaignStateInitialized CampaignState = "Initialized" + // Campaign is in running state + CampaignStateRunning CampaignState = "Running" + // Campaign is in paused state + CampaignStatePaused CampaignState = "Paused" + // Campaign is in stopped state + CampaignStateStopped CampaignState = "Stopped" + // Campaign is in failed state + CampaignStateFailed CampaignState = "Failed" + // Campaign is in completed state + CampaignStateCompleted CampaignState = "Completed" +) + +// Values returns all known values for CampaignState. 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 (CampaignState) Values() []CampaignState { + return []CampaignState{ + "Initialized", + "Running", + "Paused", + "Stopped", + "Failed", + "Completed", + } +} + +type ChannelSubtype string + +// Enum values for ChannelSubtype +const ( + ChannelSubtypeTelephony ChannelSubtype = "TELEPHONY" + ChannelSubtypeSms ChannelSubtype = "SMS" + ChannelSubtypeEmail ChannelSubtype = "EMAIL" +) + +// Values returns all known values for ChannelSubtype. 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 (ChannelSubtype) Values() []ChannelSubtype { + return []ChannelSubtype{ + "TELEPHONY", + "SMS", + "EMAIL", + } +} + +type CommunicationLimitsConfigType string + +// Enum values for CommunicationLimitsConfigType +const ( + CommunicationLimitsConfigTypeAllChannelSubtypes CommunicationLimitsConfigType = "ALL_CHANNEL_SUBTYPES" +) + +// Values returns all known values for CommunicationLimitsConfigType. 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 (CommunicationLimitsConfigType) Values() []CommunicationLimitsConfigType { + return []CommunicationLimitsConfigType{ + "ALL_CHANNEL_SUBTYPES", + } +} + +type CommunicationLimitTimeUnit string + +// Enum values for CommunicationLimitTimeUnit +const ( + CommunicationLimitTimeUnitDay CommunicationLimitTimeUnit = "DAY" +) + +// Values returns all known values for CommunicationLimitTimeUnit. 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 (CommunicationLimitTimeUnit) Values() []CommunicationLimitTimeUnit { + return []CommunicationLimitTimeUnit{ + "DAY", + } +} + +type CommunicationTimeConfigType string + +// Enum values for CommunicationTimeConfigType +const ( + CommunicationTimeConfigTypeTelephony CommunicationTimeConfigType = "TELEPHONY" + CommunicationTimeConfigTypeSms CommunicationTimeConfigType = "SMS" + CommunicationTimeConfigTypeEmail CommunicationTimeConfigType = "EMAIL" +) + +// Values returns all known values for CommunicationTimeConfigType. 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 (CommunicationTimeConfigType) Values() []CommunicationTimeConfigType { + return []CommunicationTimeConfigType{ + "TELEPHONY", + "SMS", + "EMAIL", + } +} + +type DayOfWeek string + +// Enum values for DayOfWeek +const ( + DayOfWeekMonday DayOfWeek = "MONDAY" + DayOfWeekTuesday DayOfWeek = "TUESDAY" + DayOfWeekWednesday DayOfWeek = "WEDNESDAY" + DayOfWeekThursday DayOfWeek = "THURSDAY" + DayOfWeekFriday DayOfWeek = "FRIDAY" + DayOfWeekSaturday DayOfWeek = "SATURDAY" + DayOfWeekSunday DayOfWeek = "SUNDAY" +) + +// Values returns all known values for DayOfWeek. 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 (DayOfWeek) Values() []DayOfWeek { + return []DayOfWeek{ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY", + } +} + +type EncryptionType string + +// Enum values for EncryptionType +const ( + EncryptionTypeKms EncryptionType = "KMS" +) + +// Values returns all known values for EncryptionType. 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 (EncryptionType) Values() []EncryptionType { + return []EncryptionType{ + "KMS", + } +} + +type EventType string + +// Enum values for EventType +const ( + EventTypeCampaignEmail EventType = "Campaign-Email" + EventTypeCampaignSms EventType = "Campaign-SMS" + EventTypeCampaignTelephony EventType = "Campaign-Telephony" + EventTypeCampaignOrchestration EventType = "Campaign-Orchestration" +) + +// 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{ + "Campaign-Email", + "Campaign-SMS", + "Campaign-Telephony", + "Campaign-Orchestration", + } +} + +type FailureCode string + +// Enum values for FailureCode +const ( + // The request failed to satisfy the constraints specified by the service + FailureCodeInvalidInput FailureCode = "InvalidInput" + // The request was throttled due to excessive usage + FailureCodeRequestThrottled FailureCode = "RequestThrottled" + // Unexpected error during processing of request + FailureCodeUnknownError FailureCode = "UnknownError" + // Request throttled due to large number of pending dial requests + FailureCodeBufferLimitExceeded FailureCode = "BufferLimitExceeded" +) + +// Values returns all known values for FailureCode. 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 (FailureCode) Values() []FailureCode { + return []FailureCode{ + "InvalidInput", + "RequestThrottled", + "UnknownError", + "BufferLimitExceeded", + } +} + +type GetCampaignStateBatchFailureCode string + +// Enum values for GetCampaignStateBatchFailureCode +const ( + // The specified resource was not found + GetCampaignStateBatchFailureCodeResourceNotFound GetCampaignStateBatchFailureCode = "ResourceNotFound" + // Unexpected error during processing of request + GetCampaignStateBatchFailureCodeUnknownError GetCampaignStateBatchFailureCode = "UnknownError" +) + +// Values returns all known values for GetCampaignStateBatchFailureCode. 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 (GetCampaignStateBatchFailureCode) Values() []GetCampaignStateBatchFailureCode { + return []GetCampaignStateBatchFailureCode{ + "ResourceNotFound", + "UnknownError", + } +} + +type InstanceIdFilterOperator string + +// Enum values for InstanceIdFilterOperator +const ( + // Equals operator + InstanceIdFilterOperatorEq InstanceIdFilterOperator = "Eq" +) + +// Values returns all known values for InstanceIdFilterOperator. 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 (InstanceIdFilterOperator) Values() []InstanceIdFilterOperator { + return []InstanceIdFilterOperator{ + "Eq", + } +} + +type InstanceOnboardingJobFailureCode string + +// Enum values for InstanceOnboardingJobFailureCode +const ( + InstanceOnboardingJobFailureCodeEventBridgeAccessDenied InstanceOnboardingJobFailureCode = "EVENT_BRIDGE_ACCESS_DENIED" + InstanceOnboardingJobFailureCodeEventBridgeManagedRuleLimitExceeded InstanceOnboardingJobFailureCode = "EVENT_BRIDGE_MANAGED_RULE_LIMIT_EXCEEDED" + InstanceOnboardingJobFailureCodeIamAccessDenied InstanceOnboardingJobFailureCode = "IAM_ACCESS_DENIED" + InstanceOnboardingJobFailureCodeKmsAccessDenied InstanceOnboardingJobFailureCode = "KMS_ACCESS_DENIED" + InstanceOnboardingJobFailureCodeKmsKeyNotFound InstanceOnboardingJobFailureCode = "KMS_KEY_NOT_FOUND" + InstanceOnboardingJobFailureCodeInternalFailure InstanceOnboardingJobFailureCode = "INTERNAL_FAILURE" +) + +// Values returns all known values for InstanceOnboardingJobFailureCode. 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 (InstanceOnboardingJobFailureCode) Values() []InstanceOnboardingJobFailureCode { + return []InstanceOnboardingJobFailureCode{ + "EVENT_BRIDGE_ACCESS_DENIED", + "EVENT_BRIDGE_MANAGED_RULE_LIMIT_EXCEEDED", + "IAM_ACCESS_DENIED", + "KMS_ACCESS_DENIED", + "KMS_KEY_NOT_FOUND", + "INTERNAL_FAILURE", + } +} + +type InstanceOnboardingJobStatusCode string + +// Enum values for InstanceOnboardingJobStatusCode +const ( + InstanceOnboardingJobStatusCodeInProgress InstanceOnboardingJobStatusCode = "IN_PROGRESS" + InstanceOnboardingJobStatusCodeSucceeded InstanceOnboardingJobStatusCode = "SUCCEEDED" + InstanceOnboardingJobStatusCodeFailed InstanceOnboardingJobStatusCode = "FAILED" +) + +// Values returns all known values for InstanceOnboardingJobStatusCode. 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 (InstanceOnboardingJobStatusCode) Values() []InstanceOnboardingJobStatusCode { + return []InstanceOnboardingJobStatusCode{ + "IN_PROGRESS", + "SUCCEEDED", + "FAILED", + } +} + +type LocalTimeZoneDetectionType string + +// Enum values for LocalTimeZoneDetectionType +const ( + LocalTimeZoneDetectionTypeZipCode LocalTimeZoneDetectionType = "ZIP_CODE" + LocalTimeZoneDetectionTypeAreaCode LocalTimeZoneDetectionType = "AREA_CODE" +) + +// Values returns all known values for LocalTimeZoneDetectionType. 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 (LocalTimeZoneDetectionType) Values() []LocalTimeZoneDetectionType { + return []LocalTimeZoneDetectionType{ + "ZIP_CODE", + "AREA_CODE", + } +} diff --git a/service/connectcampaignsv2/types/errors.go b/service/connectcampaignsv2/types/errors.go new file mode 100644 index 00000000000..b3d165bd4b9 --- /dev/null +++ b/service/connectcampaignsv2/types/errors.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request could not be processed because of conflict in the current state of +// the resource. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request processing failed because of an error or failure with the service. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request could not be processed because of conflict in the current state of +// the campaign. +type InvalidCampaignStateException struct { + Message *string + + ErrorCodeOverride *string + + State CampaignState + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *InvalidCampaignStateException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidCampaignStateException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidCampaignStateException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidCampaignStateException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidCampaignStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request could not be processed because of conflict in the current state. +type InvalidStateException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *InvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidStateException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidStateException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidStateException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified resource was not found. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *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 } + +// Request would cause a service quota to be exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + XAmzErrorType *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/connectcampaignsv2/types/types.go b/service/connectcampaignsv2/types/types.go new file mode 100644 index 00000000000..6d21a758e6c --- /dev/null +++ b/service/connectcampaignsv2/types/types.go @@ -0,0 +1,1004 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Agentless config +type AgentlessConfig struct { + noSmithyDocumentSerde +} + +// Answering Machine Detection config +type AnswerMachineDetectionConfig struct { + + // Enable or disable answering machine detection + // + // This member is required. + EnableAnswerMachineDetection *bool + + // Enable or disable await answer machine prompt + AwaitAnswerMachinePrompt *bool + + noSmithyDocumentSerde +} + +// An Amazon Connect campaign. +type Campaign struct { + + // The resource name of an Amazon Connect campaign. + // + // This member is required. + Arn *string + + // Campaign Channel Subtype config + // + // This member is required. + ChannelSubtypeConfig *ChannelSubtypeConfig + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + // The name of an Amazon Connect Campaign name. + // + // This member is required. + Name *string + + // Communication limits config + CommunicationLimitsOverride *CommunicationLimitsConfig + + // Campaign communication time config + CommunicationTimeConfig *CommunicationTimeConfig + + // Amazon Resource Names(ARN) + ConnectCampaignFlowArn *string + + // Campaign schedule + Schedule *Schedule + + // Source of the campaign + Source Source + + // Tag map with key and value. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Filter model by type +type CampaignFilters struct { + + // Connect instance identifier filter + InstanceIdFilter *InstanceIdFilter + + noSmithyDocumentSerde +} + +// An Amazon Connect campaign summary. +type CampaignSummary struct { + + // The resource name of an Amazon Connect campaign. + // + // This member is required. + Arn *string + + // Channel subtype list + // + // This member is required. + ChannelSubtypes []ChannelSubtype + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Identifier representing a Campaign + // + // This member is required. + Id *string + + // The name of an Amazon Connect Campaign name. + // + // This member is required. + Name *string + + // Amazon Resource Names(ARN) + ConnectCampaignFlowArn *string + + // Campaign schedule + Schedule *Schedule + + noSmithyDocumentSerde +} + +// Campaign Channel Subtype config +type ChannelSubtypeConfig struct { + + // Email Channel Subtype config + Email *EmailChannelSubtypeConfig + + // SMS Channel Subtype config + Sms *SmsChannelSubtypeConfig + + // Telephony Channel Subtype config + Telephony *TelephonyChannelSubtypeConfig + + noSmithyDocumentSerde +} + +// ChannelSubtypeParameters for an outbound request +// +// The following types satisfy this interface: +// +// ChannelSubtypeParametersMemberEmail +// ChannelSubtypeParametersMemberSms +// ChannelSubtypeParametersMemberTelephony +type ChannelSubtypeParameters interface { + isChannelSubtypeParameters() +} + +// Parameters for the Email Channel Subtype +type ChannelSubtypeParametersMemberEmail struct { + Value EmailChannelSubtypeParameters + + noSmithyDocumentSerde +} + +func (*ChannelSubtypeParametersMemberEmail) isChannelSubtypeParameters() {} + +// Parameters for the SMS Channel Subtype +type ChannelSubtypeParametersMemberSms struct { + Value SmsChannelSubtypeParameters + + noSmithyDocumentSerde +} + +func (*ChannelSubtypeParametersMemberSms) isChannelSubtypeParameters() {} + +// Parameters for the Telephony Channel Subtype +type ChannelSubtypeParametersMemberTelephony struct { + Value TelephonyChannelSubtypeParameters + + noSmithyDocumentSerde +} + +func (*ChannelSubtypeParametersMemberTelephony) isChannelSubtypeParameters() {} + +// Communication Limit +type CommunicationLimit struct { + + // The number of days to consider with regards to this limit. + // + // This member is required. + Frequency *int32 + + // Maximum number of contacts allowed for a given target within the given + // frequency. + // + // This member is required. + MaxCountPerRecipient *int32 + + // The communication limit time unit. + // + // This member is required. + Unit CommunicationLimitTimeUnit + + noSmithyDocumentSerde +} + +// Communication limits +// +// The following types satisfy this interface: +// +// CommunicationLimitsMemberCommunicationLimitsList +type CommunicationLimits interface { + isCommunicationLimits() +} + +// List of communication limit +type CommunicationLimitsMemberCommunicationLimitsList struct { + Value []CommunicationLimit + + noSmithyDocumentSerde +} + +func (*CommunicationLimitsMemberCommunicationLimitsList) isCommunicationLimits() {} + +// Communication limits config +type CommunicationLimitsConfig struct { + + // Communication limits + AllChannelSubtypes CommunicationLimits + + noSmithyDocumentSerde +} + +// Campaign communication time config +type CommunicationTimeConfig struct { + + // Local time zone config + // + // This member is required. + LocalTimeZoneConfig *LocalTimeZoneConfig + + // Time window config + Email *TimeWindow + + // Time window config + Sms *TimeWindow + + // Time window config + Telephony *TimeWindow + + noSmithyDocumentSerde +} + +// Customer Profiles integration config +type CustomerProfilesIntegrationConfig struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + DomainArn *string + + // Object type names map. + // + // This member is required. + ObjectTypeNames map[string]string + + noSmithyDocumentSerde +} + +// Customer Profiles integration identifier +type CustomerProfilesIntegrationIdentifier struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + DomainArn *string + + noSmithyDocumentSerde +} + +// Customer Profiles integration summary +type CustomerProfilesIntegrationSummary struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + DomainArn *string + + // Object type names map. + // + // This member is required. + ObjectTypeNames map[string]string + + noSmithyDocumentSerde +} + +// Email Channel Subtype config +type EmailChannelSubtypeConfig struct { + + // Default Email Outbound config + // + // This member is required. + DefaultOutboundConfig *EmailOutboundConfig + + // Email Outbound Mode + // + // This member is required. + OutboundMode EmailOutboundMode + + // Allocates outbound capacity for the specific channel subtype of this campaign + // between multiple active campaigns + Capacity *float64 + + noSmithyDocumentSerde +} + +// Parameters for the Email Channel Subtype +type EmailChannelSubtypeParameters struct { + + // Source/Destination Email address used for Email messages + // + // This member is required. + DestinationEmailAddress *string + + // A custom key-value pair using an attribute map. The attributes are standard + // Amazon Connect attributes, and can be accessed in contact flows just like any + // other contact attributes. + // + // This member is required. + TemplateParameters map[string]string + + // Source/Destination Email address used for Email messages + ConnectSourceEmailAddress *string + + // Amazon Resource Names(ARN) + TemplateArn *string + + noSmithyDocumentSerde +} + +// Default Email Outbound config +type EmailOutboundConfig struct { + + // Source/Destination Email address used for Email messages + // + // This member is required. + ConnectSourceEmailAddress *string + + // Amazon Resource Names(ARN) + // + // This member is required. + WisdomTemplateArn *string + + // Display name for Email Address + SourceEmailAddressDisplayName *string + + noSmithyDocumentSerde +} + +// Email Outbound Mode +// +// The following types satisfy this interface: +// +// EmailOutboundModeMemberAgentless +type EmailOutboundMode interface { + isEmailOutboundMode() +} + +// Agentless config +type EmailOutboundModeMemberAgentless struct { + Value AgentlessConfig + + noSmithyDocumentSerde +} + +func (*EmailOutboundModeMemberAgentless) isEmailOutboundMode() {} + +// Encryption config for Connect Instance. Note that sensitive data will always be +// encrypted. If disabled, service will perform encryption with its own key. If +// enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is +// only type supported +type EncryptionConfig struct { + + // Boolean to indicate if custom encryption has been enabled. + // + // This member is required. + Enabled bool + + // Server-side encryption type. + EncryptionType EncryptionType + + // KMS key id/arn for encryption config. + KeyArn *string + + noSmithyDocumentSerde +} + +// Failed response of campaign state +type FailedCampaignStateResponse struct { + + // Identifier representing a Campaign + CampaignId *string + + // A predefined code indicating the error that caused the failure in getting state + // of campaigns + FailureCode GetCampaignStateBatchFailureCode + + noSmithyDocumentSerde +} + +// A failed request identified by the unique client token. +type FailedRequest struct { + + // Client provided parameter used for idempotency. Its value must be unique for + // each request. + ClientToken *string + + // A predefined code indicating the error that caused the failure. + FailureCode FailureCode + + // Identifier representing a Dial request + Id *string + + noSmithyDocumentSerde +} + +// Instance config object +type InstanceConfig struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Encryption config for Connect Instance. Note that sensitive data will always be + // encrypted. If disabled, service will perform encryption with its own key. If + // enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is + // only type supported + // + // This member is required. + EncryptionConfig *EncryptionConfig + + // Service linked role arn + // + // This member is required. + ServiceLinkedRoleArn *string + + noSmithyDocumentSerde +} + +// Connect instance identifier filter +type InstanceIdFilter struct { + + // Operators for Connect instance identifier filter + // + // This member is required. + Operator InstanceIdFilterOperator + + // Amazon Connect Instance Id + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Instance onboarding job status object +type InstanceOnboardingJobStatus struct { + + // Amazon Connect Instance Id + // + // This member is required. + ConnectInstanceId *string + + // Enumeration of the possible states for instance onboarding job + // + // This member is required. + Status InstanceOnboardingJobStatusCode + + // Enumeration of the possible failure codes for instance onboarding job + FailureCode InstanceOnboardingJobFailureCode + + noSmithyDocumentSerde +} + +// Integration config for Connect Instance +// +// The following types satisfy this interface: +// +// IntegrationConfigMemberCustomerProfiles +// IntegrationConfigMemberQConnect +type IntegrationConfig interface { + isIntegrationConfig() +} + +// Customer Profiles integration config +type IntegrationConfigMemberCustomerProfiles struct { + Value CustomerProfilesIntegrationConfig + + noSmithyDocumentSerde +} + +func (*IntegrationConfigMemberCustomerProfiles) isIntegrationConfig() {} + +// Q Connect integration config +type IntegrationConfigMemberQConnect struct { + Value QConnectIntegrationConfig + + noSmithyDocumentSerde +} + +func (*IntegrationConfigMemberQConnect) isIntegrationConfig() {} + +// Integration identifier for Connect instance +// +// The following types satisfy this interface: +// +// IntegrationIdentifierMemberCustomerProfiles +// IntegrationIdentifierMemberQConnect +type IntegrationIdentifier interface { + isIntegrationIdentifier() +} + +// Customer Profiles integration identifier +type IntegrationIdentifierMemberCustomerProfiles struct { + Value CustomerProfilesIntegrationIdentifier + + noSmithyDocumentSerde +} + +func (*IntegrationIdentifierMemberCustomerProfiles) isIntegrationIdentifier() {} + +// Q Connect integration identifier +type IntegrationIdentifierMemberQConnect struct { + Value QConnectIntegrationIdentifier + + noSmithyDocumentSerde +} + +func (*IntegrationIdentifierMemberQConnect) isIntegrationIdentifier() {} + +// Integration summary for Connect instance. +// +// The following types satisfy this interface: +// +// IntegrationSummaryMemberCustomerProfiles +// IntegrationSummaryMemberQConnect +type IntegrationSummary interface { + isIntegrationSummary() +} + +// Customer Profiles integration summary +type IntegrationSummaryMemberCustomerProfiles struct { + Value CustomerProfilesIntegrationSummary + + noSmithyDocumentSerde +} + +func (*IntegrationSummaryMemberCustomerProfiles) isIntegrationSummary() {} + +// Q Connect integration summary +type IntegrationSummaryMemberQConnect struct { + Value QConnectIntegrationSummary + + noSmithyDocumentSerde +} + +func (*IntegrationSummaryMemberQConnect) isIntegrationSummary() {} + +// Local time zone config +type LocalTimeZoneConfig struct { + + // Time Zone Id in the IANA format + DefaultTimeZone *string + + // Local TimeZone Detection method list + LocalTimeZoneDetection []LocalTimeZoneDetectionType + + noSmithyDocumentSerde +} + +// Open Hours config +// +// The following types satisfy this interface: +// +// OpenHoursMemberDailyHours +type OpenHours interface { + isOpenHours() +} + +// Daily Hours map +type OpenHoursMemberDailyHours struct { + Value map[string][]TimeRange + + noSmithyDocumentSerde +} + +func (*OpenHoursMemberDailyHours) isOpenHours() {} + +// An outbound request for a campaign. +type OutboundRequest struct { + + // ChannelSubtypeParameters for an outbound request + // + // This member is required. + ChannelSubtypeParameters ChannelSubtypeParameters + + // Client provided parameter used for idempotency. Its value must be unique for + // each request. + // + // This member is required. + ClientToken *string + + // Timestamp with no UTC offset or timezone + // + // This member is required. + ExpirationTime *time.Time + + noSmithyDocumentSerde +} + +// Predictive config +type PredictiveConfig struct { + + // The bandwidth allocation of a queue resource. + // + // This member is required. + BandwidthAllocation *float64 + + noSmithyDocumentSerde +} + +// Progressive config +type ProgressiveConfig struct { + + // The bandwidth allocation of a queue resource. + // + // This member is required. + BandwidthAllocation *float64 + + noSmithyDocumentSerde +} + +// Q Connect integration config +type QConnectIntegrationConfig struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + KnowledgeBaseArn *string + + noSmithyDocumentSerde +} + +// Q Connect integration identifier +type QConnectIntegrationIdentifier struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + KnowledgeBaseArn *string + + noSmithyDocumentSerde +} + +// Q Connect integration summary +type QConnectIntegrationSummary struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + KnowledgeBaseArn *string + + noSmithyDocumentSerde +} + +// Restricted period +type RestrictedPeriod struct { + + // Date in ISO 8601 format, e.g. 2024-01-01 + // + // This member is required. + EndDate *string + + // Date in ISO 8601 format, e.g. 2024-01-01 + // + // This member is required. + StartDate *string + + // The name of a restricted period. + Name *string + + noSmithyDocumentSerde +} + +// Restricted period config +// +// The following types satisfy this interface: +// +// RestrictedPeriodsMemberRestrictedPeriodList +type RestrictedPeriods interface { + isRestrictedPeriods() +} + +// List of restricted period +type RestrictedPeriodsMemberRestrictedPeriodList struct { + Value []RestrictedPeriod + + noSmithyDocumentSerde +} + +func (*RestrictedPeriodsMemberRestrictedPeriodList) isRestrictedPeriods() {} + +// Campaign schedule +type Schedule struct { + + // Timestamp with no UTC offset or timezone + // + // This member is required. + EndTime *time.Time + + // Timestamp with no UTC offset or timezone + // + // This member is required. + StartTime *time.Time + + // Time duration in ISO 8601 format + RefreshFrequency *string + + noSmithyDocumentSerde +} + +// SMS Channel Subtype config +type SmsChannelSubtypeConfig struct { + + // Default SMS Outbound config + // + // This member is required. + DefaultOutboundConfig *SmsOutboundConfig + + // SMS Outbound Mode + // + // This member is required. + OutboundMode SmsOutboundMode + + // Allocates outbound capacity for the specific channel subtype of this campaign + // between multiple active campaigns + Capacity *float64 + + noSmithyDocumentSerde +} + +// Parameters for the SMS Channel Subtype +type SmsChannelSubtypeParameters struct { + + // The phone number of the customer, in E.164 format. + // + // This member is required. + DestinationPhoneNumber *string + + // A custom key-value pair using an attribute map. The attributes are standard + // Amazon Connect attributes, and can be accessed in contact flows just like any + // other contact attributes. + // + // This member is required. + TemplateParameters map[string]string + + // Amazon Resource Names(ARN) + ConnectSourcePhoneNumberArn *string + + // Amazon Resource Names(ARN) + TemplateArn *string + + noSmithyDocumentSerde +} + +// Default SMS Outbound config +type SmsOutboundConfig struct { + + // Amazon Resource Names(ARN) + // + // This member is required. + ConnectSourcePhoneNumberArn *string + + // Amazon Resource Names(ARN) + // + // This member is required. + WisdomTemplateArn *string + + noSmithyDocumentSerde +} + +// SMS Outbound Mode +// +// The following types satisfy this interface: +// +// SmsOutboundModeMemberAgentless +type SmsOutboundMode interface { + isSmsOutboundMode() +} + +// Agentless config +type SmsOutboundModeMemberAgentless struct { + Value AgentlessConfig + + noSmithyDocumentSerde +} + +func (*SmsOutboundModeMemberAgentless) isSmsOutboundMode() {} + +// Source of the campaign +// +// The following types satisfy this interface: +// +// SourceMemberCustomerProfilesSegmentArn +type Source interface { + isSource() +} + +// Amazon Resource Names(ARN) +type SourceMemberCustomerProfilesSegmentArn struct { + Value string + + noSmithyDocumentSerde +} + +func (*SourceMemberCustomerProfilesSegmentArn) isSource() {} + +// Successful response of campaign state +type SuccessfulCampaignStateResponse struct { + + // Identifier representing a Campaign + CampaignId *string + + // State of a campaign + State CampaignState + + noSmithyDocumentSerde +} + +// A successful request identified by the unique client token. +type SuccessfulRequest struct { + + // Client provided parameter used for idempotency. Its value must be unique for + // each request. + ClientToken *string + + // Identifier representing a Dial request + Id *string + + noSmithyDocumentSerde +} + +// Telephony Channel Subtype config +type TelephonyChannelSubtypeConfig struct { + + // Default Telephony Outbound config + // + // This member is required. + DefaultOutboundConfig *TelephonyOutboundConfig + + // Telephony Outbound Mode + // + // This member is required. + OutboundMode TelephonyOutboundMode + + // Allocates outbound capacity for the specific channel subtype of this campaign + // between multiple active campaigns + Capacity *float64 + + // The queue for the call. If you specify a queue, the phone displayed for caller + // ID is the phone number specified in the queue. If you do not specify a queue, + // the queue defined in the contact flow is used. If you do not specify a queue, + // you must specify a source phone number. + ConnectQueueId *string + + noSmithyDocumentSerde +} + +// Parameters for the Telephony Channel Subtype +type TelephonyChannelSubtypeParameters struct { + + // A custom key-value pair using an attribute map. The attributes are standard + // Amazon Connect attributes, and can be accessed in contact flows just like any + // other contact attributes. + // + // This member is required. + Attributes map[string]string + + // The phone number of the customer, in E.164 format. + // + // This member is required. + DestinationPhoneNumber *string + + // Answering Machine Detection config + AnswerMachineDetectionConfig *AnswerMachineDetectionConfig + + // The phone number associated with the Amazon Connect instance, in E.164 format. + // If you do not specify a source phone number, you must specify a queue. + ConnectSourcePhoneNumber *string + + noSmithyDocumentSerde +} + +// Default Telephony Outbound config +type TelephonyOutboundConfig struct { + + // The identifier of the contact flow for the outbound call. + // + // This member is required. + ConnectContactFlowId *string + + // Answering Machine Detection config + AnswerMachineDetectionConfig *AnswerMachineDetectionConfig + + // The phone number associated with the Amazon Connect instance, in E.164 format. + // If you do not specify a source phone number, you must specify a queue. + ConnectSourcePhoneNumber *string + + noSmithyDocumentSerde +} + +// Telephony Outbound Mode +// +// The following types satisfy this interface: +// +// TelephonyOutboundModeMemberAgentless +// TelephonyOutboundModeMemberPredictive +// TelephonyOutboundModeMemberProgressive +type TelephonyOutboundMode interface { + isTelephonyOutboundMode() +} + +// Agentless config +type TelephonyOutboundModeMemberAgentless struct { + Value AgentlessConfig + + noSmithyDocumentSerde +} + +func (*TelephonyOutboundModeMemberAgentless) isTelephonyOutboundMode() {} + +// Predictive config +type TelephonyOutboundModeMemberPredictive struct { + Value PredictiveConfig + + noSmithyDocumentSerde +} + +func (*TelephonyOutboundModeMemberPredictive) isTelephonyOutboundMode() {} + +// Progressive config +type TelephonyOutboundModeMemberProgressive struct { + Value ProgressiveConfig + + noSmithyDocumentSerde +} + +func (*TelephonyOutboundModeMemberProgressive) isTelephonyOutboundMode() {} + +// Time range in 24 hour format +type TimeRange struct { + + // Time in ISO 8601 format, e.g. T23:11 + // + // This member is required. + EndTime *string + + // Time in ISO 8601 format, e.g. T23:11 + // + // This member is required. + StartTime *string + + noSmithyDocumentSerde +} + +// Time window config +type TimeWindow struct { + + // Open Hours config + // + // This member is required. + OpenHours OpenHours + + // Restricted period config + RestrictedPeriods RestrictedPeriods + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isChannelSubtypeParameters() {} +func (*UnknownUnionMember) isCommunicationLimits() {} +func (*UnknownUnionMember) isEmailOutboundMode() {} +func (*UnknownUnionMember) isIntegrationConfig() {} +func (*UnknownUnionMember) isIntegrationIdentifier() {} +func (*UnknownUnionMember) isIntegrationSummary() {} +func (*UnknownUnionMember) isOpenHours() {} +func (*UnknownUnionMember) isRestrictedPeriods() {} +func (*UnknownUnionMember) isSmsOutboundMode() {} +func (*UnknownUnionMember) isSource() {} +func (*UnknownUnionMember) isTelephonyOutboundMode() {} diff --git a/service/connectcampaignsv2/types/types_exported_test.go b/service/connectcampaignsv2/types/types_exported_test.go new file mode 100644 index 00000000000..c0a0c439944 --- /dev/null +++ b/service/connectcampaignsv2/types/types_exported_test.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" +) + +func ExampleChannelSubtypeParameters_outputUsage() { + var union types.ChannelSubtypeParameters + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ChannelSubtypeParametersMemberEmail: + _ = v.Value // Value is types.EmailChannelSubtypeParameters + + case *types.ChannelSubtypeParametersMemberSms: + _ = v.Value // Value is types.SmsChannelSubtypeParameters + + case *types.ChannelSubtypeParametersMemberTelephony: + _ = v.Value // Value is types.TelephonyChannelSubtypeParameters + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.TelephonyChannelSubtypeParameters +var _ *types.EmailChannelSubtypeParameters +var _ *types.SmsChannelSubtypeParameters + +func ExampleCommunicationLimits_outputUsage() { + var union types.CommunicationLimits + // type switches can be used to check the union value + switch v := union.(type) { + case *types.CommunicationLimitsMemberCommunicationLimitsList: + _ = v.Value // Value is []types.CommunicationLimit + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ []types.CommunicationLimit + +func ExampleEmailOutboundMode_outputUsage() { + var union types.EmailOutboundMode + // type switches can be used to check the union value + switch v := union.(type) { + case *types.EmailOutboundModeMemberAgentless: + _ = v.Value // Value is types.AgentlessConfig + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.AgentlessConfig + +func ExampleIntegrationConfig_outputUsage() { + var union types.IntegrationConfig + // type switches can be used to check the union value + switch v := union.(type) { + case *types.IntegrationConfigMemberCustomerProfiles: + _ = v.Value // Value is types.CustomerProfilesIntegrationConfig + + case *types.IntegrationConfigMemberQConnect: + _ = v.Value // Value is types.QConnectIntegrationConfig + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.CustomerProfilesIntegrationConfig +var _ *types.QConnectIntegrationConfig + +func ExampleIntegrationIdentifier_outputUsage() { + var union types.IntegrationIdentifier + // type switches can be used to check the union value + switch v := union.(type) { + case *types.IntegrationIdentifierMemberCustomerProfiles: + _ = v.Value // Value is types.CustomerProfilesIntegrationIdentifier + + case *types.IntegrationIdentifierMemberQConnect: + _ = v.Value // Value is types.QConnectIntegrationIdentifier + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.CustomerProfilesIntegrationIdentifier +var _ *types.QConnectIntegrationIdentifier + +func ExampleIntegrationSummary_outputUsage() { + var union types.IntegrationSummary + // type switches can be used to check the union value + switch v := union.(type) { + case *types.IntegrationSummaryMemberCustomerProfiles: + _ = v.Value // Value is types.CustomerProfilesIntegrationSummary + + case *types.IntegrationSummaryMemberQConnect: + _ = v.Value // Value is types.QConnectIntegrationSummary + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.CustomerProfilesIntegrationSummary +var _ *types.QConnectIntegrationSummary + +func ExampleOpenHours_outputUsage() { + var union types.OpenHours + // type switches can be used to check the union value + switch v := union.(type) { + case *types.OpenHoursMemberDailyHours: + _ = v.Value // Value is map[string][]types.TimeRange + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ map[string][]types.TimeRange + +func ExampleRestrictedPeriods_outputUsage() { + var union types.RestrictedPeriods + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RestrictedPeriodsMemberRestrictedPeriodList: + _ = v.Value // Value is []types.RestrictedPeriod + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ []types.RestrictedPeriod + +func ExampleSmsOutboundMode_outputUsage() { + var union types.SmsOutboundMode + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SmsOutboundModeMemberAgentless: + _ = v.Value // Value is types.AgentlessConfig + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.AgentlessConfig + +func ExampleSource_outputUsage() { + var union types.Source + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SourceMemberCustomerProfilesSegmentArn: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string + +func ExampleTelephonyOutboundMode_outputUsage() { + var union types.TelephonyOutboundMode + // type switches can be used to check the union value + switch v := union.(type) { + case *types.TelephonyOutboundModeMemberAgentless: + _ = v.Value // Value is types.AgentlessConfig + + case *types.TelephonyOutboundModeMemberPredictive: + _ = v.Value // Value is types.PredictiveConfig + + case *types.TelephonyOutboundModeMemberProgressive: + _ = v.Value // Value is types.ProgressiveConfig + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.PredictiveConfig +var _ *types.AgentlessConfig +var _ *types.ProgressiveConfig diff --git a/service/connectcampaignsv2/validators.go b/service/connectcampaignsv2/validators.go new file mode 100644 index 00000000000..6d02dca1b44 --- /dev/null +++ b/service/connectcampaignsv2/validators.go @@ -0,0 +1,2147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/connectcampaignsv2/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateCampaign struct { +} + +func (*validateOpCreateCampaign) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateCampaignInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateCampaignInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCampaignChannelSubtypeConfig struct { +} + +func (*validateOpDeleteCampaignChannelSubtypeConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCampaignChannelSubtypeConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCampaignChannelSubtypeConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCampaignChannelSubtypeConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCampaignCommunicationLimits struct { +} + +func (*validateOpDeleteCampaignCommunicationLimits) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCampaignCommunicationLimits) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCampaignCommunicationLimitsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCampaignCommunicationLimitsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCampaignCommunicationTime struct { +} + +func (*validateOpDeleteCampaignCommunicationTime) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCampaignCommunicationTime) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCampaignCommunicationTimeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCampaignCommunicationTimeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCampaign struct { +} + +func (*validateOpDeleteCampaign) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCampaignInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCampaignInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteConnectInstanceConfig struct { +} + +func (*validateOpDeleteConnectInstanceConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteConnectInstanceConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteConnectInstanceConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteConnectInstanceConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteConnectInstanceIntegration struct { +} + +func (*validateOpDeleteConnectInstanceIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteConnectInstanceIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteConnectInstanceIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteConnectInstanceIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteInstanceOnboardingJob struct { +} + +func (*validateOpDeleteInstanceOnboardingJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteInstanceOnboardingJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteInstanceOnboardingJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteInstanceOnboardingJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeCampaign struct { +} + +func (*validateOpDescribeCampaign) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeCampaignInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeCampaignInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCampaignStateBatch struct { +} + +func (*validateOpGetCampaignStateBatch) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCampaignStateBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCampaignStateBatchInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCampaignStateBatchInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCampaignState struct { +} + +func (*validateOpGetCampaignState) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCampaignState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCampaignStateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCampaignStateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetConnectInstanceConfig struct { +} + +func (*validateOpGetConnectInstanceConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetConnectInstanceConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetConnectInstanceConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetConnectInstanceConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetInstanceOnboardingJobStatus struct { +} + +func (*validateOpGetInstanceOnboardingJobStatus) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetInstanceOnboardingJobStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetInstanceOnboardingJobStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetInstanceOnboardingJobStatusInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListCampaigns struct { +} + +func (*validateOpListCampaigns) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCampaigns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCampaignsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCampaignsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListConnectInstanceIntegrations struct { +} + +func (*validateOpListConnectInstanceIntegrations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListConnectInstanceIntegrations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListConnectInstanceIntegrationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListConnectInstanceIntegrationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPauseCampaign struct { +} + +func (*validateOpPauseCampaign) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPauseCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PauseCampaignInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPauseCampaignInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutConnectInstanceIntegration struct { +} + +func (*validateOpPutConnectInstanceIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutConnectInstanceIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutConnectInstanceIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutConnectInstanceIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutOutboundRequestBatch struct { +} + +func (*validateOpPutOutboundRequestBatch) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutOutboundRequestBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutOutboundRequestBatchInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutOutboundRequestBatchInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpResumeCampaign struct { +} + +func (*validateOpResumeCampaign) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpResumeCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ResumeCampaignInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpResumeCampaignInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartCampaign struct { +} + +func (*validateOpStartCampaign) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartCampaignInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartCampaignInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartInstanceOnboardingJob struct { +} + +func (*validateOpStartInstanceOnboardingJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartInstanceOnboardingJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartInstanceOnboardingJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartInstanceOnboardingJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopCampaign struct { +} + +func (*validateOpStopCampaign) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopCampaignInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopCampaignInput(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 validateOpUpdateCampaignChannelSubtypeConfig struct { +} + +func (*validateOpUpdateCampaignChannelSubtypeConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCampaignChannelSubtypeConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCampaignChannelSubtypeConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCampaignChannelSubtypeConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCampaignCommunicationLimits struct { +} + +func (*validateOpUpdateCampaignCommunicationLimits) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCampaignCommunicationLimits) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCampaignCommunicationLimitsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCampaignCommunicationLimitsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCampaignCommunicationTime struct { +} + +func (*validateOpUpdateCampaignCommunicationTime) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCampaignCommunicationTime) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCampaignCommunicationTimeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCampaignCommunicationTimeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCampaignFlowAssociation struct { +} + +func (*validateOpUpdateCampaignFlowAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCampaignFlowAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCampaignFlowAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCampaignFlowAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCampaignName struct { +} + +func (*validateOpUpdateCampaignName) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCampaignName) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCampaignNameInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCampaignNameInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCampaignSchedule struct { +} + +func (*validateOpUpdateCampaignSchedule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCampaignSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCampaignScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCampaignScheduleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCampaignSource struct { +} + +func (*validateOpUpdateCampaignSource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCampaignSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCampaignSourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCampaignSourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateCampaignValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateCampaign{}, middleware.After) +} + +func addOpDeleteCampaignChannelSubtypeConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCampaignChannelSubtypeConfig{}, middleware.After) +} + +func addOpDeleteCampaignCommunicationLimitsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCampaignCommunicationLimits{}, middleware.After) +} + +func addOpDeleteCampaignCommunicationTimeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCampaignCommunicationTime{}, middleware.After) +} + +func addOpDeleteCampaignValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCampaign{}, middleware.After) +} + +func addOpDeleteConnectInstanceConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteConnectInstanceConfig{}, middleware.After) +} + +func addOpDeleteConnectInstanceIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteConnectInstanceIntegration{}, middleware.After) +} + +func addOpDeleteInstanceOnboardingJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteInstanceOnboardingJob{}, middleware.After) +} + +func addOpDescribeCampaignValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeCampaign{}, middleware.After) +} + +func addOpGetCampaignStateBatchValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCampaignStateBatch{}, middleware.After) +} + +func addOpGetCampaignStateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCampaignState{}, middleware.After) +} + +func addOpGetConnectInstanceConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetConnectInstanceConfig{}, middleware.After) +} + +func addOpGetInstanceOnboardingJobStatusValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetInstanceOnboardingJobStatus{}, middleware.After) +} + +func addOpListCampaignsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCampaigns{}, middleware.After) +} + +func addOpListConnectInstanceIntegrationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListConnectInstanceIntegrations{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpPauseCampaignValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPauseCampaign{}, middleware.After) +} + +func addOpPutConnectInstanceIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutConnectInstanceIntegration{}, middleware.After) +} + +func addOpPutOutboundRequestBatchValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutOutboundRequestBatch{}, middleware.After) +} + +func addOpResumeCampaignValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpResumeCampaign{}, middleware.After) +} + +func addOpStartCampaignValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartCampaign{}, middleware.After) +} + +func addOpStartInstanceOnboardingJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartInstanceOnboardingJob{}, middleware.After) +} + +func addOpStopCampaignValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopCampaign{}, 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 addOpUpdateCampaignChannelSubtypeConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCampaignChannelSubtypeConfig{}, middleware.After) +} + +func addOpUpdateCampaignCommunicationLimitsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCampaignCommunicationLimits{}, middleware.After) +} + +func addOpUpdateCampaignCommunicationTimeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCampaignCommunicationTime{}, middleware.After) +} + +func addOpUpdateCampaignFlowAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCampaignFlowAssociation{}, middleware.After) +} + +func addOpUpdateCampaignNameValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCampaignName{}, middleware.After) +} + +func addOpUpdateCampaignScheduleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCampaignSchedule{}, middleware.After) +} + +func addOpUpdateCampaignSourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCampaignSource{}, middleware.After) +} + +func validateAnswerMachineDetectionConfig(v *types.AnswerMachineDetectionConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AnswerMachineDetectionConfig"} + if v.EnableAnswerMachineDetection == nil { + invalidParams.Add(smithy.NewErrParamRequired("EnableAnswerMachineDetection")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCampaignFilters(v *types.CampaignFilters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CampaignFilters"} + if v.InstanceIdFilter != nil { + if err := validateInstanceIdFilter(v.InstanceIdFilter); err != nil { + invalidParams.AddNested("InstanceIdFilter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateChannelSubtypeConfig(v *types.ChannelSubtypeConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ChannelSubtypeConfig"} + if v.Telephony != nil { + if err := validateTelephonyChannelSubtypeConfig(v.Telephony); err != nil { + invalidParams.AddNested("Telephony", err.(smithy.InvalidParamsError)) + } + } + if v.Sms != nil { + if err := validateSmsChannelSubtypeConfig(v.Sms); err != nil { + invalidParams.AddNested("Sms", err.(smithy.InvalidParamsError)) + } + } + if v.Email != nil { + if err := validateEmailChannelSubtypeConfig(v.Email); err != nil { + invalidParams.AddNested("Email", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateChannelSubtypeParameters(v types.ChannelSubtypeParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ChannelSubtypeParameters"} + switch uv := v.(type) { + case *types.ChannelSubtypeParametersMemberEmail: + if err := validateEmailChannelSubtypeParameters(&uv.Value); err != nil { + invalidParams.AddNested("[email]", err.(smithy.InvalidParamsError)) + } + + case *types.ChannelSubtypeParametersMemberSms: + if err := validateSmsChannelSubtypeParameters(&uv.Value); err != nil { + invalidParams.AddNested("[sms]", err.(smithy.InvalidParamsError)) + } + + case *types.ChannelSubtypeParametersMemberTelephony: + if err := validateTelephonyChannelSubtypeParameters(&uv.Value); err != nil { + invalidParams.AddNested("[telephony]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCommunicationLimit(v *types.CommunicationLimit) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommunicationLimit"} + if v.MaxCountPerRecipient == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxCountPerRecipient")) + } + if v.Frequency == nil { + invalidParams.Add(smithy.NewErrParamRequired("Frequency")) + } + if len(v.Unit) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Unit")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCommunicationLimitList(v []types.CommunicationLimit) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommunicationLimitList"} + for i := range v { + if err := validateCommunicationLimit(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCommunicationLimits(v types.CommunicationLimits) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommunicationLimits"} + switch uv := v.(type) { + case *types.CommunicationLimitsMemberCommunicationLimitsList: + if err := validateCommunicationLimitList(uv.Value); err != nil { + invalidParams.AddNested("[communicationLimitsList]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCommunicationLimitsConfig(v *types.CommunicationLimitsConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommunicationLimitsConfig"} + if v.AllChannelSubtypes != nil { + if err := validateCommunicationLimits(v.AllChannelSubtypes); err != nil { + invalidParams.AddNested("AllChannelSubtypes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCommunicationTimeConfig(v *types.CommunicationTimeConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommunicationTimeConfig"} + if v.LocalTimeZoneConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocalTimeZoneConfig")) + } + if v.Telephony != nil { + if err := validateTimeWindow(v.Telephony); err != nil { + invalidParams.AddNested("Telephony", err.(smithy.InvalidParamsError)) + } + } + if v.Sms != nil { + if err := validateTimeWindow(v.Sms); err != nil { + invalidParams.AddNested("Sms", err.(smithy.InvalidParamsError)) + } + } + if v.Email != nil { + if err := validateTimeWindow(v.Email); err != nil { + invalidParams.AddNested("Email", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCustomerProfilesIntegrationConfig(v *types.CustomerProfilesIntegrationConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CustomerProfilesIntegrationConfig"} + if v.DomainArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainArn")) + } + if v.ObjectTypeNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCustomerProfilesIntegrationIdentifier(v *types.CustomerProfilesIntegrationIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CustomerProfilesIntegrationIdentifier"} + if v.DomainArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDailyHours(v map[string][]types.TimeRange) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DailyHours"} + for key := range v { + if err := validateTimeRangeList(v[key]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEmailChannelSubtypeConfig(v *types.EmailChannelSubtypeConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EmailChannelSubtypeConfig"} + if v.OutboundMode == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutboundMode")) + } + if v.DefaultOutboundConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultOutboundConfig")) + } else if v.DefaultOutboundConfig != nil { + if err := validateEmailOutboundConfig(v.DefaultOutboundConfig); err != nil { + invalidParams.AddNested("DefaultOutboundConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEmailChannelSubtypeParameters(v *types.EmailChannelSubtypeParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EmailChannelSubtypeParameters"} + if v.DestinationEmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationEmailAddress")) + } + if v.TemplateParameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateParameters")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEmailOutboundConfig(v *types.EmailOutboundConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EmailOutboundConfig"} + if v.ConnectSourceEmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectSourceEmailAddress")) + } + if v.WisdomTemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("WisdomTemplateArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEncryptionConfig(v *types.EncryptionConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EncryptionConfig"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateInstanceIdFilter(v *types.InstanceIdFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InstanceIdFilter"} + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIntegrationConfig(v types.IntegrationConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IntegrationConfig"} + switch uv := v.(type) { + case *types.IntegrationConfigMemberCustomerProfiles: + if err := validateCustomerProfilesIntegrationConfig(&uv.Value); err != nil { + invalidParams.AddNested("[customerProfiles]", err.(smithy.InvalidParamsError)) + } + + case *types.IntegrationConfigMemberQConnect: + if err := validateQConnectIntegrationConfig(&uv.Value); err != nil { + invalidParams.AddNested("[qConnect]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIntegrationIdentifier(v types.IntegrationIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IntegrationIdentifier"} + switch uv := v.(type) { + case *types.IntegrationIdentifierMemberCustomerProfiles: + if err := validateCustomerProfilesIntegrationIdentifier(&uv.Value); err != nil { + invalidParams.AddNested("[customerProfiles]", err.(smithy.InvalidParamsError)) + } + + case *types.IntegrationIdentifierMemberQConnect: + if err := validateQConnectIntegrationIdentifier(&uv.Value); err != nil { + invalidParams.AddNested("[qConnect]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpenHours(v types.OpenHours) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OpenHours"} + switch uv := v.(type) { + case *types.OpenHoursMemberDailyHours: + if err := validateDailyHours(uv.Value); err != nil { + invalidParams.AddNested("[dailyHours]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOutboundRequest(v *types.OutboundRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OutboundRequest"} + if v.ClientToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) + } + if v.ExpirationTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExpirationTime")) + } + if v.ChannelSubtypeParameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("ChannelSubtypeParameters")) + } else if v.ChannelSubtypeParameters != nil { + if err := validateChannelSubtypeParameters(v.ChannelSubtypeParameters); err != nil { + invalidParams.AddNested("ChannelSubtypeParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOutboundRequestList(v []types.OutboundRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OutboundRequestList"} + for i := range v { + if err := validateOutboundRequest(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveConfig(v *types.PredictiveConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveConfig"} + if v.BandwidthAllocation == nil { + invalidParams.Add(smithy.NewErrParamRequired("BandwidthAllocation")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateProgressiveConfig(v *types.ProgressiveConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ProgressiveConfig"} + if v.BandwidthAllocation == nil { + invalidParams.Add(smithy.NewErrParamRequired("BandwidthAllocation")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQConnectIntegrationConfig(v *types.QConnectIntegrationConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QConnectIntegrationConfig"} + if v.KnowledgeBaseArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQConnectIntegrationIdentifier(v *types.QConnectIntegrationIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QConnectIntegrationIdentifier"} + if v.KnowledgeBaseArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRestrictedPeriod(v *types.RestrictedPeriod) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestrictedPeriod"} + if v.StartDate == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartDate")) + } + if v.EndDate == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndDate")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRestrictedPeriodList(v []types.RestrictedPeriod) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestrictedPeriodList"} + for i := range v { + if err := validateRestrictedPeriod(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRestrictedPeriods(v types.RestrictedPeriods) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestrictedPeriods"} + switch uv := v.(type) { + case *types.RestrictedPeriodsMemberRestrictedPeriodList: + if err := validateRestrictedPeriodList(uv.Value); err != nil { + invalidParams.AddNested("[restrictedPeriodList]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSchedule(v *types.Schedule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Schedule"} + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } + if v.EndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTime")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSmsChannelSubtypeConfig(v *types.SmsChannelSubtypeConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SmsChannelSubtypeConfig"} + if v.OutboundMode == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutboundMode")) + } + if v.DefaultOutboundConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultOutboundConfig")) + } else if v.DefaultOutboundConfig != nil { + if err := validateSmsOutboundConfig(v.DefaultOutboundConfig); err != nil { + invalidParams.AddNested("DefaultOutboundConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSmsChannelSubtypeParameters(v *types.SmsChannelSubtypeParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SmsChannelSubtypeParameters"} + if v.DestinationPhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationPhoneNumber")) + } + if v.TemplateParameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateParameters")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSmsOutboundConfig(v *types.SmsOutboundConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SmsOutboundConfig"} + if v.ConnectSourcePhoneNumberArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectSourcePhoneNumberArn")) + } + if v.WisdomTemplateArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("WisdomTemplateArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTelephonyChannelSubtypeConfig(v *types.TelephonyChannelSubtypeConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TelephonyChannelSubtypeConfig"} + if v.OutboundMode == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutboundMode")) + } else if v.OutboundMode != nil { + if err := validateTelephonyOutboundMode(v.OutboundMode); err != nil { + invalidParams.AddNested("OutboundMode", err.(smithy.InvalidParamsError)) + } + } + if v.DefaultOutboundConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultOutboundConfig")) + } else if v.DefaultOutboundConfig != nil { + if err := validateTelephonyOutboundConfig(v.DefaultOutboundConfig); err != nil { + invalidParams.AddNested("DefaultOutboundConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTelephonyChannelSubtypeParameters(v *types.TelephonyChannelSubtypeParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TelephonyChannelSubtypeParameters"} + if v.DestinationPhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationPhoneNumber")) + } + if v.Attributes == nil { + invalidParams.Add(smithy.NewErrParamRequired("Attributes")) + } + if v.AnswerMachineDetectionConfig != nil { + if err := validateAnswerMachineDetectionConfig(v.AnswerMachineDetectionConfig); err != nil { + invalidParams.AddNested("AnswerMachineDetectionConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTelephonyOutboundConfig(v *types.TelephonyOutboundConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TelephonyOutboundConfig"} + if v.ConnectContactFlowId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectContactFlowId")) + } + if v.AnswerMachineDetectionConfig != nil { + if err := validateAnswerMachineDetectionConfig(v.AnswerMachineDetectionConfig); err != nil { + invalidParams.AddNested("AnswerMachineDetectionConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTelephonyOutboundMode(v types.TelephonyOutboundMode) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TelephonyOutboundMode"} + switch uv := v.(type) { + case *types.TelephonyOutboundModeMemberPredictive: + if err := validatePredictiveConfig(&uv.Value); err != nil { + invalidParams.AddNested("[predictive]", err.(smithy.InvalidParamsError)) + } + + case *types.TelephonyOutboundModeMemberProgressive: + if err := validateProgressiveConfig(&uv.Value); err != nil { + invalidParams.AddNested("[progressive]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTimeRange(v *types.TimeRange) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TimeRange"} + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } + if v.EndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTime")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTimeRangeList(v []types.TimeRange) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TimeRangeList"} + for i := range v { + if err := validateTimeRange(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTimeWindow(v *types.TimeWindow) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TimeWindow"} + if v.OpenHours == nil { + invalidParams.Add(smithy.NewErrParamRequired("OpenHours")) + } else if v.OpenHours != nil { + if err := validateOpenHours(v.OpenHours); err != nil { + invalidParams.AddNested("OpenHours", err.(smithy.InvalidParamsError)) + } + } + if v.RestrictedPeriods != nil { + if err := validateRestrictedPeriods(v.RestrictedPeriods); err != nil { + invalidParams.AddNested("RestrictedPeriods", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateCampaignInput(v *CreateCampaignInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCampaignInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if v.ChannelSubtypeConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("ChannelSubtypeConfig")) + } else if v.ChannelSubtypeConfig != nil { + if err := validateChannelSubtypeConfig(v.ChannelSubtypeConfig); err != nil { + invalidParams.AddNested("ChannelSubtypeConfig", err.(smithy.InvalidParamsError)) + } + } + if v.Schedule != nil { + if err := validateSchedule(v.Schedule); err != nil { + invalidParams.AddNested("Schedule", err.(smithy.InvalidParamsError)) + } + } + if v.CommunicationTimeConfig != nil { + if err := validateCommunicationTimeConfig(v.CommunicationTimeConfig); err != nil { + invalidParams.AddNested("CommunicationTimeConfig", err.(smithy.InvalidParamsError)) + } + } + if v.CommunicationLimitsOverride != nil { + if err := validateCommunicationLimitsConfig(v.CommunicationLimitsOverride); err != nil { + invalidParams.AddNested("CommunicationLimitsOverride", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCampaignChannelSubtypeConfigInput(v *DeleteCampaignChannelSubtypeConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCampaignChannelSubtypeConfigInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if len(v.ChannelSubtype) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ChannelSubtype")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCampaignCommunicationLimitsInput(v *DeleteCampaignCommunicationLimitsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCampaignCommunicationLimitsInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if len(v.Config) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Config")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCampaignCommunicationTimeInput(v *DeleteCampaignCommunicationTimeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCampaignCommunicationTimeInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if len(v.Config) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Config")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCampaignInput(v *DeleteCampaignInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCampaignInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteConnectInstanceConfigInput(v *DeleteConnectInstanceConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteConnectInstanceConfigInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteConnectInstanceIntegrationInput(v *DeleteConnectInstanceIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteConnectInstanceIntegrationInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if v.IntegrationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntegrationIdentifier")) + } else if v.IntegrationIdentifier != nil { + if err := validateIntegrationIdentifier(v.IntegrationIdentifier); err != nil { + invalidParams.AddNested("IntegrationIdentifier", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteInstanceOnboardingJobInput(v *DeleteInstanceOnboardingJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteInstanceOnboardingJobInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeCampaignInput(v *DescribeCampaignInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeCampaignInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCampaignStateBatchInput(v *GetCampaignStateBatchInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCampaignStateBatchInput"} + if v.CampaignIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("CampaignIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCampaignStateInput(v *GetCampaignStateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCampaignStateInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetConnectInstanceConfigInput(v *GetConnectInstanceConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetConnectInstanceConfigInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetInstanceOnboardingJobStatusInput(v *GetInstanceOnboardingJobStatusInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetInstanceOnboardingJobStatusInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListCampaignsInput(v *ListCampaignsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCampaignsInput"} + if v.Filters != nil { + if err := validateCampaignFilters(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListConnectInstanceIntegrationsInput(v *ListConnectInstanceIntegrationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListConnectInstanceIntegrationsInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPauseCampaignInput(v *PauseCampaignInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PauseCampaignInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutConnectInstanceIntegrationInput(v *PutConnectInstanceIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutConnectInstanceIntegrationInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if v.IntegrationConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntegrationConfig")) + } else if v.IntegrationConfig != nil { + if err := validateIntegrationConfig(v.IntegrationConfig); err != nil { + invalidParams.AddNested("IntegrationConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutOutboundRequestBatchInput(v *PutOutboundRequestBatchInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutOutboundRequestBatchInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.OutboundRequests == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutboundRequests")) + } else if v.OutboundRequests != nil { + if err := validateOutboundRequestList(v.OutboundRequests); err != nil { + invalidParams.AddNested("OutboundRequests", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpResumeCampaignInput(v *ResumeCampaignInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResumeCampaignInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartCampaignInput(v *StartCampaignInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartCampaignInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartInstanceOnboardingJobInput(v *StartInstanceOnboardingJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartInstanceOnboardingJobInput"} + if v.ConnectInstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectInstanceId")) + } + if v.EncryptionConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("EncryptionConfig")) + } else if v.EncryptionConfig != nil { + if err := validateEncryptionConfig(v.EncryptionConfig); err != nil { + invalidParams.AddNested("EncryptionConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopCampaignInput(v *StopCampaignInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopCampaignInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + 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.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + 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.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCampaignChannelSubtypeConfigInput(v *UpdateCampaignChannelSubtypeConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCampaignChannelSubtypeConfigInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.ChannelSubtypeConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("ChannelSubtypeConfig")) + } else if v.ChannelSubtypeConfig != nil { + if err := validateChannelSubtypeConfig(v.ChannelSubtypeConfig); err != nil { + invalidParams.AddNested("ChannelSubtypeConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCampaignCommunicationLimitsInput(v *UpdateCampaignCommunicationLimitsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCampaignCommunicationLimitsInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.CommunicationLimitsOverride == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommunicationLimitsOverride")) + } else if v.CommunicationLimitsOverride != nil { + if err := validateCommunicationLimitsConfig(v.CommunicationLimitsOverride); err != nil { + invalidParams.AddNested("CommunicationLimitsOverride", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCampaignCommunicationTimeInput(v *UpdateCampaignCommunicationTimeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCampaignCommunicationTimeInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.CommunicationTimeConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommunicationTimeConfig")) + } else if v.CommunicationTimeConfig != nil { + if err := validateCommunicationTimeConfig(v.CommunicationTimeConfig); err != nil { + invalidParams.AddNested("CommunicationTimeConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCampaignFlowAssociationInput(v *UpdateCampaignFlowAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCampaignFlowAssociationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.ConnectCampaignFlowArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectCampaignFlowArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCampaignNameInput(v *UpdateCampaignNameInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCampaignNameInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCampaignScheduleInput(v *UpdateCampaignScheduleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCampaignScheduleInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.Schedule == nil { + invalidParams.Add(smithy.NewErrParamRequired("Schedule")) + } else if v.Schedule != nil { + if err := validateSchedule(v.Schedule); err != nil { + invalidParams.AddNested("Schedule", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCampaignSourceInput(v *UpdateCampaignSourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCampaignSourceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/datasync/api_op_CreateTask.go b/service/datasync/api_op_CreateTask.go index b1b7395db5d..c09c04f8b98 100644 --- a/service/datasync/api_op_CreateTask.go +++ b/service/datasync/api_op_CreateTask.go @@ -102,15 +102,19 @@ type CreateTaskInput struct { // Specifies one of the following task modes for your data transfer: // - // - ENHANCED - Transfer virtually unlimited numbers of objects with enhanced - // metrics, more detailed logs, and higher performance than Basic mode. Currently - // available for transfers between Amazon S3 locations. + // - ENHANCED - Transfer virtually unlimited numbers of objects with higher + // performance than Basic mode. Enhanced mode tasks optimize the data transfer + // process by listing, preparing, transferring, and verifying data in parallel. + // Enhanced mode is currently available for transfers between Amazon S3 locations. // // To create an Enhanced mode task, the IAM role that you use to call the // CreateTask operation must have the iam:CreateServiceLinkedRole permission. // // - BASIC (default) - Transfer files or objects between Amazon Web Services - // storage and on-premises, edge, or other cloud storage. DataSync [quotas]apply. + // storage and all other supported DataSync locations. Basic mode tasks are subject + // to [quotas]on the number of files, objects, and directories in a dataset. Basic mode + // sequentially prepares, transfers, and verifies data, making it slower than + // Enhanced mode for most workloads. // // For more information, see [Understanding task mode differences]. // diff --git a/service/datasync/api_op_DescribeTaskExecution.go b/service/datasync/api_op_DescribeTaskExecution.go index 7e0c110ca82..765f8064010 100644 --- a/service/datasync/api_op_DescribeTaskExecution.go +++ b/service/datasync/api_op_DescribeTaskExecution.go @@ -17,10 +17,10 @@ import ( // results of the transfer. // // Some DescribeTaskExecution response elements are only relevant to a specific -// task mode. For information, see [Understanding task mode differences]and [Understanding data transfer performance metrics]. +// task mode. For information, see [Understanding task mode differences]and [Understanding data transfer performance counters]. // // [Understanding task mode differences]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html#task-mode-differences -// [Understanding data transfer performance metrics]: https://docs.aws.amazon.com/datasync/latest/userguide/transfer-performance-metrics.html +// [Understanding data transfer performance counters]: https://docs.aws.amazon.com/datasync/latest/userguide/transfer-performance-counters.html func (c *Client) DescribeTaskExecution(ctx context.Context, params *DescribeTaskExecutionInput, optFns ...func(*Options)) (*DescribeTaskExecutionOutput, error) { if params == nil { params = &DescribeTaskExecutionInput{} @@ -55,10 +55,7 @@ type DescribeTaskExecutionOutput struct { // compression (if compression is possible). This number is typically less than [BytesTransferred] // unless the data isn't compressible. // - // Not currently supported with [Enhanced mode tasks]. - // // [BytesTransferred]: https://docs.aws.amazon.com/datasync/latest/userguide/API_DescribeTaskExecution.html#DataSync-DescribeTaskExecution-response-BytesTransferred - // [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html BytesCompressed int64 // The number of bytes that DataSync sends to the network before compression (if @@ -77,15 +74,14 @@ type DescribeTaskExecutionOutput struct { EstimatedBytesToTransfer int64 // The number of files, objects, and directories that DataSync expects to delete - // in your destination location. If you don't [configure your task]to delete data in the destination - // that isn't in the source, the value is always 0 . + // in your destination location. If you don't configure your task to [delete data in the destination that isn't in the source], the value + // is always 0 . // - // [configure your task]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html + // [delete data in the destination that isn't in the source]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html EstimatedFilesToDelete int64 // The number of files, objects, and directories that DataSync expects to transfer - // over the network. This value is calculated during the task execution's PREPARING[step] - // before the TRANSFERRING step. + // over the network. This value is calculated while DataSync [prepares]the transfer. // // How this gets calculated depends primarily on your task’s [transfer mode] configuration: // @@ -106,7 +102,7 @@ type DescribeTaskExecutionOutput struct { // // [transfer mode]: https://docs.aws.amazon.com/datasync/latest/userguide/API_Options.html#DataSync-Type-Options-TransferMode // [OverwriteMode]: https://docs.aws.amazon.com/datasync/latest/userguide/API_Options.html#DataSync-Type-Options-OverwriteMode - // [step]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses + // [prepares]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses // [PreserveDeletedFiles]: https://docs.aws.amazon.com/datasync/latest/userguide/API_Options.html#DataSync-Type-Options-PreserveDeletedFiles EstimatedFilesToTransfer int64 @@ -117,10 +113,10 @@ type DescribeTaskExecutionOutput struct { Excludes []types.FilterRule // The number of files, objects, and directories that DataSync actually deletes in - // your destination location. If you don't [configure your task]to delete data in the destination that - // isn't in the source, the value is always 0 . + // your destination location. If you don't configure your task to [delete data in the destination that isn't in the source], the value is + // always 0 . // - // [configure your task]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html + // [delete data in the destination that isn't in the source]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html FilesDeleted int64 // The number of objects that DataSync fails to prepare, transfer, verify, and @@ -143,7 +139,7 @@ type DescribeTaskExecutionOutput struct { // // Applies only to [Enhanced mode tasks]. // - // This metric isn't applicable if you configure your task to [transfer all data]. In that scenario, + // This counter isn't applicable if you configure your task to [transfer all data]. In that scenario, // DataSync copies everything from the source to the destination without comparing // differences between the locations. // @@ -156,16 +152,14 @@ type DescribeTaskExecutionOutput struct { FilesSkipped int64 // The number of files, objects, and directories that DataSync actually transfers - // over the network. This value is updated periodically during the task execution's - // TRANSFERRING[step] when something is read from the source and sent over the network. + // over the network. This value is updated periodically during your task execution + // when something is read from the source and sent over the network. // // If DataSync fails to transfer something, this value can be less than // EstimatedFilesToTransfer . In some cases, this value can also be greater than // EstimatedFilesToTransfer . This element is implementation-specific for some // location types, so don't use it as an exact indication of what's transferring or // to monitor your task execution. - // - // [step]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses FilesTransferred int64 // The number of files, objects, and directories that DataSync verifies during diff --git a/service/datasync/types/types.go b/service/datasync/types/types.go index d4fcff0f708..7f739da807b 100644 --- a/service/datasync/types/types.go +++ b/service/datasync/types/types.go @@ -1297,7 +1297,7 @@ type TaskExecutionFilesFailedDetail struct { type TaskExecutionFilesListedDetail struct { // The number of objects that DataSync finds at your destination location. This - // metric is only applicable if you [configure your task]to delete data in the destination that isn't + // counter is only applicable if you [configure your task]to delete data in the destination that isn't // in the source. // // [configure your task]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html#task-option-file-object-handling diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index c267c308b17..52abe006299 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -2257,8 +2257,6 @@ type FleetCapacityReservationUsageStrategy string // Enum values for FleetCapacityReservationUsageStrategy const ( FleetCapacityReservationUsageStrategyUseCapacityReservationsFirst FleetCapacityReservationUsageStrategy = "use-capacity-reservations-first" - FleetCapacityReservationUsageStrategyUseCapacityReservationsOnly FleetCapacityReservationUsageStrategy = "use-capacity-reservations-only" - FleetCapacityReservationUsageStrategyNone FleetCapacityReservationUsageStrategy = "none" ) // Values returns all known values for FleetCapacityReservationUsageStrategy. Note @@ -2269,8 +2267,6 @@ const ( func (FleetCapacityReservationUsageStrategy) Values() []FleetCapacityReservationUsageStrategy { return []FleetCapacityReservationUsageStrategy{ "use-capacity-reservations-first", - "use-capacity-reservations-only", - "none", } } diff --git a/service/emrcontainers/internal/endpoints/endpoints.go b/service/emrcontainers/internal/endpoints/endpoints.go index 0256805f903..c86a2144b72 100644 --- a/service/emrcontainers/internal/endpoints/endpoints.go +++ b/service/emrcontainers/internal/endpoints/endpoints.go @@ -157,6 +157,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, @@ -244,6 +247,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, diff --git a/service/internal/integrationtest/go.mod b/service/internal/integrationtest/go.mod index b40d79c42df..114c8e28e8f 100644 --- a/service/internal/integrationtest/go.mod +++ b/service/internal/integrationtest/go.mod @@ -38,7 +38,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.4 github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.41.1 github.com/aws/aws-sdk-go-v2/service/elasticsearchservice v1.32.5 - github.com/aws/aws-sdk-go-v2/service/elastictranscoder v1.27.5 github.com/aws/aws-sdk-go-v2/service/emr v1.46.3 github.com/aws/aws-sdk-go-v2/service/eventbridge v1.35.5 github.com/aws/aws-sdk-go-v2/service/firehose v1.35.0 diff --git a/service/iot/api_op_AttachThingPrincipal.go b/service/iot/api_op_AttachThingPrincipal.go index 4485283decd..9de4fa520f5 100644 --- a/service/iot/api_op_AttachThingPrincipal.go +++ b/service/iot/api_op_AttachThingPrincipal.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -45,6 +46,16 @@ type AttachThingPrincipalInput struct { // This member is required. ThingName *string + // The type of the relation you want to specify when you attach a principal to a + // thing. + // + // - EXCLUSIVE_THING - Attaches the specified principal to the specified thing, + // exclusively. The thing will be the only thing that’s attached to the principal. + // + // - NON_EXCLUSIVE_THING - Attaches the specified principal to the specified + // thing. Multiple things can be attached to the principal. + ThingPrincipalType types.ThingPrincipalType + noSmithyDocumentSerde } diff --git a/service/iot/api_op_DescribeThingType.go b/service/iot/api_op_DescribeThingType.go index 9bb5268c95b..898c132eb98 100644 --- a/service/iot/api_op_DescribeThingType.go +++ b/service/iot/api_op_DescribeThingType.go @@ -60,7 +60,8 @@ type DescribeThingTypeOutput struct { ThingTypeName *string // The ThingTypeProperties contains information about the thing type including - // description, and a list of searchable thing attribute names. + // description, a list of searchable thing attribute names, and MQTT5 + // configuration. ThingTypeProperties *types.ThingTypeProperties // Metadata pertaining to the operation's result. diff --git a/service/iot/api_op_ListPrincipalThingsV2.go b/service/iot/api_op_ListPrincipalThingsV2.go new file mode 100644 index 00000000000..4612caca3be --- /dev/null +++ b/service/iot/api_op_ListPrincipalThingsV2.go @@ -0,0 +1,279 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the things associated with the specified principal. A principal can be an +// X.509 certificate or an Amazon Cognito ID. +// +// Requires permission to access the [ListPrincipalThings] action. +// +// [ListPrincipalThings]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions +func (c *Client) ListPrincipalThingsV2(ctx context.Context, params *ListPrincipalThingsV2Input, optFns ...func(*Options)) (*ListPrincipalThingsV2Output, error) { + if params == nil { + params = &ListPrincipalThingsV2Input{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPrincipalThingsV2", params, optFns, c.addOperationListPrincipalThingsV2Middlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPrincipalThingsV2Output) + out.ResultMetadata = metadata + return out, nil +} + +type ListPrincipalThingsV2Input struct { + + // The principal. A principal can be an X.509 certificate or an Amazon Cognito ID. + // + // This member is required. + Principal *string + + // The maximum number of results to return in this operation. + MaxResults *int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string + + // The type of the relation you want to filter in the response. If no value is + // provided in this field, the response will list all things, including both the + // EXCLUSIVE_THING and NON_EXCLUSIVE_THING attachment types. + // + // - EXCLUSIVE_THING - Attaches the specified principal to the specified thing, + // exclusively. The thing will be the only thing that’s attached to the principal. + // + // - NON_EXCLUSIVE_THING - Attaches the specified principal to the specified + // thing. Multiple things can be attached to the principal. + ThingPrincipalType types.ThingPrincipalType + + noSmithyDocumentSerde +} + +type ListPrincipalThingsV2Output struct { + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // A list of thingPrincipalObject that represents the principal and the type of + // relation it has with the thing. + PrincipalThingObjects []types.PrincipalThingObject + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPrincipalThingsV2Middlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPrincipalThingsV2{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPrincipalThingsV2{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListPrincipalThingsV2"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListPrincipalThingsV2ValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPrincipalThingsV2(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListPrincipalThingsV2PaginatorOptions is the paginator options for +// ListPrincipalThingsV2 +type ListPrincipalThingsV2PaginatorOptions struct { + // The maximum number of results to return in this operation. + 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 +} + +// ListPrincipalThingsV2Paginator is a paginator for ListPrincipalThingsV2 +type ListPrincipalThingsV2Paginator struct { + options ListPrincipalThingsV2PaginatorOptions + client ListPrincipalThingsV2APIClient + params *ListPrincipalThingsV2Input + nextToken *string + firstPage bool +} + +// NewListPrincipalThingsV2Paginator returns a new ListPrincipalThingsV2Paginator +func NewListPrincipalThingsV2Paginator(client ListPrincipalThingsV2APIClient, params *ListPrincipalThingsV2Input, optFns ...func(*ListPrincipalThingsV2PaginatorOptions)) *ListPrincipalThingsV2Paginator { + if params == nil { + params = &ListPrincipalThingsV2Input{} + } + + options := ListPrincipalThingsV2PaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPrincipalThingsV2Paginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalThingsV2Paginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPrincipalThingsV2 page. +func (p *ListPrincipalThingsV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalThingsV2Output, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListPrincipalThingsV2(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 +} + +// ListPrincipalThingsV2APIClient is a client that implements the +// ListPrincipalThingsV2 operation. +type ListPrincipalThingsV2APIClient interface { + ListPrincipalThingsV2(context.Context, *ListPrincipalThingsV2Input, ...func(*Options)) (*ListPrincipalThingsV2Output, error) +} + +var _ ListPrincipalThingsV2APIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListPrincipalThingsV2(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListPrincipalThingsV2", + } +} diff --git a/service/iot/api_op_ListThingPrincipalsV2.go b/service/iot/api_op_ListThingPrincipalsV2.go new file mode 100644 index 00000000000..55ad5093c4b --- /dev/null +++ b/service/iot/api_op_ListThingPrincipalsV2.go @@ -0,0 +1,279 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the principals associated with the specified thing. A principal can be an +// X.509 certificate or an Amazon Cognito ID. +// +// Requires permission to access the [ListThingPrincipals] action. +// +// [ListThingPrincipals]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions +func (c *Client) ListThingPrincipalsV2(ctx context.Context, params *ListThingPrincipalsV2Input, optFns ...func(*Options)) (*ListThingPrincipalsV2Output, error) { + if params == nil { + params = &ListThingPrincipalsV2Input{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListThingPrincipalsV2", params, optFns, c.addOperationListThingPrincipalsV2Middlewares) + if err != nil { + return nil, err + } + + out := result.(*ListThingPrincipalsV2Output) + out.ResultMetadata = metadata + return out, nil +} + +type ListThingPrincipalsV2Input struct { + + // The name of the thing. + // + // This member is required. + ThingName *string + + // The maximum number of results to return in this operation. + MaxResults *int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string + + // The type of the relation you want to filter in the response. If no value is + // provided in this field, the response will list all principals, including both + // the EXCLUSIVE_THING and NON_EXCLUSIVE_THING attachment types. + // + // - EXCLUSIVE_THING - Attaches the specified principal to the specified thing, + // exclusively. The thing will be the only thing that’s attached to the principal. + // + // - NON_EXCLUSIVE_THING - Attaches the specified principal to the specified + // thing. Multiple things can be attached to the principal. + ThingPrincipalType types.ThingPrincipalType + + noSmithyDocumentSerde +} + +type ListThingPrincipalsV2Output struct { + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // A list of thingPrincipalObject that represents the principal and the type of + // relation it has with the thing. + ThingPrincipalObjects []types.ThingPrincipalObject + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListThingPrincipalsV2Middlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListThingPrincipalsV2{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListThingPrincipalsV2{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListThingPrincipalsV2"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListThingPrincipalsV2ValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListThingPrincipalsV2(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListThingPrincipalsV2PaginatorOptions is the paginator options for +// ListThingPrincipalsV2 +type ListThingPrincipalsV2PaginatorOptions struct { + // The maximum number of results to return in this operation. + 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 +} + +// ListThingPrincipalsV2Paginator is a paginator for ListThingPrincipalsV2 +type ListThingPrincipalsV2Paginator struct { + options ListThingPrincipalsV2PaginatorOptions + client ListThingPrincipalsV2APIClient + params *ListThingPrincipalsV2Input + nextToken *string + firstPage bool +} + +// NewListThingPrincipalsV2Paginator returns a new ListThingPrincipalsV2Paginator +func NewListThingPrincipalsV2Paginator(client ListThingPrincipalsV2APIClient, params *ListThingPrincipalsV2Input, optFns ...func(*ListThingPrincipalsV2PaginatorOptions)) *ListThingPrincipalsV2Paginator { + if params == nil { + params = &ListThingPrincipalsV2Input{} + } + + options := ListThingPrincipalsV2PaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListThingPrincipalsV2Paginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingPrincipalsV2Paginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListThingPrincipalsV2 page. +func (p *ListThingPrincipalsV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingPrincipalsV2Output, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListThingPrincipalsV2(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 +} + +// ListThingPrincipalsV2APIClient is a client that implements the +// ListThingPrincipalsV2 operation. +type ListThingPrincipalsV2APIClient interface { + ListThingPrincipalsV2(context.Context, *ListThingPrincipalsV2Input, ...func(*Options)) (*ListThingPrincipalsV2Output, error) +} + +var _ ListThingPrincipalsV2APIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListThingPrincipalsV2(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListThingPrincipalsV2", + } +} diff --git a/service/iot/api_op_UpdateThingType.go b/service/iot/api_op_UpdateThingType.go new file mode 100644 index 00000000000..8b81d2e736f --- /dev/null +++ b/service/iot/api_op_UpdateThingType.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a thing type. +func (c *Client) UpdateThingType(ctx context.Context, params *UpdateThingTypeInput, optFns ...func(*Options)) (*UpdateThingTypeOutput, error) { + if params == nil { + params = &UpdateThingTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateThingType", params, optFns, c.addOperationUpdateThingTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateThingTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateThingTypeInput struct { + + // The name of a thing type. + // + // This member is required. + ThingTypeName *string + + // The ThingTypeProperties contains information about the thing type including: a + // thing type description, and a list of searchable thing attribute names. + ThingTypeProperties *types.ThingTypeProperties + + noSmithyDocumentSerde +} + +type UpdateThingTypeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateThingTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateThingType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateThingType{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateThingType"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateThingTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateThingType(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateThingType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateThingType", + } +} diff --git a/service/iot/deserializers.go b/service/iot/deserializers.go index e1cc973fa33..8cdd007e8b3 100644 --- a/service/iot/deserializers.go +++ b/service/iot/deserializers.go @@ -28826,6 +28826,182 @@ func awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(v **ListPrincip return nil } +type awsRestjson1_deserializeOpListPrincipalThingsV2 struct { +} + +func (*awsRestjson1_deserializeOpListPrincipalThingsV2) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPrincipalThingsV2) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalThingsV2(response, &metadata) + } + output := &ListPrincipalThingsV2Output{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListPrincipalThingsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(v **ListPrincipalThingsV2Output, 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 *ListPrincipalThingsV2Output + if *v == nil { + sv = &ListPrincipalThingsV2Output{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "principalThingObjects": + if err := awsRestjson1_deserializeDocumentPrincipalThingObjects(&sv.PrincipalThingObjects, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListProvisioningTemplates struct { } @@ -31397,6 +31573,182 @@ func awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(v **ListThingPr return nil } +type awsRestjson1_deserializeOpListThingPrincipalsV2 struct { +} + +func (*awsRestjson1_deserializeOpListThingPrincipalsV2) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListThingPrincipalsV2) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response, &metadata) + } + output := &ListThingPrincipalsV2Output{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(v **ListThingPrincipalsV2Output, 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 *ListThingPrincipalsV2Output + if *v == nil { + sv = &ListThingPrincipalsV2Output{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "thingPrincipalObjects": + if err := awsRestjson1_deserializeDocumentThingPrincipalObjects(&sv.ThingPrincipalObjects, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListThingRegistrationTaskReports struct { } @@ -40589,6 +40941,109 @@ func awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response *smithyht } } +type awsRestjson1_deserializeOpUpdateThingType struct { +} + +func (*awsRestjson1_deserializeOpUpdateThingType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateThingType) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateThingType(response, &metadata) + } + output := &UpdateThingTypeOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpUpdateTopicRuleDestination struct { } @@ -52752,18 +53207,54 @@ func awsRestjson1_deserializeDocumentMitigationActionParams(v **types.Mitigation return err } - case "replaceDefaultPolicyVersionParams": - if err := awsRestjson1_deserializeDocumentReplaceDefaultPolicyVersionParams(&sv.ReplaceDefaultPolicyVersionParams, value); err != nil { - return err - } + case "replaceDefaultPolicyVersionParams": + if err := awsRestjson1_deserializeDocumentReplaceDefaultPolicyVersionParams(&sv.ReplaceDefaultPolicyVersionParams, value); err != nil { + return err + } + + case "updateCACertificateParams": + if err := awsRestjson1_deserializeDocumentUpdateCACertificateParams(&sv.UpdateCACertificateParams, value); err != nil { + return err + } + + case "updateDeviceCertificateParams": + if err := awsRestjson1_deserializeDocumentUpdateDeviceCertificateParams(&sv.UpdateDeviceCertificateParams, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMqtt5Configuration(v **types.Mqtt5Configuration, 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) + } - case "updateCACertificateParams": - if err := awsRestjson1_deserializeDocumentUpdateCACertificateParams(&sv.UpdateCACertificateParams, value); err != nil { - return err - } + var sv *types.Mqtt5Configuration + if *v == nil { + sv = &types.Mqtt5Configuration{} + } else { + sv = *v + } - case "updateDeviceCertificateParams": - if err := awsRestjson1_deserializeDocumentUpdateDeviceCertificateParams(&sv.UpdateDeviceCertificateParams, value); err != nil { + for key, value := range shape { + switch key { + case "propagatingAttributes": + if err := awsRestjson1_deserializeDocumentPropagatingAttributeList(&sv.PropagatingAttributes, value); err != nil { return err } @@ -54500,6 +54991,89 @@ func awsRestjson1_deserializeDocumentPrincipals(v *[]string, value interface{}) return nil } +func awsRestjson1_deserializeDocumentPrincipalThingObject(v **types.PrincipalThingObject, 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.PrincipalThingObject + if *v == nil { + sv = &types.PrincipalThingObject{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "thingName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThingName to be of type string, got %T instead", value) + } + sv.ThingName = ptr.String(jtv) + } + + case "thingPrincipalType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThingPrincipalType to be of type string, got %T instead", value) + } + sv.ThingPrincipalType = types.ThingPrincipalType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPrincipalThingObjects(v *[]types.PrincipalThingObject, 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.PrincipalThingObject + if *v == nil { + cv = []types.PrincipalThingObject{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PrincipalThingObject + destAddr := &col + if err := awsRestjson1_deserializeDocumentPrincipalThingObject(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentProcessingTargetNameList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -54536,6 +55110,98 @@ func awsRestjson1_deserializeDocumentProcessingTargetNameList(v *[]string, value return nil } +func awsRestjson1_deserializeDocumentPropagatingAttribute(v **types.PropagatingAttribute, 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.PropagatingAttribute + if *v == nil { + sv = &types.PropagatingAttribute{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectionAttribute": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectionAttributeName to be of type string, got %T instead", value) + } + sv.ConnectionAttribute = ptr.String(jtv) + } + + case "thingAttribute": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AttributeName to be of type string, got %T instead", value) + } + sv.ThingAttribute = ptr.String(jtv) + } + + case "userPropertyKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserPropertyKeyName to be of type string, got %T instead", value) + } + sv.UserPropertyKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPropagatingAttributeList(v *[]types.PropagatingAttribute, 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.PropagatingAttribute + if *v == nil { + cv = []types.PropagatingAttribute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PropagatingAttribute + destAddr := &col + if err := awsRestjson1_deserializeDocumentPropagatingAttribute(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentProtocols(v *[]types.Protocol, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -57042,6 +57708,24 @@ func awsRestjson1_deserializeDocumentServerCertificateConfig(v **types.ServerCer sv.EnableOCSPCheck = ptr.Bool(jtv) } + case "ocspAuthorizedResponderArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AcmCertificateArn to be of type string, got %T instead", value) + } + sv.OcspAuthorizedResponderArn = ptr.String(jtv) + } + + case "ocspLambdaArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OCSPLambdaArn to be of type string, got %T instead", value) + } + sv.OcspLambdaArn = ptr.String(jtv) + } + default: _, _ = key, value @@ -59655,6 +60339,89 @@ func awsRestjson1_deserializeDocumentThingNameList(v *[]string, value interface{ return nil } +func awsRestjson1_deserializeDocumentThingPrincipalObject(v **types.ThingPrincipalObject, 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.ThingPrincipalObject + if *v == nil { + sv = &types.ThingPrincipalObject{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "principal": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Principal to be of type string, got %T instead", value) + } + sv.Principal = ptr.String(jtv) + } + + case "thingPrincipalType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThingPrincipalType to be of type string, got %T instead", value) + } + sv.ThingPrincipalType = types.ThingPrincipalType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentThingPrincipalObjects(v *[]types.ThingPrincipalObject, 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.ThingPrincipalObject + if *v == nil { + cv = []types.ThingPrincipalObject{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ThingPrincipalObject + destAddr := &col + if err := awsRestjson1_deserializeDocumentThingPrincipalObject(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentThingTypeDefinition(v **types.ThingTypeDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -59842,6 +60609,11 @@ func awsRestjson1_deserializeDocumentThingTypeProperties(v **types.ThingTypeProp for key, value := range shape { switch key { + case "mqtt5Configuration": + if err := awsRestjson1_deserializeDocumentMqtt5Configuration(&sv.Mqtt5Configuration, value); err != nil { + return err + } + case "searchableAttributes": if err := awsRestjson1_deserializeDocumentSearchableAttributes(&sv.SearchableAttributes, value); err != nil { return err diff --git a/service/iot/generated.json b/service/iot/generated.json index 27331f3bb47..c5c823ba6a8 100644 --- a/service/iot/generated.json +++ b/service/iot/generated.json @@ -187,6 +187,7 @@ "api_op_ListPolicyVersions.go", "api_op_ListPrincipalPolicies.go", "api_op_ListPrincipalThings.go", + "api_op_ListPrincipalThingsV2.go", "api_op_ListProvisioningTemplateVersions.go", "api_op_ListProvisioningTemplates.go", "api_op_ListRelatedResourcesForAuditFinding.go", @@ -202,6 +203,7 @@ "api_op_ListThingGroups.go", "api_op_ListThingGroupsForThing.go", "api_op_ListThingPrincipals.go", + "api_op_ListThingPrincipalsV2.go", "api_op_ListThingRegistrationTaskReports.go", "api_op_ListThingRegistrationTasks.go", "api_op_ListThingTypes.go", @@ -264,6 +266,7 @@ "api_op_UpdateThing.go", "api_op_UpdateThingGroup.go", "api_op_UpdateThingGroupsForThing.go", + "api_op_UpdateThingType.go", "api_op_UpdateTopicRuleDestination.go", "api_op_ValidateSecurityProfileBehaviors.go", "auth.go", diff --git a/service/iot/serializers.go b/service/iot/serializers.go index c37eb2ce0ba..09cc8a00cbd 100644 --- a/service/iot/serializers.go +++ b/service/iot/serializers.go @@ -821,6 +821,10 @@ func awsRestjson1_serializeOpHttpBindingsAttachThingPrincipalInput(v *AttachThin } } + if len(v.ThingPrincipalType) > 0 { + encoder.SetQuery("thingPrincipalType").String(string(v.ThingPrincipalType)) + } + return nil } @@ -14932,6 +14936,85 @@ func awsRestjson1_serializeOpHttpBindingsListPrincipalThingsInput(v *ListPrincip return nil } +type awsRestjson1_serializeOpListPrincipalThingsV2 struct { +} + +func (*awsRestjson1_serializeOpListPrincipalThingsV2) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPrincipalThingsV2) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListPrincipalThingsV2Input) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/principals/things-v2") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListPrincipalThingsV2Input(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListPrincipalThingsV2Input(v *ListPrincipalThingsV2Input, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.Principal != nil { + locationName := "X-Amzn-Principal" + encoder.SetHeader(locationName).String(*v.Principal) + } + + if len(v.ThingPrincipalType) > 0 { + encoder.SetQuery("thingPrincipalType").String(string(v.ThingPrincipalType)) + } + + return nil +} + type awsRestjson1_serializeOpListProvisioningTemplates struct { } @@ -16089,6 +16172,89 @@ func awsRestjson1_serializeOpHttpBindingsListThingPrincipalsInput(v *ListThingPr return nil } +type awsRestjson1_serializeOpListThingPrincipalsV2 struct { +} + +func (*awsRestjson1_serializeOpListThingPrincipalsV2) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListThingPrincipalsV2) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListThingPrincipalsV2Input) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/things/{thingName}/principals-v2") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListThingPrincipalsV2Input(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListThingPrincipalsV2Input(v *ListThingPrincipalsV2Input, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ThingName == nil || len(*v.ThingName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member thingName must not be empty")} + } + if v.ThingName != nil { + if err := encoder.SetURI("thingName").String(*v.ThingName); err != nil { + return err + } + } + + if len(v.ThingPrincipalType) > 0 { + encoder.SetQuery("thingPrincipalType").String(string(v.ThingPrincipalType)) + } + + return nil +} + type awsRestjson1_serializeOpListThingRegistrationTaskReports struct { } @@ -22191,6 +22357,102 @@ func awsRestjson1_serializeOpDocumentUpdateThingGroupsForThingInput(v *UpdateThi return nil } +type awsRestjson1_serializeOpUpdateThingType struct { +} + +func (*awsRestjson1_serializeOpUpdateThingType) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateThingType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateThingTypeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/thing-types/{thingTypeName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateThingTypeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateThingTypeInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateThingTypeInput(v *UpdateThingTypeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ThingTypeName == nil || len(*v.ThingTypeName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member thingTypeName must not be empty")} + } + if v.ThingTypeName != nil { + if err := encoder.SetURI("thingTypeName").String(*v.ThingTypeName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateThingTypeInput(v *UpdateThingTypeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ThingTypeProperties != nil { + ok := object.Key("thingTypeProperties") + if err := awsRestjson1_serializeDocumentThingTypeProperties(v.ThingTypeProperties, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateTopicRuleDestination struct { } @@ -24605,6 +24867,20 @@ func awsRestjson1_serializeDocumentMitigationActionParams(v *types.MitigationAct return nil } +func awsRestjson1_serializeDocumentMqtt5Configuration(v *types.Mqtt5Configuration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PropagatingAttributes != nil { + ok := object.Key("propagatingAttributes") + if err := awsRestjson1_serializeDocumentPropagatingAttributeList(v.PropagatingAttributes, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentMqttContext(v *types.MqttContext, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -24905,6 +25181,41 @@ func awsRestjson1_serializeDocumentPresignedUrlConfig(v *types.PresignedUrlConfi return nil } +func awsRestjson1_serializeDocumentPropagatingAttribute(v *types.PropagatingAttribute, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectionAttribute != nil { + ok := object.Key("connectionAttribute") + ok.String(*v.ConnectionAttribute) + } + + if v.ThingAttribute != nil { + ok := object.Key("thingAttribute") + ok.String(*v.ThingAttribute) + } + + if v.UserPropertyKey != nil { + ok := object.Key("userPropertyKey") + ok.String(*v.UserPropertyKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentPropagatingAttributeList(v []types.PropagatingAttribute, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPropagatingAttribute(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentProtocols(v []types.Protocol, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -25387,6 +25698,16 @@ func awsRestjson1_serializeDocumentServerCertificateConfig(v *types.ServerCertif ok.Boolean(*v.EnableOCSPCheck) } + if v.OcspAuthorizedResponderArn != nil { + ok := object.Key("ocspAuthorizedResponderArn") + ok.String(*v.OcspAuthorizedResponderArn) + } + + if v.OcspLambdaArn != nil { + ok := object.Key("ocspLambdaArn") + ok.String(*v.OcspLambdaArn) + } + return nil } @@ -25825,6 +26146,13 @@ func awsRestjson1_serializeDocumentThingTypeProperties(v *types.ThingTypePropert object := value.Object() defer object.Close() + if v.Mqtt5Configuration != nil { + ok := object.Key("mqtt5Configuration") + if err := awsRestjson1_serializeDocumentMqtt5Configuration(v.Mqtt5Configuration, ok); err != nil { + return err + } + } + if v.SearchableAttributes != nil { ok := object.Key("searchableAttributes") if err := awsRestjson1_serializeDocumentSearchableAttributes(v.SearchableAttributes, ok); err != nil { diff --git a/service/iot/snapshot/api_op_ListPrincipalThingsV2.go.snap b/service/iot/snapshot/api_op_ListPrincipalThingsV2.go.snap new file mode 100644 index 00000000000..43ceb6bbdaa --- /dev/null +++ b/service/iot/snapshot/api_op_ListPrincipalThingsV2.go.snap @@ -0,0 +1,41 @@ +ListPrincipalThingsV2 + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_ListThingPrincipalsV2.go.snap b/service/iot/snapshot/api_op_ListThingPrincipalsV2.go.snap new file mode 100644 index 00000000000..56c02d3d264 --- /dev/null +++ b/service/iot/snapshot/api_op_ListThingPrincipalsV2.go.snap @@ -0,0 +1,41 @@ +ListThingPrincipalsV2 + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_UpdateThingType.go.snap b/service/iot/snapshot/api_op_UpdateThingType.go.snap new file mode 100644 index 00000000000..2b5ce37bc8f --- /dev/null +++ b/service/iot/snapshot/api_op_UpdateThingType.go.snap @@ -0,0 +1,41 @@ +UpdateThingType + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot_test.go b/service/iot/snapshot_test.go index f692d8ba36b..1838f2f1f38 100644 --- a/service/iot/snapshot_test.go +++ b/service/iot/snapshot_test.go @@ -2210,6 +2210,18 @@ func TestCheckSnapshot_ListPrincipalThings(t *testing.T) { } } +func TestCheckSnapshot_ListPrincipalThingsV2(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPrincipalThingsV2(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListPrincipalThingsV2") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListProvisioningTemplates(t *testing.T) { svc := New(Options{}) _, err := svc.ListProvisioningTemplates(context.Background(), nil, func(o *Options) { @@ -2390,6 +2402,18 @@ func TestCheckSnapshot_ListThingPrincipals(t *testing.T) { } } +func TestCheckSnapshot_ListThingPrincipalsV2(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListThingPrincipalsV2(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListThingPrincipalsV2") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListThingRegistrationTaskReports(t *testing.T) { svc := New(Options{}) _, err := svc.ListThingRegistrationTaskReports(context.Background(), nil, func(o *Options) { @@ -3134,6 +3158,18 @@ func TestCheckSnapshot_UpdateThingGroupsForThing(t *testing.T) { } } +func TestCheckSnapshot_UpdateThingType(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateThingType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateThingType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateTopicRuleDestination(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateTopicRuleDestination(context.Background(), nil, func(o *Options) { @@ -5305,6 +5341,18 @@ func TestUpdateSnapshot_ListPrincipalThings(t *testing.T) { } } +func TestUpdateSnapshot_ListPrincipalThingsV2(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPrincipalThingsV2(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListPrincipalThingsV2") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListProvisioningTemplates(t *testing.T) { svc := New(Options{}) _, err := svc.ListProvisioningTemplates(context.Background(), nil, func(o *Options) { @@ -5485,6 +5533,18 @@ func TestUpdateSnapshot_ListThingPrincipals(t *testing.T) { } } +func TestUpdateSnapshot_ListThingPrincipalsV2(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListThingPrincipalsV2(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListThingPrincipalsV2") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListThingRegistrationTaskReports(t *testing.T) { svc := New(Options{}) _, err := svc.ListThingRegistrationTaskReports(context.Background(), nil, func(o *Options) { @@ -6229,6 +6289,18 @@ func TestUpdateSnapshot_UpdateThingGroupsForThing(t *testing.T) { } } +func TestUpdateSnapshot_UpdateThingType(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateThingType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateThingType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateTopicRuleDestination(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateTopicRuleDestination(context.Background(), nil, func(o *Options) { diff --git a/service/iot/types/enums.go b/service/iot/types/enums.go index 7645fae7d62..31654bc4866 100644 --- a/service/iot/types/enums.go +++ b/service/iot/types/enums.go @@ -1675,6 +1675,25 @@ func (ThingIndexingMode) Values() []ThingIndexingMode { } } +type ThingPrincipalType string + +// Enum values for ThingPrincipalType +const ( + ThingPrincipalTypeExclusiveThing ThingPrincipalType = "EXCLUSIVE_THING" + ThingPrincipalTypeNonExclusiveThing ThingPrincipalType = "NON_EXCLUSIVE_THING" +) + +// Values returns all known values for ThingPrincipalType. 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 (ThingPrincipalType) Values() []ThingPrincipalType { + return []ThingPrincipalType{ + "EXCLUSIVE_THING", + "NON_EXCLUSIVE_THING", + } +} + type TopicRuleDestinationStatus string // Enum values for TopicRuleDestinationStatus diff --git a/service/iot/types/types.go b/service/iot/types/types.go index a9304af4c0a..82f72bc1dd5 100644 --- a/service/iot/types/types.go +++ b/service/iot/types/types.go @@ -2769,6 +2769,16 @@ type MitigationActionParams struct { noSmithyDocumentSerde } +// The configuration to add user-defined properties to enrich MQTT 5 messages. +type Mqtt5Configuration struct { + + // An object that represents the propagating thing attributes and the connection + // attributes. + PropagatingAttributes []PropagatingAttribute + + noSmithyDocumentSerde +} + // Specifies the MQTT context to use for the test authorizer request type MqttContext struct { @@ -3151,6 +3161,46 @@ type PresignedUrlConfig struct { noSmithyDocumentSerde } +// An object that represents the thing and the type of relation it has with the +// principal. +type PrincipalThingObject struct { + + // The name of the thing. + // + // This member is required. + ThingName *string + + // The type of the relation you want to specify when you attach a principal to a + // thing. The value defaults to NON_EXCLUSIVE_THING . + // + // - EXCLUSIVE_THING - Attaches the specified principal to the specified thing, + // exclusively. The thing will be the only thing that’s attached to the principal. + // + // - NON_EXCLUSIVE_THING - Attaches the specified principal to the specified + // thing. Multiple things can be attached to the principal. + ThingPrincipalType ThingPrincipalType + + noSmithyDocumentSerde +} + +// An object that represents the connection attribute, thing attribute, and the +// user property key. +type PropagatingAttribute struct { + + // The attribute associated with the connection between a device and Amazon Web + // Services IoT Core. + ConnectionAttribute *string + + // The user-defined thing attribute that is propagating for MQTT 5 message + // enrichment. + ThingAttribute *string + + // The key of the user property key-value pair. + UserPropertyKey *string + + noSmithyDocumentSerde +} + // Structure that contains payloadVersion and targetArn . type ProvisioningHook struct { @@ -3664,11 +3714,31 @@ type ServerCertificateConfig struct { // A Boolean value that indicates whether Online Certificate Status Protocol // (OCSP) server certificate check is enabled or not. // - // For more information, see [Configuring OCSP server-certificate stapling in domain configuration] from Amazon Web Services IoT Core Developer Guide. + // For more information, see [Server certificate configuration for OCSP stapling] from Amazon Web Services IoT Core Developer Guide. // - // [Configuring OCSP server-certificate stapling in domain configuration]: https://docs.aws.amazon.com/iot/latest/developerguide/iot-custom-endpoints-cert-config.html + // [Server certificate configuration for OCSP stapling]: https://docs.aws.amazon.com/iot/latest/developerguide/iot-custom-endpoints-cert-config.html EnableOCSPCheck *bool + // The Amazon Resource Name (ARN) for an X.509 certificate stored in Amazon Web + // Services Certificate Manager (ACM). If provided, Amazon Web Services IoT Core + // will use this certificate to validate the signature of the received OCSP + // response. The OCSP responder must sign responses using either this authorized + // responder certificate or the issuing certificate, depending on whether the ARN + // is provided or not. The certificate must be in the same Amazon Web Services + // region and account as the domain configuration. + OcspAuthorizedResponderArn *string + + // The Amazon Resource Name (ARN) for a Lambda function that acts as a Request for + // Comments (RFC) 6960-compliant Online Certificate Status Protocol (OCSP) + // responder, supporting basic OCSP responses. The Lambda function accepts a JSON + // string that's Base64-encoded. Therefore, you must convert your OCSP response, + // which is typically in the Distinguished Encoding Rules (DER) format, into a JSON + // string that's Base64-encoded. The Lambda function's response is also a + // Base64-encoded JSON string and the response payload must not exceed 8 kilobytes + // (KiB) in size. The Lambda function must be in the same Amazon Web Services + // region and account as the domain configuration. + OcspLambdaArn *string + noSmithyDocumentSerde } @@ -4243,6 +4313,28 @@ type ThingIndexingConfiguration struct { noSmithyDocumentSerde } +// An object that represents the principal and the type of relation it has with +// the thing. +type ThingPrincipalObject struct { + + // The principal of the thing principal object. + // + // This member is required. + Principal *string + + // The type of the relation you want to specify when you attach a principal to a + // thing. The value defaults to NON_EXCLUSIVE_THING . + // + // - EXCLUSIVE_THING - Attaches the specified principal to the specified thing, + // exclusively. The thing will be the only thing that’s attached to the principal. + // + // - NON_EXCLUSIVE_THING - Attaches the specified principal to the specified + // thing. Multiple things can be attached to the principal. + ThingPrincipalType ThingPrincipalType + + noSmithyDocumentSerde +} + // The definition of the thing type, including thing type name and description. type ThingTypeDefinition struct { @@ -4285,6 +4377,9 @@ type ThingTypeMetadata struct { // thing type description, and a list of searchable thing attribute names. type ThingTypeProperties struct { + // The configuration to add user-defined properties to enrich MQTT 5 messages. + Mqtt5Configuration *Mqtt5Configuration + // A list of searchable thing attribute names. SearchableAttributes []string diff --git a/service/iot/validators.go b/service/iot/validators.go index 2c11bd94cac..8706bba8778 100644 --- a/service/iot/validators.go +++ b/service/iot/validators.go @@ -2810,6 +2810,26 @@ func (m *validateOpListPrincipalThings) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListPrincipalThingsV2 struct { +} + +func (*validateOpListPrincipalThingsV2) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListPrincipalThingsV2) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListPrincipalThingsV2Input) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListPrincipalThingsV2Input(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListProvisioningTemplateVersions struct { } @@ -2990,6 +3010,26 @@ func (m *validateOpListThingPrincipals) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListThingPrincipalsV2 struct { +} + +func (*validateOpListThingPrincipalsV2) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListThingPrincipalsV2) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListThingPrincipalsV2Input) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListThingPrincipalsV2Input(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListThingRegistrationTaskReports struct { } @@ -3970,6 +4010,26 @@ func (m *validateOpUpdateThing) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpUpdateThingType struct { +} + +func (*validateOpUpdateThingType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateThingType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateThingTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateThingTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateTopicRuleDestination struct { } @@ -4570,6 +4630,10 @@ func addOpListPrincipalThingsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListPrincipalThings{}, middleware.After) } +func addOpListPrincipalThingsV2ValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListPrincipalThingsV2{}, middleware.After) +} + func addOpListProvisioningTemplateVersionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListProvisioningTemplateVersions{}, middleware.After) } @@ -4606,6 +4670,10 @@ func addOpListThingPrincipalsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListThingPrincipals{}, middleware.After) } +func addOpListThingPrincipalsV2ValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListThingPrincipalsV2{}, middleware.After) +} + func addOpListThingRegistrationTaskReportsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListThingRegistrationTaskReports{}, middleware.After) } @@ -4802,6 +4870,10 @@ func addOpUpdateThingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateThing{}, middleware.After) } +func addOpUpdateThingTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateThingType{}, middleware.After) +} + func addOpUpdateTopicRuleDestinationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateTopicRuleDestination{}, middleware.After) } @@ -9140,6 +9212,21 @@ func validateOpListPrincipalThingsInput(v *ListPrincipalThingsInput) error { } } +func validateOpListPrincipalThingsV2Input(v *ListPrincipalThingsV2Input) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListPrincipalThingsV2Input"} + if v.Principal == nil { + invalidParams.Add(smithy.NewErrParamRequired("Principal")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListProvisioningTemplateVersionsInput(v *ListProvisioningTemplateVersionsInput) error { if v == nil { return nil @@ -9278,6 +9365,21 @@ func validateOpListThingPrincipalsInput(v *ListThingPrincipalsInput) error { } } +func validateOpListThingPrincipalsV2Input(v *ListThingPrincipalsV2Input) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListThingPrincipalsV2Input"} + if v.ThingName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ThingName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListThingRegistrationTaskReportsInput(v *ListThingRegistrationTaskReportsInput) error { if v == nil { return nil @@ -10181,6 +10283,21 @@ func validateOpUpdateThingInput(v *UpdateThingInput) error { } } +func validateOpUpdateThingTypeInput(v *UpdateThingTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateThingTypeInput"} + if v.ThingTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ThingTypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateTopicRuleDestinationInput(v *UpdateTopicRuleDestinationInput) error { if v == nil { return nil diff --git a/service/outposts/types/enums.go b/service/outposts/types/enums.go index b849e7837f0..bdd1e19de2a 100644 --- a/service/outposts/types/enums.go +++ b/service/outposts/types/enums.go @@ -400,6 +400,7 @@ type PaymentTerm string const ( PaymentTermThreeYears PaymentTerm = "THREE_YEARS" PaymentTermOneYear PaymentTerm = "ONE_YEAR" + PaymentTermFiveYears PaymentTerm = "FIVE_YEARS" ) // Values returns all known values for PaymentTerm. Note that this can be expanded @@ -410,6 +411,7 @@ func (PaymentTerm) Values() []PaymentTerm { return []PaymentTerm{ "THREE_YEARS", "ONE_YEAR", + "FIVE_YEARS", } } diff --git a/service/pinpointsmsvoicev2/api_op_DeleteConfigurationSet.go b/service/pinpointsmsvoicev2/api_op_DeleteConfigurationSet.go index ab736f3ddbc..395b122b585 100644 --- a/service/pinpointsmsvoicev2/api_op_DeleteConfigurationSet.go +++ b/service/pinpointsmsvoicev2/api_op_DeleteConfigurationSet.go @@ -57,6 +57,10 @@ type DeleteConfigurationSetOutput struct { // [UNIX epoch time]: https://www.epochconverter.com/ CreatedTimestamp *time.Time + // True if the configuration set has message feedback enabled. By default this is + // set to false. + DefaultMessageFeedbackEnabled *bool + // The default message type of the configuration set that was deleted. DefaultMessageType types.MessageType diff --git a/service/pinpointsmsvoicev2/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go b/service/pinpointsmsvoicev2/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go new file mode 100644 index 00000000000..dafe7d0066b --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Permanently delete the protect configuration rule set number override. +func (c *Client) DeleteProtectConfigurationRuleSetNumberOverride(ctx context.Context, params *DeleteProtectConfigurationRuleSetNumberOverrideInput, optFns ...func(*Options)) (*DeleteProtectConfigurationRuleSetNumberOverrideOutput, error) { + if params == nil { + params = &DeleteProtectConfigurationRuleSetNumberOverrideInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProtectConfigurationRuleSetNumberOverride", params, optFns, c.addOperationDeleteProtectConfigurationRuleSetNumberOverrideMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProtectConfigurationRuleSetNumberOverrideOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProtectConfigurationRuleSetNumberOverrideInput struct { + + // The destination phone number in E.164 format. + // + // This member is required. + DestinationPhoneNumber *string + + // The unique identifier for the protect configuration. + // + // This member is required. + ProtectConfigurationId *string + + noSmithyDocumentSerde +} + +type DeleteProtectConfigurationRuleSetNumberOverrideOutput struct { + + // The action associated with the rule. + // + // This member is required. + Action types.ProtectConfigurationRuleOverrideAction + + // The time when the rule was created, in [UNIX epoch time] format. + // + // [UNIX epoch time]: https://www.epochconverter.com/ + // + // This member is required. + CreatedTimestamp *time.Time + + // The destination phone number in E.164 format. + // + // This member is required. + DestinationPhoneNumber *string + + // The Amazon Resource Name (ARN) of the protect configuration. + // + // This member is required. + ProtectConfigurationArn *string + + // The unique identifier for the protect configuration. + // + // This member is required. + ProtectConfigurationId *string + + // The time when the resource-based policy was created, in [UNIX epoch time] format. + // + // [UNIX epoch time]: https://www.epochconverter.com/ + ExpirationTimestamp *time.Time + + // The two-character code, in ISO 3166-1 alpha-2 format, for the country or region. + IsoCountryCode *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteProtectConfigurationRuleSetNumberOverrideMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteProtectConfigurationRuleSetNumberOverride{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteProtectConfigurationRuleSetNumberOverride{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteProtectConfigurationRuleSetNumberOverride"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteProtectConfigurationRuleSetNumberOverrideValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProtectConfigurationRuleSetNumberOverride(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteProtectConfigurationRuleSetNumberOverride(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteProtectConfigurationRuleSetNumberOverride", + } +} diff --git a/service/pinpointsmsvoicev2/api_op_DescribeVerifiedDestinationNumbers.go b/service/pinpointsmsvoicev2/api_op_DescribeVerifiedDestinationNumbers.go index e79617743ad..f1e33c2ca41 100644 --- a/service/pinpointsmsvoicev2/api_op_DescribeVerifiedDestinationNumbers.go +++ b/service/pinpointsmsvoicev2/api_op_DescribeVerifiedDestinationNumbers.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the specified verified destiona numbers. +// Retrieves the specified verified destination numbers. func (c *Client) DescribeVerifiedDestinationNumbers(ctx context.Context, params *DescribeVerifiedDestinationNumbersInput, optFns ...func(*Options)) (*DescribeVerifiedDestinationNumbersOutput, error) { if params == nil { params = &DescribeVerifiedDestinationNumbersInput{} @@ -42,7 +42,7 @@ type DescribeVerifiedDestinationNumbersInput struct { // supply a value for this field in the initial request. NextToken *string - // An array of VerifiedDestinationNumberid to retreive. + // An array of VerifiedDestinationNumberid to retrieve. VerifiedDestinationNumberIds []string noSmithyDocumentSerde diff --git a/service/pinpointsmsvoicev2/api_op_ListProtectConfigurationRuleSetNumberOverrides.go b/service/pinpointsmsvoicev2/api_op_ListProtectConfigurationRuleSetNumberOverrides.go new file mode 100644 index 00000000000..da33b01bad9 --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_ListProtectConfigurationRuleSetNumberOverrides.go @@ -0,0 +1,279 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieve all of the protect configuration rule set number overrides that match +// the filters. +func (c *Client) ListProtectConfigurationRuleSetNumberOverrides(ctx context.Context, params *ListProtectConfigurationRuleSetNumberOverridesInput, optFns ...func(*Options)) (*ListProtectConfigurationRuleSetNumberOverridesOutput, error) { + if params == nil { + params = &ListProtectConfigurationRuleSetNumberOverridesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProtectConfigurationRuleSetNumberOverrides", params, optFns, c.addOperationListProtectConfigurationRuleSetNumberOverridesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProtectConfigurationRuleSetNumberOverridesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProtectConfigurationRuleSetNumberOverridesInput struct { + + // The unique identifier for the protect configuration. + // + // This member is required. + ProtectConfigurationId *string + + // An array of ProtectConfigurationRuleSetNumberOverrideFilterItem objects to + // filter the results. + Filters []types.ProtectConfigurationRuleSetNumberOverrideFilterItem + + // The maximum number of results to return per each request. + MaxResults *int32 + + // The token to be used for the next set of paginated results. You don't need to + // supply a value for this field in the initial request. + NextToken *string + + noSmithyDocumentSerde +} + +type ListProtectConfigurationRuleSetNumberOverridesOutput struct { + + // The Amazon Resource Name (ARN) of the protect configuration. + // + // This member is required. + ProtectConfigurationArn *string + + // The unique identifier for the protect configuration. + // + // This member is required. + ProtectConfigurationId *string + + // The token to be used for the next set of paginated results. You don't need to + // supply a value for this field in the initial request. + NextToken *string + + // An array of RuleSetNumberOverrides objects. + RuleSetNumberOverrides []types.ProtectConfigurationRuleSetNumberOverride + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListProtectConfigurationRuleSetNumberOverridesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListProtectConfigurationRuleSetNumberOverrides{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListProtectConfigurationRuleSetNumberOverrides{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListProtectConfigurationRuleSetNumberOverrides"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListProtectConfigurationRuleSetNumberOverridesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProtectConfigurationRuleSetNumberOverrides(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListProtectConfigurationRuleSetNumberOverridesPaginatorOptions is the paginator +// options for ListProtectConfigurationRuleSetNumberOverrides +type ListProtectConfigurationRuleSetNumberOverridesPaginatorOptions struct { + // The maximum number of results to return per each request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListProtectConfigurationRuleSetNumberOverridesPaginator is a paginator for +// ListProtectConfigurationRuleSetNumberOverrides +type ListProtectConfigurationRuleSetNumberOverridesPaginator struct { + options ListProtectConfigurationRuleSetNumberOverridesPaginatorOptions + client ListProtectConfigurationRuleSetNumberOverridesAPIClient + params *ListProtectConfigurationRuleSetNumberOverridesInput + nextToken *string + firstPage bool +} + +// NewListProtectConfigurationRuleSetNumberOverridesPaginator returns a new +// ListProtectConfigurationRuleSetNumberOverridesPaginator +func NewListProtectConfigurationRuleSetNumberOverridesPaginator(client ListProtectConfigurationRuleSetNumberOverridesAPIClient, params *ListProtectConfigurationRuleSetNumberOverridesInput, optFns ...func(*ListProtectConfigurationRuleSetNumberOverridesPaginatorOptions)) *ListProtectConfigurationRuleSetNumberOverridesPaginator { + if params == nil { + params = &ListProtectConfigurationRuleSetNumberOverridesInput{} + } + + options := ListProtectConfigurationRuleSetNumberOverridesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListProtectConfigurationRuleSetNumberOverridesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProtectConfigurationRuleSetNumberOverridesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProtectConfigurationRuleSetNumberOverrides page. +func (p *ListProtectConfigurationRuleSetNumberOverridesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProtectConfigurationRuleSetNumberOverridesOutput, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListProtectConfigurationRuleSetNumberOverrides(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 +} + +// ListProtectConfigurationRuleSetNumberOverridesAPIClient is a client that +// implements the ListProtectConfigurationRuleSetNumberOverrides operation. +type ListProtectConfigurationRuleSetNumberOverridesAPIClient interface { + ListProtectConfigurationRuleSetNumberOverrides(context.Context, *ListProtectConfigurationRuleSetNumberOverridesInput, ...func(*Options)) (*ListProtectConfigurationRuleSetNumberOverridesOutput, error) +} + +var _ ListProtectConfigurationRuleSetNumberOverridesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListProtectConfigurationRuleSetNumberOverrides(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListProtectConfigurationRuleSetNumberOverrides", + } +} diff --git a/service/pinpointsmsvoicev2/api_op_ListRegistrationAssociations.go b/service/pinpointsmsvoicev2/api_op_ListRegistrationAssociations.go index 04f33e6f7b3..c7878220dff 100644 --- a/service/pinpointsmsvoicev2/api_op_ListRegistrationAssociations.go +++ b/service/pinpointsmsvoicev2/api_op_ListRegistrationAssociations.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retreive all of the origination identies that are associated with a +// Retrieve all of the origination identities that are associated with a // registration. func (c *Client) ListRegistrationAssociations(ctx context.Context, params *ListRegistrationAssociationsInput, optFns ...func(*Options)) (*ListRegistrationAssociationsOutput, error) { if params == nil { diff --git a/service/pinpointsmsvoicev2/api_op_PutMessageFeedback.go b/service/pinpointsmsvoicev2/api_op_PutMessageFeedback.go new file mode 100644 index 00000000000..b06d51efa41 --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_PutMessageFeedback.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Set the MessageFeedbackStatus as RECEIVED or FAILED for the passed in +// MessageId. +// +// If you use message feedback then you must update message feedback record. When +// you receive a signal that a user has received the message you must use +// PutMessageFeedback to set the message feedback record as RECEIVED ; Otherwise, +// an hour after the message feedback record is set to FAILED . +func (c *Client) PutMessageFeedback(ctx context.Context, params *PutMessageFeedbackInput, optFns ...func(*Options)) (*PutMessageFeedbackOutput, error) { + if params == nil { + params = &PutMessageFeedbackInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutMessageFeedback", params, optFns, c.addOperationPutMessageFeedbackMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutMessageFeedbackOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutMessageFeedbackInput struct { + + // Set the message feedback to be either RECEIVED or FAILED . + // + // This member is required. + MessageFeedbackStatus types.MessageFeedbackStatus + + // The unique identifier for the message. + // + // This member is required. + MessageId *string + + noSmithyDocumentSerde +} + +type PutMessageFeedbackOutput struct { + + // The current status of the message. + // + // This member is required. + MessageFeedbackStatus types.MessageFeedbackStatus + + // The unique identifier for the message. + // + // This member is required. + MessageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutMessageFeedbackMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpPutMessageFeedback{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPutMessageFeedback{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutMessageFeedback"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPutMessageFeedbackValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutMessageFeedback(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutMessageFeedback(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutMessageFeedback", + } +} diff --git a/service/pinpointsmsvoicev2/api_op_PutProtectConfigurationRuleSetNumberOverride.go b/service/pinpointsmsvoicev2/api_op_PutProtectConfigurationRuleSetNumberOverride.go new file mode 100644 index 00000000000..b82e28fa515 --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_PutProtectConfigurationRuleSetNumberOverride.go @@ -0,0 +1,245 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Create or update a RuleSetNumberOverride and associate it with a protect +// configuration. +func (c *Client) PutProtectConfigurationRuleSetNumberOverride(ctx context.Context, params *PutProtectConfigurationRuleSetNumberOverrideInput, optFns ...func(*Options)) (*PutProtectConfigurationRuleSetNumberOverrideOutput, error) { + if params == nil { + params = &PutProtectConfigurationRuleSetNumberOverrideInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutProtectConfigurationRuleSetNumberOverride", params, optFns, c.addOperationPutProtectConfigurationRuleSetNumberOverrideMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutProtectConfigurationRuleSetNumberOverrideOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutProtectConfigurationRuleSetNumberOverrideInput struct { + + // The action for the rule to either block or allow messages to the destination + // phone number. + // + // This member is required. + Action types.ProtectConfigurationRuleOverrideAction + + // The destination phone number in E.164 format. + // + // This member is required. + DestinationPhoneNumber *string + + // The unique identifier for the protect configuration. + // + // This member is required. + ProtectConfigurationId *string + + // Unique, case-sensitive identifier that you provide to ensure the idempotency of + // the request. If you don't specify a client token, a randomly generated token is + // used for the request to ensure idempotency. + ClientToken *string + + // The time the rule will expire at. If ExpirationTimestamp is not set then the + // rule does not expire. + ExpirationTimestamp *time.Time + + noSmithyDocumentSerde +} + +type PutProtectConfigurationRuleSetNumberOverrideOutput struct { + + // The action for the rule to take. + // + // This member is required. + Action types.ProtectConfigurationRuleOverrideAction + + // The time when the rule was created, in [UNIX epoch time] format. + // + // [UNIX epoch time]: https://www.epochconverter.com/ + // + // This member is required. + CreatedTimestamp *time.Time + + // The destination phone number in E.164 format. + // + // This member is required. + DestinationPhoneNumber *string + + // The Amazon Resource Name (ARN) of the protect configuration. + // + // This member is required. + ProtectConfigurationArn *string + + // The unique identifier for the protect configuration. + // + // This member is required. + ProtectConfigurationId *string + + // The time the rule will expire at. + ExpirationTimestamp *time.Time + + // The two-character code, in ISO 3166-1 alpha-2 format, for the country or region. + IsoCountryCode *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutProtectConfigurationRuleSetNumberOverrideMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpPutProtectConfigurationRuleSetNumberOverride{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPutProtectConfigurationRuleSetNumberOverride{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutProtectConfigurationRuleSetNumberOverride"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opPutProtectConfigurationRuleSetNumberOverrideMiddleware(stack, options); err != nil { + return err + } + if err = addOpPutProtectConfigurationRuleSetNumberOverrideValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutProtectConfigurationRuleSetNumberOverride(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpPutProtectConfigurationRuleSetNumberOverride struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpPutProtectConfigurationRuleSetNumberOverride) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpPutProtectConfigurationRuleSetNumberOverride) 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.(*PutProtectConfigurationRuleSetNumberOverrideInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *PutProtectConfigurationRuleSetNumberOverrideInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opPutProtectConfigurationRuleSetNumberOverrideMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpPutProtectConfigurationRuleSetNumberOverride{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opPutProtectConfigurationRuleSetNumberOverride(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutProtectConfigurationRuleSetNumberOverride", + } +} diff --git a/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go b/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go index ab6b1244e42..e4801085184 100644 --- a/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go +++ b/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go @@ -72,10 +72,14 @@ type SendMediaMessageInput struct { // The text body of the message. MessageBody *string + // Set to true to enable message feedback for the message. When a user receives + // the message you need to update the message status using PutMessageFeedback. + MessageFeedbackEnabled *bool + // The unique identifier of the protect configuration to use. ProtectConfigurationId *string - // How long the text message is valid for. By default this is 72 hours. + // How long the media message is valid for. By default this is 72 hours. TimeToLive *int32 noSmithyDocumentSerde diff --git a/service/pinpointsmsvoicev2/api_op_SendTextMessage.go b/service/pinpointsmsvoicev2/api_op_SendTextMessage.go index 84010e8054c..2c58f06c81c 100644 --- a/service/pinpointsmsvoicev2/api_op_SendTextMessage.go +++ b/service/pinpointsmsvoicev2/api_op_SendTextMessage.go @@ -91,6 +91,10 @@ type SendTextMessageInput struct { // The body of the text message. MessageBody *string + // Set to true to enable message feedback for the message. When a user receives + // the message you need to update the message status using PutMessageFeedback. + MessageFeedbackEnabled *bool + // The type of message. Valid values are for messages that are critical or // time-sensitive and PROMOTIONAL for messages that aren't critical or // time-sensitive. diff --git a/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go b/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go index 307b8025ddb..54f76464387 100644 --- a/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go +++ b/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go @@ -74,6 +74,10 @@ type SendVoiceMessageInput struct { // [speech synthesis markup language (SSML)]: https://docs.aws.amazon.com/polly/latest/dg/what-is.html MessageBodyTextType types.VoiceMessageBodyTextType + // Set to true to enable message feedback for the message. When a user receives + // the message you need to update the message status using PutMessageFeedback. + MessageFeedbackEnabled *bool + // The unique identifier for the protect configuration. ProtectConfigurationId *string diff --git a/service/pinpointsmsvoicev2/api_op_SetDefaultMessageFeedbackEnabled.go b/service/pinpointsmsvoicev2/api_op_SetDefaultMessageFeedbackEnabled.go new file mode 100644 index 00000000000..178685bf162 --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_SetDefaultMessageFeedbackEnabled.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +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 a configuration set's default for message feedback. +func (c *Client) SetDefaultMessageFeedbackEnabled(ctx context.Context, params *SetDefaultMessageFeedbackEnabledInput, optFns ...func(*Options)) (*SetDefaultMessageFeedbackEnabledOutput, error) { + if params == nil { + params = &SetDefaultMessageFeedbackEnabledInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetDefaultMessageFeedbackEnabled", params, optFns, c.addOperationSetDefaultMessageFeedbackEnabledMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetDefaultMessageFeedbackEnabledOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SetDefaultMessageFeedbackEnabledInput struct { + + // The name of the configuration set to use. This can be either the + // ConfigurationSetName or ConfigurationSetArn. + // + // This member is required. + ConfigurationSetName *string + + // Set to true to enable message feedback. + // + // This member is required. + MessageFeedbackEnabled *bool + + noSmithyDocumentSerde +} + +type SetDefaultMessageFeedbackEnabledOutput struct { + + // The arn of the configuration set. + ConfigurationSetArn *string + + // The name of the configuration. + ConfigurationSetName *string + + // True if message feedback is enabled. + MessageFeedbackEnabled *bool + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetDefaultMessageFeedbackEnabledMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpSetDefaultMessageFeedbackEnabled{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSetDefaultMessageFeedbackEnabled{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetDefaultMessageFeedbackEnabled"); 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 = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSetDefaultMessageFeedbackEnabledValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetDefaultMessageFeedbackEnabled(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 + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetDefaultMessageFeedbackEnabled(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetDefaultMessageFeedbackEnabled", + } +} diff --git a/service/pinpointsmsvoicev2/deserializers.go b/service/pinpointsmsvoicev2/deserializers.go index 394c6db2a4d..16f20bfaba8 100644 --- a/service/pinpointsmsvoicev2/deserializers.go +++ b/service/pinpointsmsvoicev2/deserializers.go @@ -2918,6 +2918,129 @@ func awsAwsjson10_deserializeOpErrorDeleteProtectConfiguration(response *smithyh } } +type awsAwsjson10_deserializeOpDeleteProtectConfigurationRuleSetNumberOverride struct { +} + +func (*awsAwsjson10_deserializeOpDeleteProtectConfigurationRuleSetNumberOverride) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteProtectConfigurationRuleSetNumberOverride) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_deserializeOpErrorDeleteProtectConfigurationRuleSetNumberOverride(response, &metadata) + } + output := &DeleteProtectConfigurationRuleSetNumberOverrideOutput{} + 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 = awsAwsjson10_deserializeOpDocumentDeleteProtectConfigurationRuleSetNumberOverrideOutput(&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 awsAwsjson10_deserializeOpErrorDeleteProtectConfigurationRuleSetNumberOverride(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("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpDeleteRegistration struct { } @@ -6851,14 +6974,14 @@ func awsAwsjson10_deserializeOpErrorListPoolOriginationIdentities(response *smit } } -type awsAwsjson10_deserializeOpListRegistrationAssociations struct { +type awsAwsjson10_deserializeOpListProtectConfigurationRuleSetNumberOverrides struct { } -func (*awsAwsjson10_deserializeOpListRegistrationAssociations) ID() string { +func (*awsAwsjson10_deserializeOpListProtectConfigurationRuleSetNumberOverrides) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListProtectConfigurationRuleSetNumberOverrides) 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) @@ -6876,9 +6999,9 @@ func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListProtectConfigurationRuleSetNumberOverrides(response, &metadata) } - output := &ListRegistrationAssociationsOutput{} + output := &ListProtectConfigurationRuleSetNumberOverridesOutput{} out.Result = output var buff [1024]byte @@ -6898,7 +7021,7 @@ func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeseriali return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListRegistrationAssociationsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListProtectConfigurationRuleSetNumberOverridesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6912,7 +7035,7 @@ func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeseriali return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListProtectConfigurationRuleSetNumberOverrides(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)} @@ -6974,14 +7097,14 @@ func awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response *smith } } -type awsAwsjson10_deserializeOpListTagsForResource struct { +type awsAwsjson10_deserializeOpListRegistrationAssociations struct { } -func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson10_deserializeOpListRegistrationAssociations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) 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) @@ -6999,9 +7122,9 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListRegistrationAssociationsOutput{} out.Result = output var buff [1024]byte @@ -7021,7 +7144,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListRegistrationAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7035,7 +7158,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListRegistrationAssociations(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)} @@ -7097,14 +7220,14 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpPutKeyword struct { +type awsAwsjson10_deserializeOpListTagsForResource struct { } -func (*awsAwsjson10_deserializeOpPutKeyword) ID() string { +func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7122,9 +7245,9 @@ func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutKeyword(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutKeywordOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -7144,7 +7267,7 @@ func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutKeywordOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7158,7 +7281,7 @@ func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutKeyword(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7198,18 +7321,12 @@ func awsAwsjson10_deserializeOpErrorPutKeyword(response *smithyhttp.Response, me case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -7226,14 +7343,14 @@ func awsAwsjson10_deserializeOpErrorPutKeyword(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpPutOptedOutNumber struct { +type awsAwsjson10_deserializeOpPutKeyword struct { } -func (*awsAwsjson10_deserializeOpPutOptedOutNumber) ID() string { +func (*awsAwsjson10_deserializeOpPutKeyword) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutKeyword) 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) @@ -7251,9 +7368,9 @@ func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutKeyword(response, &metadata) } - output := &PutOptedOutNumberOutput{} + output := &PutKeywordOutput{} out.Result = output var buff [1024]byte @@ -7273,7 +7390,7 @@ func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutOptedOutNumberOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutKeywordOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7287,7 +7404,7 @@ func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutKeyword(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)} @@ -7327,12 +7444,18 @@ func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -7349,14 +7472,14 @@ func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response *smithyhttp.Respo } } -type awsAwsjson10_deserializeOpPutRegistrationFieldValue struct { +type awsAwsjson10_deserializeOpPutMessageFeedback struct { } -func (*awsAwsjson10_deserializeOpPutRegistrationFieldValue) ID() string { +func (*awsAwsjson10_deserializeOpPutMessageFeedback) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutMessageFeedback) 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) @@ -7374,9 +7497,9 @@ func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutMessageFeedback(response, &metadata) } - output := &PutRegistrationFieldValueOutput{} + output := &PutMessageFeedbackOutput{} out.Result = output var buff [1024]byte @@ -7396,7 +7519,7 @@ func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize( return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutRegistrationFieldValueOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutMessageFeedbackOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7410,7 +7533,7 @@ func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize( return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutMessageFeedback(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)} @@ -7450,9 +7573,6 @@ func awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response *smithyht case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -7475,14 +7595,14 @@ func awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response *smithyht } } -type awsAwsjson10_deserializeOpPutResourcePolicy struct { +type awsAwsjson10_deserializeOpPutOptedOutNumber struct { } -func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string { +func (*awsAwsjson10_deserializeOpPutOptedOutNumber) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) 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) @@ -7500,9 +7620,9 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response, &metadata) } - output := &PutResourcePolicyOutput{} + output := &PutOptedOutNumberOutput{} out.Result = output var buff [1024]byte @@ -7522,7 +7642,7 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutOptedOutNumberOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7536,7 +7656,7 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(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)} @@ -7598,14 +7718,14 @@ func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } } -type awsAwsjson10_deserializeOpReleasePhoneNumber struct { +type awsAwsjson10_deserializeOpPutProtectConfigurationRuleSetNumberOverride struct { } -func (*awsAwsjson10_deserializeOpReleasePhoneNumber) ID() string { +func (*awsAwsjson10_deserializeOpPutProtectConfigurationRuleSetNumberOverride) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpReleasePhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutProtectConfigurationRuleSetNumberOverride) 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) @@ -7623,9 +7743,9 @@ func (m *awsAwsjson10_deserializeOpReleasePhoneNumber) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorReleasePhoneNumber(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutProtectConfigurationRuleSetNumberOverride(response, &metadata) } - output := &ReleasePhoneNumberOutput{} + output := &PutProtectConfigurationRuleSetNumberOverrideOutput{} out.Result = output var buff [1024]byte @@ -7645,7 +7765,7 @@ func (m *awsAwsjson10_deserializeOpReleasePhoneNumber) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentReleasePhoneNumberOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutProtectConfigurationRuleSetNumberOverrideOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7659,7 +7779,7 @@ func (m *awsAwsjson10_deserializeOpReleasePhoneNumber) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorReleasePhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutProtectConfigurationRuleSetNumberOverride(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)} @@ -7705,8 +7825,8 @@ func awsAwsjson10_deserializeOpErrorReleasePhoneNumber(response *smithyhttp.Resp case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -7724,14 +7844,14 @@ func awsAwsjson10_deserializeOpErrorReleasePhoneNumber(response *smithyhttp.Resp } } -type awsAwsjson10_deserializeOpReleaseSenderId struct { +type awsAwsjson10_deserializeOpPutRegistrationFieldValue struct { } -func (*awsAwsjson10_deserializeOpReleaseSenderId) ID() string { +func (*awsAwsjson10_deserializeOpPutRegistrationFieldValue) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpReleaseSenderId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) 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) @@ -7749,9 +7869,9 @@ func (m *awsAwsjson10_deserializeOpReleaseSenderId) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorReleaseSenderId(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response, &metadata) } - output := &ReleaseSenderIdOutput{} + output := &PutRegistrationFieldValueOutput{} out.Result = output var buff [1024]byte @@ -7771,7 +7891,7 @@ func (m *awsAwsjson10_deserializeOpReleaseSenderId) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentReleaseSenderIdOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutRegistrationFieldValueOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7785,7 +7905,7 @@ func (m *awsAwsjson10_deserializeOpReleaseSenderId) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson10_deserializeOpErrorReleaseSenderId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(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)} @@ -7850,14 +7970,14 @@ func awsAwsjson10_deserializeOpErrorReleaseSenderId(response *smithyhttp.Respons } } -type awsAwsjson10_deserializeOpRequestPhoneNumber struct { +type awsAwsjson10_deserializeOpPutResourcePolicy struct { } -func (*awsAwsjson10_deserializeOpRequestPhoneNumber) ID() string { +func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpRequestPhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_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) @@ -7875,9 +7995,9 @@ func (m *awsAwsjson10_deserializeOpRequestPhoneNumber) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorRequestPhoneNumber(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata) } - output := &RequestPhoneNumberOutput{} + output := &PutResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -7897,7 +8017,7 @@ func (m *awsAwsjson10_deserializeOpRequestPhoneNumber) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentRequestPhoneNumberOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7911,7 +8031,7 @@ func (m *awsAwsjson10_deserializeOpRequestPhoneNumber) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorRequestPhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_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)} @@ -7951,18 +8071,12 @@ func awsAwsjson10_deserializeOpErrorRequestPhoneNumber(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -7979,14 +8093,14 @@ func awsAwsjson10_deserializeOpErrorRequestPhoneNumber(response *smithyhttp.Resp } } -type awsAwsjson10_deserializeOpRequestSenderId struct { +type awsAwsjson10_deserializeOpReleasePhoneNumber struct { } -func (*awsAwsjson10_deserializeOpRequestSenderId) ID() string { +func (*awsAwsjson10_deserializeOpReleasePhoneNumber) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpRequestSenderId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpReleasePhoneNumber) 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) @@ -8004,9 +8118,390 @@ func (m *awsAwsjson10_deserializeOpRequestSenderId) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorRequestSenderId(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorReleasePhoneNumber(response, &metadata) } - output := &RequestSenderIdOutput{} + output := &ReleasePhoneNumberOutput{} + 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 = awsAwsjson10_deserializeOpDocumentReleasePhoneNumberOutput(&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 awsAwsjson10_deserializeOpErrorReleasePhoneNumber(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("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpReleaseSenderId struct { +} + +func (*awsAwsjson10_deserializeOpReleaseSenderId) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpReleaseSenderId) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_deserializeOpErrorReleaseSenderId(response, &metadata) + } + output := &ReleaseSenderIdOutput{} + 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 = awsAwsjson10_deserializeOpDocumentReleaseSenderIdOutput(&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 awsAwsjson10_deserializeOpErrorReleaseSenderId(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("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpRequestPhoneNumber struct { +} + +func (*awsAwsjson10_deserializeOpRequestPhoneNumber) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpRequestPhoneNumber) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_deserializeOpErrorRequestPhoneNumber(response, &metadata) + } + output := &RequestPhoneNumberOutput{} + 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 = awsAwsjson10_deserializeOpDocumentRequestPhoneNumberOutput(&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 awsAwsjson10_deserializeOpErrorRequestPhoneNumber(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("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpRequestSenderId struct { +} + +func (*awsAwsjson10_deserializeOpRequestSenderId) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpRequestSenderId) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_deserializeOpErrorRequestSenderId(response, &metadata) + } + output := &RequestSenderIdOutput{} out.Result = output var buff [1024]byte @@ -8410,7 +8905,136 @@ func (m *awsAwsjson10_deserializeOpSendTextMessage) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentSendTextMessageOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentSendTextMessageOutput(&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 awsAwsjson10_deserializeOpErrorSendTextMessage(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("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpSendVoiceMessage struct { +} + +func (*awsAwsjson10_deserializeOpSendVoiceMessage) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpSendVoiceMessage) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_deserializeOpErrorSendVoiceMessage(response, &metadata) + } + output := &SendVoiceMessageOutput{} + 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 = awsAwsjson10_deserializeOpDocumentSendVoiceMessageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8424,7 +9048,7 @@ func (m *awsAwsjson10_deserializeOpSendTextMessage) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson10_deserializeOpErrorSendTextMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorSendVoiceMessage(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)} @@ -8492,14 +9116,14 @@ func awsAwsjson10_deserializeOpErrorSendTextMessage(response *smithyhttp.Respons } } -type awsAwsjson10_deserializeOpSendVoiceMessage struct { +type awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration struct { } -func (*awsAwsjson10_deserializeOpSendVoiceMessage) ID() string { +func (*awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpSendVoiceMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration) 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) @@ -8517,9 +9141,9 @@ func (m *awsAwsjson10_deserializeOpSendVoiceMessage) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorSendVoiceMessage(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorSetAccountDefaultProtectConfiguration(response, &metadata) } - output := &SendVoiceMessageOutput{} + output := &SetAccountDefaultProtectConfigurationOutput{} out.Result = output var buff [1024]byte @@ -8539,7 +9163,7 @@ func (m *awsAwsjson10_deserializeOpSendVoiceMessage) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentSendVoiceMessageOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentSetAccountDefaultProtectConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8553,7 +9177,7 @@ func (m *awsAwsjson10_deserializeOpSendVoiceMessage) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson10_deserializeOpErrorSendVoiceMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorSetAccountDefaultProtectConfiguration(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)} @@ -8593,18 +9217,12 @@ func awsAwsjson10_deserializeOpErrorSendVoiceMessage(response *smithyhttp.Respon case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -8621,14 +9239,14 @@ func awsAwsjson10_deserializeOpErrorSendVoiceMessage(response *smithyhttp.Respon } } -type awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration struct { +type awsAwsjson10_deserializeOpSetDefaultMessageFeedbackEnabled struct { } -func (*awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration) ID() string { +func (*awsAwsjson10_deserializeOpSetDefaultMessageFeedbackEnabled) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpSetDefaultMessageFeedbackEnabled) 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) @@ -8646,9 +9264,9 @@ func (m *awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorSetAccountDefaultProtectConfiguration(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorSetDefaultMessageFeedbackEnabled(response, &metadata) } - output := &SetAccountDefaultProtectConfigurationOutput{} + output := &SetDefaultMessageFeedbackEnabledOutput{} out.Result = output var buff [1024]byte @@ -8668,7 +9286,7 @@ func (m *awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration) Handle return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentSetAccountDefaultProtectConfigurationOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentSetDefaultMessageFeedbackEnabledOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8682,7 +9300,7 @@ func (m *awsAwsjson10_deserializeOpSetAccountDefaultProtectConfiguration) Handle return out, metadata, err } -func awsAwsjson10_deserializeOpErrorSetAccountDefaultProtectConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorSetDefaultMessageFeedbackEnabled(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)} @@ -11180,6 +11798,15 @@ func awsAwsjson10_deserializeDocumentConfigurationSetInformation(v **types.Confi } } + case "DefaultMessageFeedbackEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.DefaultMessageFeedbackEnabled = ptr.Bool(jtv) + } + case "DefaultMessageType": if value != nil { jtv, ok := value.(string) @@ -12629,6 +13256,130 @@ func awsAwsjson10_deserializeDocumentProtectConfigurationInformationList(v *[]ty return nil } +func awsAwsjson10_deserializeDocumentProtectConfigurationRuleSetNumberOverride(v **types.ProtectConfigurationRuleSetNumberOverride, 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.ProtectConfigurationRuleSetNumberOverride + if *v == nil { + sv = &types.ProtectConfigurationRuleSetNumberOverride{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationRuleOverrideAction to be of type string, got %T instead", value) + } + sv.Action = types.ProtectConfigurationRuleOverrideAction(jtv) + } + + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DestinationPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + } + sv.DestinationPhoneNumber = ptr.String(jtv) + } + + case "ExpirationTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "IsoCountryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IsoCountryCode to be of type string, got %T instead", value) + } + sv.IsoCountryCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentProtectConfigurationRuleSetNumberOverrideList(v *[]types.ProtectConfigurationRuleSetNumberOverride, 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.ProtectConfigurationRuleSetNumberOverride + if *v == nil { + cv = []types.ProtectConfigurationRuleSetNumberOverride{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProtectConfigurationRuleSetNumberOverride + destAddr := &col + if err := awsAwsjson10_deserializeDocumentProtectConfigurationRuleSetNumberOverride(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentRegistrationAssociationMetadata(v **types.RegistrationAssociationMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16363,6 +17114,15 @@ func awsAwsjson10_deserializeOpDocumentDeleteConfigurationSetOutput(v **DeleteCo } } + case "DefaultMessageFeedbackEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.DefaultMessageFeedbackEnabled = ptr.Bool(jtv) + } + case "DefaultMessageType": if value != nil { jtv, ok := value.(string) @@ -17023,7 +17783,115 @@ func awsAwsjson10_deserializeOpDocumentDeleteProtectConfigurationOutput(v **Dele if !ok { return fmt.Errorf("expected PrimitiveBoolean to be of type *bool, got %T instead", value) } - sv.DeletionProtectionEnabled = jtv + sv.DeletionProtectionEnabled = jtv + } + + case "ProtectConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationArn to be of type string, got %T instead", value) + } + sv.ProtectConfigurationArn = ptr.String(jtv) + } + + case "ProtectConfigurationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationId to be of type string, got %T instead", value) + } + sv.ProtectConfigurationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDeleteProtectConfigurationRuleSetNumberOverrideOutput(v **DeleteProtectConfigurationRuleSetNumberOverrideOutput, 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 *DeleteProtectConfigurationRuleSetNumberOverrideOutput + if *v == nil { + sv = &DeleteProtectConfigurationRuleSetNumberOverrideOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationRuleOverrideAction to be of type string, got %T instead", value) + } + sv.Action = types.ProtectConfigurationRuleOverrideAction(jtv) + } + + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DestinationPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + } + sv.DestinationPhoneNumber = ptr.String(jtv) + } + + case "ExpirationTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "IsoCountryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IsoCountryCode to be of type string, got %T instead", value) + } + sv.IsoCountryCode = ptr.String(jtv) } case "ProtectConfigurationArn": @@ -18952,6 +19820,69 @@ func awsAwsjson10_deserializeOpDocumentListPoolOriginationIdentitiesOutput(v **L return nil } +func awsAwsjson10_deserializeOpDocumentListProtectConfigurationRuleSetNumberOverridesOutput(v **ListProtectConfigurationRuleSetNumberOverridesOutput, 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 *ListProtectConfigurationRuleSetNumberOverridesOutput + if *v == nil { + sv = &ListProtectConfigurationRuleSetNumberOverridesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ProtectConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationArn to be of type string, got %T instead", value) + } + sv.ProtectConfigurationArn = ptr.String(jtv) + } + + case "ProtectConfigurationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationId to be of type string, got %T instead", value) + } + sv.ProtectConfigurationId = ptr.String(jtv) + } + + case "RuleSetNumberOverrides": + if err := awsAwsjson10_deserializeDocumentProtectConfigurationRuleSetNumberOverrideList(&sv.RuleSetNumberOverrides, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListRegistrationAssociationsOutput(v **ListRegistrationAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19145,6 +20076,55 @@ func awsAwsjson10_deserializeOpDocumentPutKeywordOutput(v **PutKeywordOutput, va return nil } +func awsAwsjson10_deserializeOpDocumentPutMessageFeedbackOutput(v **PutMessageFeedbackOutput, 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 *PutMessageFeedbackOutput + if *v == nil { + sv = &PutMessageFeedbackOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MessageFeedbackStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MessageFeedbackStatus to be of type string, got %T instead", value) + } + sv.MessageFeedbackStatus = types.MessageFeedbackStatus(jtv) + } + + case "MessageId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MessageId to be of type string, got %T instead", value) + } + sv.MessageId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentPutOptedOutNumberOutput(v **PutOptedOutNumberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19228,6 +20208,114 @@ func awsAwsjson10_deserializeOpDocumentPutOptedOutNumberOutput(v **PutOptedOutNu return nil } +func awsAwsjson10_deserializeOpDocumentPutProtectConfigurationRuleSetNumberOverrideOutput(v **PutProtectConfigurationRuleSetNumberOverrideOutput, 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 *PutProtectConfigurationRuleSetNumberOverrideOutput + if *v == nil { + sv = &PutProtectConfigurationRuleSetNumberOverrideOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationRuleOverrideAction to be of type string, got %T instead", value) + } + sv.Action = types.ProtectConfigurationRuleOverrideAction(jtv) + } + + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DestinationPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + } + sv.DestinationPhoneNumber = ptr.String(jtv) + } + + case "ExpirationTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "IsoCountryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IsoCountryCode to be of type string, got %T instead", value) + } + sv.IsoCountryCode = ptr.String(jtv) + } + + case "ProtectConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationArn to be of type string, got %T instead", value) + } + sv.ProtectConfigurationArn = ptr.String(jtv) + } + + case "ProtectConfigurationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProtectConfigurationId to be of type string, got %T instead", value) + } + sv.ProtectConfigurationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentPutRegistrationFieldValueOutput(v **PutRegistrationFieldValueOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -20160,6 +21248,64 @@ func awsAwsjson10_deserializeOpDocumentSetAccountDefaultProtectConfigurationOutp return nil } +func awsAwsjson10_deserializeOpDocumentSetDefaultMessageFeedbackEnabledOutput(v **SetDefaultMessageFeedbackEnabledOutput, 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 *SetDefaultMessageFeedbackEnabledOutput + if *v == nil { + sv = &SetDefaultMessageFeedbackEnabledOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConfigurationSetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ConfigurationSetArn = ptr.String(jtv) + } + + case "ConfigurationSetName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfigurationSetName to be of type string, got %T instead", value) + } + sv.ConfigurationSetName = ptr.String(jtv) + } + + case "MessageFeedbackEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.MessageFeedbackEnabled = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentSetDefaultMessageTypeOutput(v **SetDefaultMessageTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/pinpointsmsvoicev2/generated.json b/service/pinpointsmsvoicev2/generated.json index 13a23a82858..3077d4001da 100644 --- a/service/pinpointsmsvoicev2/generated.json +++ b/service/pinpointsmsvoicev2/generated.json @@ -31,6 +31,7 @@ "api_op_DeleteOptedOutNumber.go", "api_op_DeletePool.go", "api_op_DeleteProtectConfiguration.go", + "api_op_DeleteProtectConfigurationRuleSetNumberOverride.go", "api_op_DeleteRegistration.go", "api_op_DeleteRegistrationAttachment.go", "api_op_DeleteRegistrationFieldValue.go", @@ -63,10 +64,13 @@ "api_op_GetProtectConfigurationCountryRuleSet.go", "api_op_GetResourcePolicy.go", "api_op_ListPoolOriginationIdentities.go", + "api_op_ListProtectConfigurationRuleSetNumberOverrides.go", "api_op_ListRegistrationAssociations.go", "api_op_ListTagsForResource.go", "api_op_PutKeyword.go", + "api_op_PutMessageFeedback.go", "api_op_PutOptedOutNumber.go", + "api_op_PutProtectConfigurationRuleSetNumberOverride.go", "api_op_PutRegistrationFieldValue.go", "api_op_PutResourcePolicy.go", "api_op_ReleasePhoneNumber.go", @@ -78,6 +82,7 @@ "api_op_SendTextMessage.go", "api_op_SendVoiceMessage.go", "api_op_SetAccountDefaultProtectConfiguration.go", + "api_op_SetDefaultMessageFeedbackEnabled.go", "api_op_SetDefaultMessageType.go", "api_op_SetDefaultSenderId.go", "api_op_SetMediaMessageSpendLimitOverride.go", diff --git a/service/pinpointsmsvoicev2/serializers.go b/service/pinpointsmsvoicev2/serializers.go index b7091bdf8d3..0731e5fc13d 100644 --- a/service/pinpointsmsvoicev2/serializers.go +++ b/service/pinpointsmsvoicev2/serializers.go @@ -11,6 +11,7 @@ import ( "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" "path" @@ -1419,6 +1420,67 @@ func (m *awsAwsjson10_serializeOpDeleteProtectConfiguration) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDeleteProtectConfigurationRuleSetNumberOverride struct { +} + +func (*awsAwsjson10_serializeOpDeleteProtectConfigurationRuleSetNumberOverride) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteProtectConfigurationRuleSetNumberOverride) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteProtectConfigurationRuleSetNumberOverrideInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.DeleteProtectConfigurationRuleSetNumberOverride") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteProtectConfigurationRuleSetNumberOverrideInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpDeleteRegistration struct { } @@ -3371,6 +3433,67 @@ func (m *awsAwsjson10_serializeOpListPoolOriginationIdentities) HandleSerialize( return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListProtectConfigurationRuleSetNumberOverrides struct { +} + +func (*awsAwsjson10_serializeOpListProtectConfigurationRuleSetNumberOverrides) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListProtectConfigurationRuleSetNumberOverrides) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListProtectConfigurationRuleSetNumberOverridesInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.ListProtectConfigurationRuleSetNumberOverrides") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListProtectConfigurationRuleSetNumberOverridesInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpListRegistrationAssociations struct { } @@ -3554,6 +3677,67 @@ func (m *awsAwsjson10_serializeOpPutKeyword) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpPutMessageFeedback struct { +} + +func (*awsAwsjson10_serializeOpPutMessageFeedback) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpPutMessageFeedback) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*PutMessageFeedbackInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.PutMessageFeedback") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentPutMessageFeedbackInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpPutOptedOutNumber struct { } @@ -3615,6 +3799,67 @@ func (m *awsAwsjson10_serializeOpPutOptedOutNumber) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpPutProtectConfigurationRuleSetNumberOverride struct { +} + +func (*awsAwsjson10_serializeOpPutProtectConfigurationRuleSetNumberOverride) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpPutProtectConfigurationRuleSetNumberOverride) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*PutProtectConfigurationRuleSetNumberOverrideInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.PutProtectConfigurationRuleSetNumberOverride") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentPutProtectConfigurationRuleSetNumberOverrideInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpPutRegistrationFieldValue struct { } @@ -4286,6 +4531,67 @@ func (m *awsAwsjson10_serializeOpSetAccountDefaultProtectConfiguration) HandleSe return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpSetDefaultMessageFeedbackEnabled struct { +} + +func (*awsAwsjson10_serializeOpSetDefaultMessageFeedbackEnabled) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpSetDefaultMessageFeedbackEnabled) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*SetDefaultMessageFeedbackEnabledInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.SetDefaultMessageFeedbackEnabled") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentSetDefaultMessageFeedbackEnabledInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpSetDefaultMessageType struct { } @@ -5386,6 +5692,19 @@ func awsAwsjson10_serializeDocumentKinesisFirehoseDestination(v *types.KinesisFi return nil } +func awsAwsjson10_serializeDocumentListProtectConfigurationRuleSetNumberOverrideFilter(v []types.ProtectConfigurationRuleSetNumberOverrideFilterItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentProtectConfigurationRuleSetNumberOverrideFilterItem(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson10_serializeDocumentMediaUrlList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5673,6 +5992,25 @@ func awsAwsjson10_serializeDocumentProtectConfigurationIdList(v []string, value return nil } +func awsAwsjson10_serializeDocumentProtectConfigurationRuleSetNumberOverrideFilterItem(v *types.ProtectConfigurationRuleSetNumberOverrideFilterItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Name) > 0 { + ok := object.Key("Name") + ok.String(string(v.Name)) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsAwsjson10_serializeDocumentFilterValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeDocumentRegistrationAssociationFilter(v *types.RegistrationAssociationFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6505,6 +6843,23 @@ func awsAwsjson10_serializeOpDocumentDeleteProtectConfigurationInput(v *DeletePr return nil } +func awsAwsjson10_serializeOpDocumentDeleteProtectConfigurationRuleSetNumberOverrideInput(v *DeleteProtectConfigurationRuleSetNumberOverrideInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DestinationPhoneNumber != nil { + ok := object.Key("DestinationPhoneNumber") + ok.String(*v.DestinationPhoneNumber) + } + + if v.ProtectConfigurationId != nil { + ok := object.Key("ProtectConfigurationId") + ok.String(*v.ProtectConfigurationId) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDeleteRegistrationAttachmentInput(v *DeleteRegistrationAttachmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7289,6 +7644,35 @@ func awsAwsjson10_serializeOpDocumentListPoolOriginationIdentitiesInput(v *ListP return nil } +func awsAwsjson10_serializeOpDocumentListProtectConfigurationRuleSetNumberOverridesInput(v *ListProtectConfigurationRuleSetNumberOverridesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson10_serializeDocumentListProtectConfigurationRuleSetNumberOverrideFilter(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.ProtectConfigurationId != nil { + ok := object.Key("ProtectConfigurationId") + ok.String(*v.ProtectConfigurationId) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListRegistrationAssociationsInput(v *ListRegistrationAssociationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7357,6 +7741,23 @@ func awsAwsjson10_serializeOpDocumentPutKeywordInput(v *PutKeywordInput, value s return nil } +func awsAwsjson10_serializeOpDocumentPutMessageFeedbackInput(v *PutMessageFeedbackInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.MessageFeedbackStatus) > 0 { + ok := object.Key("MessageFeedbackStatus") + ok.String(string(v.MessageFeedbackStatus)) + } + + if v.MessageId != nil { + ok := object.Key("MessageId") + ok.String(*v.MessageId) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentPutOptedOutNumberInput(v *PutOptedOutNumberInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7374,6 +7775,38 @@ func awsAwsjson10_serializeOpDocumentPutOptedOutNumberInput(v *PutOptedOutNumber return nil } +func awsAwsjson10_serializeOpDocumentPutProtectConfigurationRuleSetNumberOverrideInput(v *PutProtectConfigurationRuleSetNumberOverrideInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Action) > 0 { + ok := object.Key("Action") + ok.String(string(v.Action)) + } + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DestinationPhoneNumber != nil { + ok := object.Key("DestinationPhoneNumber") + ok.String(*v.DestinationPhoneNumber) + } + + if v.ExpirationTimestamp != nil { + ok := object.Key("ExpirationTimestamp") + ok.Double(smithytime.FormatEpochSeconds(*v.ExpirationTimestamp)) + } + + if v.ProtectConfigurationId != nil { + ok := object.Key("ProtectConfigurationId") + ok.String(*v.ProtectConfigurationId) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentPutRegistrationFieldValueInput(v *PutRegistrationFieldValueInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7645,6 +8078,11 @@ func awsAwsjson10_serializeOpDocumentSendMediaMessageInput(v *SendMediaMessageIn ok.String(*v.MessageBody) } + if v.MessageFeedbackEnabled != nil { + ok := object.Key("MessageFeedbackEnabled") + ok.Boolean(*v.MessageFeedbackEnabled) + } + if v.OriginationIdentity != nil { ok := object.Key("OriginationIdentity") ok.String(*v.OriginationIdentity) @@ -7711,6 +8149,11 @@ func awsAwsjson10_serializeOpDocumentSendTextMessageInput(v *SendTextMessageInpu ok.String(*v.MessageBody) } + if v.MessageFeedbackEnabled != nil { + ok := object.Key("MessageFeedbackEnabled") + ok.Boolean(*v.MessageFeedbackEnabled) + } + if len(v.MessageType) > 0 { ok := object.Key("MessageType") ok.String(string(v.MessageType)) @@ -7775,6 +8218,11 @@ func awsAwsjson10_serializeOpDocumentSendVoiceMessageInput(v *SendVoiceMessageIn ok.String(string(v.MessageBodyTextType)) } + if v.MessageFeedbackEnabled != nil { + ok := object.Key("MessageFeedbackEnabled") + ok.Boolean(*v.MessageFeedbackEnabled) + } + if v.OriginationIdentity != nil { ok := object.Key("OriginationIdentity") ok.String(*v.OriginationIdentity) @@ -7810,6 +8258,23 @@ func awsAwsjson10_serializeOpDocumentSetAccountDefaultProtectConfigurationInput( return nil } +func awsAwsjson10_serializeOpDocumentSetDefaultMessageFeedbackEnabledInput(v *SetDefaultMessageFeedbackEnabledInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConfigurationSetName != nil { + ok := object.Key("ConfigurationSetName") + ok.String(*v.ConfigurationSetName) + } + + if v.MessageFeedbackEnabled != nil { + ok := object.Key("MessageFeedbackEnabled") + ok.Boolean(*v.MessageFeedbackEnabled) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentSetDefaultMessageTypeInput(v *SetDefaultMessageTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go.snap new file mode 100644 index 00000000000..1e8d9a9f056 --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_DeleteProtectConfigurationRuleSetNumberOverride.go.snap @@ -0,0 +1,41 @@ +DeleteProtectConfigurationRuleSetNumberOverride + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_ListProtectConfigurationRuleSetNumberOverrides.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_ListProtectConfigurationRuleSetNumberOverrides.go.snap new file mode 100644 index 00000000000..38fa877dbde --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_ListProtectConfigurationRuleSetNumberOverrides.go.snap @@ -0,0 +1,41 @@ +ListProtectConfigurationRuleSetNumberOverrides + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_PutMessageFeedback.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_PutMessageFeedback.go.snap new file mode 100644 index 00000000000..826d5b0e848 --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_PutMessageFeedback.go.snap @@ -0,0 +1,41 @@ +PutMessageFeedback + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_PutProtectConfigurationRuleSetNumberOverride.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_PutProtectConfigurationRuleSetNumberOverride.go.snap new file mode 100644 index 00000000000..5f835f4f1cd --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_PutProtectConfigurationRuleSetNumberOverride.go.snap @@ -0,0 +1,42 @@ +PutProtectConfigurationRuleSetNumberOverride + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_SetDefaultMessageFeedbackEnabled.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_SetDefaultMessageFeedbackEnabled.go.snap new file mode 100644 index 00000000000..da91a7da4ae --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_SetDefaultMessageFeedbackEnabled.go.snap @@ -0,0 +1,41 @@ +SetDefaultMessageFeedbackEnabled + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot_test.go b/service/pinpointsmsvoicev2/snapshot_test.go index 3c60b29fde8..7e498274e3c 100644 --- a/service/pinpointsmsvoicev2/snapshot_test.go +++ b/service/pinpointsmsvoicev2/snapshot_test.go @@ -338,6 +338,18 @@ func TestCheckSnapshot_DeleteProtectConfiguration(t *testing.T) { } } +func TestCheckSnapshot_DeleteProtectConfigurationRuleSetNumberOverride(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteProtectConfigurationRuleSetNumberOverride(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteProtectConfigurationRuleSetNumberOverride") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteRegistration(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteRegistration(context.Background(), nil, func(o *Options) { @@ -722,6 +734,18 @@ func TestCheckSnapshot_ListPoolOriginationIdentities(t *testing.T) { } } +func TestCheckSnapshot_ListProtectConfigurationRuleSetNumberOverrides(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListProtectConfigurationRuleSetNumberOverrides(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListProtectConfigurationRuleSetNumberOverrides") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListRegistrationAssociations(t *testing.T) { svc := New(Options{}) _, err := svc.ListRegistrationAssociations(context.Background(), nil, func(o *Options) { @@ -758,6 +782,18 @@ func TestCheckSnapshot_PutKeyword(t *testing.T) { } } +func TestCheckSnapshot_PutMessageFeedback(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutMessageFeedback(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutMessageFeedback") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_PutOptedOutNumber(t *testing.T) { svc := New(Options{}) _, err := svc.PutOptedOutNumber(context.Background(), nil, func(o *Options) { @@ -770,6 +806,18 @@ func TestCheckSnapshot_PutOptedOutNumber(t *testing.T) { } } +func TestCheckSnapshot_PutProtectConfigurationRuleSetNumberOverride(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutProtectConfigurationRuleSetNumberOverride(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutProtectConfigurationRuleSetNumberOverride") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_PutRegistrationFieldValue(t *testing.T) { svc := New(Options{}) _, err := svc.PutRegistrationFieldValue(context.Background(), nil, func(o *Options) { @@ -902,6 +950,18 @@ func TestCheckSnapshot_SetAccountDefaultProtectConfiguration(t *testing.T) { } } +func TestCheckSnapshot_SetDefaultMessageFeedbackEnabled(t *testing.T) { + svc := New(Options{}) + _, err := svc.SetDefaultMessageFeedbackEnabled(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "SetDefaultMessageFeedbackEnabled") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_SetDefaultMessageType(t *testing.T) { svc := New(Options{}) _, err := svc.SetDefaultMessageType(context.Background(), nil, func(o *Options) { @@ -1357,6 +1417,18 @@ func TestUpdateSnapshot_DeleteProtectConfiguration(t *testing.T) { } } +func TestUpdateSnapshot_DeleteProtectConfigurationRuleSetNumberOverride(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteProtectConfigurationRuleSetNumberOverride(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteProtectConfigurationRuleSetNumberOverride") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteRegistration(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteRegistration(context.Background(), nil, func(o *Options) { @@ -1741,6 +1813,18 @@ func TestUpdateSnapshot_ListPoolOriginationIdentities(t *testing.T) { } } +func TestUpdateSnapshot_ListProtectConfigurationRuleSetNumberOverrides(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListProtectConfigurationRuleSetNumberOverrides(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListProtectConfigurationRuleSetNumberOverrides") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListRegistrationAssociations(t *testing.T) { svc := New(Options{}) _, err := svc.ListRegistrationAssociations(context.Background(), nil, func(o *Options) { @@ -1777,6 +1861,18 @@ func TestUpdateSnapshot_PutKeyword(t *testing.T) { } } +func TestUpdateSnapshot_PutMessageFeedback(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutMessageFeedback(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutMessageFeedback") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_PutOptedOutNumber(t *testing.T) { svc := New(Options{}) _, err := svc.PutOptedOutNumber(context.Background(), nil, func(o *Options) { @@ -1789,6 +1885,18 @@ func TestUpdateSnapshot_PutOptedOutNumber(t *testing.T) { } } +func TestUpdateSnapshot_PutProtectConfigurationRuleSetNumberOverride(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutProtectConfigurationRuleSetNumberOverride(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutProtectConfigurationRuleSetNumberOverride") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_PutRegistrationFieldValue(t *testing.T) { svc := New(Options{}) _, err := svc.PutRegistrationFieldValue(context.Background(), nil, func(o *Options) { @@ -1921,6 +2029,18 @@ func TestUpdateSnapshot_SetAccountDefaultProtectConfiguration(t *testing.T) { } } +func TestUpdateSnapshot_SetDefaultMessageFeedbackEnabled(t *testing.T) { + svc := New(Options{}) + _, err := svc.SetDefaultMessageFeedbackEnabled(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "SetDefaultMessageFeedbackEnabled") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_SetDefaultMessageType(t *testing.T) { svc := New(Options{}) _, err := svc.SetDefaultMessageType(context.Background(), nil, func(o *Options) { diff --git a/service/pinpointsmsvoicev2/types/enums.go b/service/pinpointsmsvoicev2/types/enums.go index 7c11b590e20..e2157af90ce 100644 --- a/service/pinpointsmsvoicev2/types/enums.go +++ b/service/pinpointsmsvoicev2/types/enums.go @@ -115,11 +115,12 @@ type ConfigurationSetFilterName string // Enum values for ConfigurationSetFilterName const ( - ConfigurationSetFilterNameEventDestinationName ConfigurationSetFilterName = "event-destination-name" - ConfigurationSetFilterNameMatchingEventTypes ConfigurationSetFilterName = "matching-event-types" - ConfigurationSetFilterNameDefaultMessageType ConfigurationSetFilterName = "default-message-type" - ConfigurationSetFilterNameDefaultSenderId ConfigurationSetFilterName = "default-sender-id" - ConfigurationSetFilterNameProtectConfigurationId ConfigurationSetFilterName = "protect-configuration-id" + ConfigurationSetFilterNameEventDestinationName ConfigurationSetFilterName = "event-destination-name" + ConfigurationSetFilterNameMatchingEventTypes ConfigurationSetFilterName = "matching-event-types" + ConfigurationSetFilterNameDefaultMessageType ConfigurationSetFilterName = "default-message-type" + ConfigurationSetFilterNameDefaultSenderId ConfigurationSetFilterName = "default-sender-id" + ConfigurationSetFilterNameDefaultMessageFeedbackEnabled ConfigurationSetFilterName = "default-message-feedback-enabled" + ConfigurationSetFilterNameProtectConfigurationId ConfigurationSetFilterName = "protect-configuration-id" ) // Values returns all known values for ConfigurationSetFilterName. Note that this @@ -132,6 +133,7 @@ func (ConfigurationSetFilterName) Values() []ConfigurationSetFilterName { "matching-event-types", "default-message-type", "default-sender-id", + "default-message-feedback-enabled", "protect-configuration-id", } } @@ -175,6 +177,7 @@ const ( ConflictExceptionReasonProtectConfigurationAssociatedWithConfigurationSet ConflictExceptionReason = "PROTECT_CONFIGURATION_ASSOCIATED_WITH_CONFIGURATION_SET" ConflictExceptionReasonProtectConfigurationNotAssociatedWithConfigurationSet ConflictExceptionReason = "PROTECT_CONFIGURATION_NOT_ASSOCIATED_WITH_CONFIGURATION_SET" ConflictExceptionReasonDestinationCountryBlockedByProtectConfiguration ConflictExceptionReason = "DESTINATION_COUNTRY_BLOCKED_BY_PROTECT_CONFIGURATION" + ConflictExceptionReasonDestinationPhoneNumberBlockedByProtectNumberOverride ConflictExceptionReason = "DESTINATION_PHONE_NUMBER_BLOCKED_BY_PROTECT_NUMBER_OVERRIDE" ) // Values returns all known values for ConflictExceptionReason. Note that this can @@ -218,6 +221,7 @@ func (ConflictExceptionReason) Values() []ConflictExceptionReason { "PROTECT_CONFIGURATION_ASSOCIATED_WITH_CONFIGURATION_SET", "PROTECT_CONFIGURATION_NOT_ASSOCIATED_WITH_CONFIGURATION_SET", "DESTINATION_COUNTRY_BLOCKED_BY_PROTECT_CONFIGURATION", + "DESTINATION_PHONE_NUMBER_BLOCKED_BY_PROTECT_NUMBER_OVERRIDE", } } @@ -261,6 +265,7 @@ const ( EventTypeTextSpam EventType = "TEXT_SPAM" EventTypeTextUnknown EventType = "TEXT_UNKNOWN" EventTypeTextTtlExpired EventType = "TEXT_TTL_EXPIRED" + EventTypeTextProtectBlocked EventType = "TEXT_PROTECT_BLOCKED" EventTypeVoiceAll EventType = "VOICE_ALL" EventTypeVoiceInitiated EventType = "VOICE_INITIATED" EventTypeVoiceRinging EventType = "VOICE_RINGING" @@ -311,6 +316,7 @@ func (EventType) Values() []EventType { "TEXT_SPAM", "TEXT_UNKNOWN", "TEXT_TTL_EXPIRED", + "TEXT_PROTECT_BLOCKED", "VOICE_ALL", "VOICE_INITIATED", "VOICE_RINGING", @@ -461,6 +467,25 @@ func (LanguageCode) Values() []LanguageCode { } } +type MessageFeedbackStatus string + +// Enum values for MessageFeedbackStatus +const ( + MessageFeedbackStatusReceived MessageFeedbackStatus = "RECEIVED" + MessageFeedbackStatusFailed MessageFeedbackStatus = "FAILED" +) + +// Values returns all known values for MessageFeedbackStatus. 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 (MessageFeedbackStatus) Values() []MessageFeedbackStatus { + return []MessageFeedbackStatus{ + "RECEIVED", + "FAILED", + } +} + type MessageType string // Enum values for MessageType @@ -714,6 +739,56 @@ func (ProtectConfigurationFilterName) Values() []ProtectConfigurationFilterName } } +type ProtectConfigurationRuleOverrideAction string + +// Enum values for ProtectConfigurationRuleOverrideAction +const ( + ProtectConfigurationRuleOverrideActionAllow ProtectConfigurationRuleOverrideAction = "ALLOW" + ProtectConfigurationRuleOverrideActionBlock ProtectConfigurationRuleOverrideAction = "BLOCK" +) + +// Values returns all known values for ProtectConfigurationRuleOverrideAction. +// 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 (ProtectConfigurationRuleOverrideAction) Values() []ProtectConfigurationRuleOverrideAction { + return []ProtectConfigurationRuleOverrideAction{ + "ALLOW", + "BLOCK", + } +} + +type ProtectConfigurationRuleSetNumberOverrideFilterName string + +// Enum values for ProtectConfigurationRuleSetNumberOverrideFilterName +const ( + ProtectConfigurationRuleSetNumberOverrideFilterNameIsoCountryCode ProtectConfigurationRuleSetNumberOverrideFilterName = "iso-country-code" + ProtectConfigurationRuleSetNumberOverrideFilterNameDestinationPhoneNumberBeginsWith ProtectConfigurationRuleSetNumberOverrideFilterName = "destination-phone-number-begins-with" + ProtectConfigurationRuleSetNumberOverrideFilterNameAction ProtectConfigurationRuleSetNumberOverrideFilterName = "action" + ProtectConfigurationRuleSetNumberOverrideFilterNameExpiresBefore ProtectConfigurationRuleSetNumberOverrideFilterName = "expires-before" + ProtectConfigurationRuleSetNumberOverrideFilterNameExpiresAfter ProtectConfigurationRuleSetNumberOverrideFilterName = "expires-after" + ProtectConfigurationRuleSetNumberOverrideFilterNameCreatedBefore ProtectConfigurationRuleSetNumberOverrideFilterName = "created-before" + ProtectConfigurationRuleSetNumberOverrideFilterNameCreatedAfter ProtectConfigurationRuleSetNumberOverrideFilterName = "created-after" +) + +// Values returns all known values for +// ProtectConfigurationRuleSetNumberOverrideFilterName. 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 (ProtectConfigurationRuleSetNumberOverrideFilterName) Values() []ProtectConfigurationRuleSetNumberOverrideFilterName { + return []ProtectConfigurationRuleSetNumberOverrideFilterName{ + "iso-country-code", + "destination-phone-number-begins-with", + "action", + "expires-before", + "expires-after", + "created-before", + "created-after", + } +} + type ProtectStatus string // Enum values for ProtectStatus @@ -978,6 +1053,7 @@ const ( ResourceTypeVerifiedDestinationNumber ResourceType = "verified-destination-number" ResourceTypeProtectConfiguration ResourceType = "protect-configuration" ResourceTypePolicy ResourceType = "policy" + ResourceTypeMessage ResourceType = "message" ) // Values returns all known values for ResourceType. Note that this can be @@ -1000,6 +1076,7 @@ func (ResourceType) Values() []ResourceType { "verified-destination-number", "protect-configuration", "policy", + "message", } } diff --git a/service/pinpointsmsvoicev2/types/types.go b/service/pinpointsmsvoicev2/types/types.go index 100b7ca2e6a..cbc6e865647 100644 --- a/service/pinpointsmsvoicev2/types/types.go +++ b/service/pinpointsmsvoicev2/types/types.go @@ -105,6 +105,9 @@ type ConfigurationSetInformation struct { // This member is required. EventDestinations []EventDestination + // True if message feedback is enabled. + DefaultMessageFeedbackEnabled *bool + // The type of message. Valid values are TRANSACTIONAL for messages that are // critical or time-sensitive and PROMOTIONAL for messages that aren't critical or // time-sensitive. @@ -604,6 +607,54 @@ type ProtectConfigurationInformation struct { noSmithyDocumentSerde } +// Provides details on a RuleSetNumberOverride. +type ProtectConfigurationRuleSetNumberOverride struct { + + // The action for the rule to perform of either blocking or allowing messages to + // the destination phone number. + // + // This member is required. + Action ProtectConfigurationRuleOverrideAction + + // The time when the rule was created, in [UNIX epoch time] format. + // + // [UNIX epoch time]: https://www.epochconverter.com/ + // + // This member is required. + CreatedTimestamp *time.Time + + // The destination phone number in E.164 format. + // + // This member is required. + DestinationPhoneNumber *string + + // The time the rule will expire at. If ExpirationTimestamp is not set then the + // rule will not expire. + ExpirationTimestamp *time.Time + + // The two-character code, in ISO 3166-1 alpha-2 format, for the country or region. + IsoCountryCode *string + + noSmithyDocumentSerde +} + +// The information for a protect configuration rule set number override that meets +// a specified criteria. +type ProtectConfigurationRuleSetNumberOverrideFilterItem struct { + + // The name of the attribute to filter on. + // + // This member is required. + Name ProtectConfigurationRuleSetNumberOverrideFilterName + + // An array values to filter for. + // + // This member is required. + Values []string + + noSmithyDocumentSerde +} + // The filter definition for filtering registrations that meets a specified // criteria. type RegistrationAssociationFilter struct { diff --git a/service/pinpointsmsvoicev2/validators.go b/service/pinpointsmsvoicev2/validators.go index 42c8cb2bd73..0cd3ff57284 100644 --- a/service/pinpointsmsvoicev2/validators.go +++ b/service/pinpointsmsvoicev2/validators.go @@ -430,6 +430,26 @@ func (m *validateOpDeleteProtectConfiguration) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDeleteProtectConfigurationRuleSetNumberOverride struct { +} + +func (*validateOpDeleteProtectConfigurationRuleSetNumberOverride) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProtectConfigurationRuleSetNumberOverride) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProtectConfigurationRuleSetNumberOverrideInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProtectConfigurationRuleSetNumberOverrideInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteRegistrationAttachment struct { } @@ -950,6 +970,26 @@ func (m *validateOpListPoolOriginationIdentities) HandleInitialize(ctx context.C return next.HandleInitialize(ctx, in) } +type validateOpListProtectConfigurationRuleSetNumberOverrides struct { +} + +func (*validateOpListProtectConfigurationRuleSetNumberOverrides) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListProtectConfigurationRuleSetNumberOverrides) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListProtectConfigurationRuleSetNumberOverridesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListProtectConfigurationRuleSetNumberOverridesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListRegistrationAssociations struct { } @@ -1010,6 +1050,26 @@ func (m *validateOpPutKeyword) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpPutMessageFeedback struct { +} + +func (*validateOpPutMessageFeedback) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutMessageFeedback) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutMessageFeedbackInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutMessageFeedbackInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutOptedOutNumber struct { } @@ -1030,6 +1090,26 @@ func (m *validateOpPutOptedOutNumber) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpPutProtectConfigurationRuleSetNumberOverride struct { +} + +func (*validateOpPutProtectConfigurationRuleSetNumberOverride) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutProtectConfigurationRuleSetNumberOverride) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutProtectConfigurationRuleSetNumberOverrideInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutProtectConfigurationRuleSetNumberOverrideInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutRegistrationFieldValue struct { } @@ -1250,6 +1330,26 @@ func (m *validateOpSetAccountDefaultProtectConfiguration) HandleInitialize(ctx c return next.HandleInitialize(ctx, in) } +type validateOpSetDefaultMessageFeedbackEnabled struct { +} + +func (*validateOpSetDefaultMessageFeedbackEnabled) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetDefaultMessageFeedbackEnabled) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetDefaultMessageFeedbackEnabledInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetDefaultMessageFeedbackEnabledInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSetDefaultMessageType struct { } @@ -1634,6 +1734,10 @@ func addOpDeleteProtectConfigurationValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDeleteProtectConfiguration{}, middleware.After) } +func addOpDeleteProtectConfigurationRuleSetNumberOverrideValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProtectConfigurationRuleSetNumberOverride{}, middleware.After) +} + func addOpDeleteRegistrationAttachmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRegistrationAttachment{}, middleware.After) } @@ -1738,6 +1842,10 @@ func addOpListPoolOriginationIdentitiesValidationMiddleware(stack *middleware.St return stack.Initialize.Add(&validateOpListPoolOriginationIdentities{}, middleware.After) } +func addOpListProtectConfigurationRuleSetNumberOverridesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListProtectConfigurationRuleSetNumberOverrides{}, middleware.After) +} + func addOpListRegistrationAssociationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListRegistrationAssociations{}, middleware.After) } @@ -1750,10 +1858,18 @@ func addOpPutKeywordValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutKeyword{}, middleware.After) } +func addOpPutMessageFeedbackValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutMessageFeedback{}, middleware.After) +} + func addOpPutOptedOutNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutOptedOutNumber{}, middleware.After) } +func addOpPutProtectConfigurationRuleSetNumberOverrideValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutProtectConfigurationRuleSetNumberOverride{}, middleware.After) +} + func addOpPutRegistrationFieldValueValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutRegistrationFieldValue{}, middleware.After) } @@ -1798,6 +1914,10 @@ func addOpSetAccountDefaultProtectConfigurationValidationMiddleware(stack *middl return stack.Initialize.Add(&validateOpSetAccountDefaultProtectConfiguration{}, middleware.After) } +func addOpSetDefaultMessageFeedbackEnabledValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetDefaultMessageFeedbackEnabled{}, middleware.After) +} + func addOpSetDefaultMessageTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSetDefaultMessageType{}, middleware.After) } @@ -1964,6 +2084,23 @@ func validateKinesisFirehoseDestination(v *types.KinesisFirehoseDestination) err } } +func validateListProtectConfigurationRuleSetNumberOverrideFilter(v []types.ProtectConfigurationRuleSetNumberOverrideFilterItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListProtectConfigurationRuleSetNumberOverrideFilter"} + for i := range v { + if err := validateProtectConfigurationRuleSetNumberOverrideFilterItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateNonEmptyTagList(v []types.Tag) error { if v == nil { return nil @@ -2189,6 +2326,24 @@ func validateProtectConfigurationFilterList(v []types.ProtectConfigurationFilter } } +func validateProtectConfigurationRuleSetNumberOverrideFilterItem(v *types.ProtectConfigurationRuleSetNumberOverrideFilterItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ProtectConfigurationRuleSetNumberOverrideFilterItem"} + if len(v.Name) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRegistrationAssociationFilter(v *types.RegistrationAssociationFilter) error { if v == nil { return nil @@ -2911,6 +3066,24 @@ func validateOpDeleteProtectConfigurationInput(v *DeleteProtectConfigurationInpu } } +func validateOpDeleteProtectConfigurationRuleSetNumberOverrideInput(v *DeleteProtectConfigurationRuleSetNumberOverrideInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProtectConfigurationRuleSetNumberOverrideInput"} + if v.ProtectConfigurationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProtectConfigurationId")) + } + if v.DestinationPhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationPhoneNumber")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteRegistrationAttachmentInput(v *DeleteRegistrationAttachmentInput) error { if v == nil { return nil @@ -3359,6 +3532,26 @@ func validateOpListPoolOriginationIdentitiesInput(v *ListPoolOriginationIdentiti } } +func validateOpListProtectConfigurationRuleSetNumberOverridesInput(v *ListProtectConfigurationRuleSetNumberOverridesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListProtectConfigurationRuleSetNumberOverridesInput"} + if v.ProtectConfigurationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProtectConfigurationId")) + } + if v.Filters != nil { + if err := validateListProtectConfigurationRuleSetNumberOverrideFilter(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListRegistrationAssociationsInput(v *ListRegistrationAssociationsInput) error { if v == nil { return nil @@ -3415,6 +3608,24 @@ func validateOpPutKeywordInput(v *PutKeywordInput) error { } } +func validateOpPutMessageFeedbackInput(v *PutMessageFeedbackInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutMessageFeedbackInput"} + if v.MessageId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MessageId")) + } + if len(v.MessageFeedbackStatus) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("MessageFeedbackStatus")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutOptedOutNumberInput(v *PutOptedOutNumberInput) error { if v == nil { return nil @@ -3433,6 +3644,27 @@ func validateOpPutOptedOutNumberInput(v *PutOptedOutNumberInput) error { } } +func validateOpPutProtectConfigurationRuleSetNumberOverrideInput(v *PutProtectConfigurationRuleSetNumberOverrideInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutProtectConfigurationRuleSetNumberOverrideInput"} + if v.ProtectConfigurationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProtectConfigurationId")) + } + if v.DestinationPhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationPhoneNumber")) + } + if len(v.Action) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutRegistrationFieldValueInput(v *PutRegistrationFieldValueInput) error { if v == nil { return nil @@ -3638,6 +3870,24 @@ func validateOpSetAccountDefaultProtectConfigurationInput(v *SetAccountDefaultPr } } +func validateOpSetDefaultMessageFeedbackEnabledInput(v *SetDefaultMessageFeedbackEnabledInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetDefaultMessageFeedbackEnabledInput"} + if v.ConfigurationSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName")) + } + if v.MessageFeedbackEnabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("MessageFeedbackEnabled")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpSetDefaultMessageTypeInput(v *SetDefaultMessageTypeInput) error { if v == nil { return nil diff --git a/service/route53resolver/api_op_CreateFirewallRule.go b/service/route53resolver/api_op_CreateFirewallRule.go index 49325bba674..b8805931471 100644 --- a/service/route53resolver/api_op_CreateFirewallRule.go +++ b/service/route53resolver/api_op_CreateFirewallRule.go @@ -31,9 +31,11 @@ func (c *Client) CreateFirewallRule(ctx context.Context, params *CreateFirewallR type CreateFirewallRuleInput struct { // The action that DNS Firewall should take on a DNS query when it matches one of - // the domains in the rule's domain list: + // the domains in the rule's domain list, or a threat in a DNS Firewall Advanced + // rule: // - // - ALLOW - Permit the request to go through. + // - ALLOW - Permit the request to go through. Not available for DNS Firewall + // Advanced rules. // // - ALERT - Permit the request and send metrics and logs to Cloud Watch. // @@ -50,11 +52,6 @@ type CreateFirewallRuleInput struct { // This member is required. CreatorRequestId *string - // The ID of the domain list that you want to use in the rule. - // - // This member is required. - FirewallDomainListId *string - // The unique identifier of the firewall rule group where you want to create the // rule. // @@ -113,14 +110,34 @@ type CreateFirewallRuleInput struct { // This setting is required if the rule action setting is BLOCK . BlockResponse types.BlockResponse + // The confidence threshold for DNS Firewall Advanced. You must provide this + // value when you create a DNS Firewall Advanced rule. The confidence level values + // mean: + // + // - LOW : Provides the highest detection rate for threats, but also increases + // false positives. + // + // - MEDIUM : Provides a balance between detecting threats and false positives. + // + // - HIGH : Detects only the most well corroborated threats with a low rate of + // false positives. + ConfidenceThreshold types.ConfidenceThreshold + + // Use to create a DNS Firewall Advanced rule. + DnsThreatProtection types.DnsThreatProtection + + // The ID of the domain list that you want to use in the rule. Can't be used + // together with DnsThreatProtecton . + FirewallDomainListId *string + // How you want the the rule to evaluate DNS redirection in the DNS redirection // chain, such as CNAME or DNAME. // - // Inspect_Redirection_Domain (Default) inspects all domains in the redirection + // INSPECT_REDIRECTION_DOMAIN : (Default) inspects all domains in the redirection // chain. The individual domains in the redirection chain must be added to the // domain list. // - // Trust_Redirection_Domain inspects only the first domain in the redirection + // TRUST_REDIRECTION_DOMAIN : Inspects only the first domain in the redirection // chain. You don't need to add the subsequent domains in the domain in the // redirection list to the domain list. FirewallDomainRedirectionAction types.FirewallDomainRedirectionAction diff --git a/service/route53resolver/api_op_DeleteFirewallRule.go b/service/route53resolver/api_op_DeleteFirewallRule.go index a82de852897..32ea9cd7603 100644 --- a/service/route53resolver/api_op_DeleteFirewallRule.go +++ b/service/route53resolver/api_op_DeleteFirewallRule.go @@ -29,17 +29,18 @@ func (c *Client) DeleteFirewallRule(ctx context.Context, params *DeleteFirewallR type DeleteFirewallRuleInput struct { - // The ID of the domain list that's used in the rule. - // - // This member is required. - FirewallDomainListId *string - // The unique identifier of the firewall rule group that you want to delete the // rule from. // // This member is required. FirewallRuleGroupId *string + // The ID of the domain list that's used in the rule. + FirewallDomainListId *string + + // The ID that is created for a DNS Firewall Advanced rule. + FirewallThreatProtectionId *string + // The DNS query type that the rule you are deleting evaluates. Allowed values // are; // diff --git a/service/route53resolver/api_op_ListFirewallRules.go b/service/route53resolver/api_op_ListFirewallRules.go index cd7b1dcbe75..7a009b0c41d 100644 --- a/service/route53resolver/api_op_ListFirewallRules.go +++ b/service/route53resolver/api_op_ListFirewallRules.go @@ -43,9 +43,11 @@ type ListFirewallRulesInput struct { // Optional additional filter for the rules to retrieve. // // The action that DNS Firewall should take on a DNS query when it matches one of - // the domains in the rule's domain list: + // the domains in the rule's domain list, or a threat in a DNS Firewall Advanced + // rule: // - // - ALLOW - Permit the request to go through. + // - ALLOW - Permit the request to go through. Not availabe for DNS Firewall + // Advanced rules. // // - ALERT - Permit the request to go through but send an alert to the logs. // diff --git a/service/route53resolver/api_op_UpdateFirewallRule.go b/service/route53resolver/api_op_UpdateFirewallRule.go index 596e401cbb0..f4d1c025f05 100644 --- a/service/route53resolver/api_op_UpdateFirewallRule.go +++ b/service/route53resolver/api_op_UpdateFirewallRule.go @@ -29,20 +29,17 @@ func (c *Client) UpdateFirewallRule(ctx context.Context, params *UpdateFirewallR type UpdateFirewallRuleInput struct { - // The ID of the domain list to use in the rule. - // - // This member is required. - FirewallDomainListId *string - // The unique identifier of the firewall rule group for the rule. // // This member is required. FirewallRuleGroupId *string // The action that DNS Firewall should take on a DNS query when it matches one of - // the domains in the rule's domain list: + // the domains in the rule's domain list, or a threat in a DNS Firewall Advanced + // rule: // - // - ALLOW - Permit the request to go through. + // - ALLOW - Permit the request to go through. Not available for DNS Firewall + // Advanced rules. // // - ALERT - Permit the request to go through but send an alert to the logs. // @@ -77,18 +74,47 @@ type UpdateFirewallRuleInput struct { // custom handling details in the rule's BlockOverride* settings. BlockResponse types.BlockResponse + // The confidence threshold for DNS Firewall Advanced. You must provide this + // value when you create a DNS Firewall Advanced rule. The confidence level values + // mean: + // + // - LOW : Provides the highest detection rate for threats, but also increases + // false positives. + // + // - MEDIUM : Provides a balance between detecting threats and false positives. + // + // - HIGH : Detects only the most well corroborated threats with a low rate of + // false positives. + ConfidenceThreshold types.ConfidenceThreshold + + // The type of the DNS Firewall Advanced rule. Valid values are: + // + // - DGA : Domain generation algorithms detection. DGAs are used by attackers to + // generate a large number of domains to to launch malware attacks. + // + // - DNS_TUNNELING : DNS tunneling detection. DNS tunneling is used by attackers + // to exfiltrate data from the client by using the DNS tunnel without making a + // network connection to the client. + DnsThreatProtection types.DnsThreatProtection + + // The ID of the domain list to use in the rule. + FirewallDomainListId *string + // How you want the the rule to evaluate DNS redirection in the DNS redirection // chain, such as CNAME or DNAME. // - // Inspect_Redirection_Domain (Default) inspects all domains in the redirection + // INSPECT_REDIRECTION_DOMAIN : (Default) inspects all domains in the redirection // chain. The individual domains in the redirection chain must be added to the // domain list. // - // Trust_Redirection_Domain inspects only the first domain in the redirection + // TRUST_REDIRECTION_DOMAIN : Inspects only the first domain in the redirection // chain. You don't need to add the subsequent domains in the domain in the // redirection list to the domain list. FirewallDomainRedirectionAction types.FirewallDomainRedirectionAction + // The DNS Firewall Advanced rule ID. + FirewallThreatProtectionId *string + // The name of the rule. Name *string diff --git a/service/route53resolver/deserializers.go b/service/route53resolver/deserializers.go index b98d29beaf2..7d9e8cf6be3 100644 --- a/service/route53resolver/deserializers.go +++ b/service/route53resolver/deserializers.go @@ -1681,6 +1681,9 @@ func awsAwsjson11_deserializeOpErrorDeleteFirewallRule(response *smithyhttp.Resp case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9646,6 +9649,15 @@ func awsAwsjson11_deserializeDocumentFirewallRule(v **types.FirewallRule, value sv.BlockResponse = types.BlockResponse(jtv) } + case "ConfidenceThreshold": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConfidenceThreshold to be of type string, got %T instead", value) + } + sv.ConfidenceThreshold = types.ConfidenceThreshold(jtv) + } + case "CreationTime": if value != nil { jtv, ok := value.(string) @@ -9664,6 +9676,15 @@ func awsAwsjson11_deserializeDocumentFirewallRule(v **types.FirewallRule, value sv.CreatorRequestId = ptr.String(jtv) } + case "DnsThreatProtection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DnsThreatProtection to be of type string, got %T instead", value) + } + sv.DnsThreatProtection = types.DnsThreatProtection(jtv) + } + case "FirewallDomainListId": if value != nil { jtv, ok := value.(string) @@ -9691,6 +9712,15 @@ func awsAwsjson11_deserializeDocumentFirewallRule(v **types.FirewallRule, value sv.FirewallRuleGroupId = ptr.String(jtv) } + case "FirewallThreatProtectionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.FirewallThreatProtectionId = ptr.String(jtv) + } + case "ModificationTime": if value != nil { jtv, ok := value.(string) diff --git a/service/route53resolver/serializers.go b/service/route53resolver/serializers.go index 5d212ab06af..b4e07901d41 100644 --- a/service/route53resolver/serializers.go +++ b/service/route53resolver/serializers.go @@ -4620,11 +4620,21 @@ func awsAwsjson11_serializeOpDocumentCreateFirewallRuleInput(v *CreateFirewallRu ok.String(string(v.BlockResponse)) } + if len(v.ConfidenceThreshold) > 0 { + ok := object.Key("ConfidenceThreshold") + ok.String(string(v.ConfidenceThreshold)) + } + if v.CreatorRequestId != nil { ok := object.Key("CreatorRequestId") ok.String(*v.CreatorRequestId) } + if len(v.DnsThreatProtection) > 0 { + ok := object.Key("DnsThreatProtection") + ok.String(string(v.DnsThreatProtection)) + } + if v.FirewallDomainListId != nil { ok := object.Key("FirewallDomainListId") ok.String(*v.FirewallDomainListId) @@ -4875,6 +4885,11 @@ func awsAwsjson11_serializeOpDocumentDeleteFirewallRuleInput(v *DeleteFirewallRu ok.String(*v.FirewallRuleGroupId) } + if v.FirewallThreatProtectionId != nil { + ok := object.Key("FirewallThreatProtectionId") + ok.String(*v.FirewallThreatProtectionId) + } + if v.Qtype != nil { ok := object.Key("Qtype") ok.String(*v.Qtype) @@ -5773,6 +5788,16 @@ func awsAwsjson11_serializeOpDocumentUpdateFirewallRuleInput(v *UpdateFirewallRu ok.String(string(v.BlockResponse)) } + if len(v.ConfidenceThreshold) > 0 { + ok := object.Key("ConfidenceThreshold") + ok.String(string(v.ConfidenceThreshold)) + } + + if len(v.DnsThreatProtection) > 0 { + ok := object.Key("DnsThreatProtection") + ok.String(string(v.DnsThreatProtection)) + } + if v.FirewallDomainListId != nil { ok := object.Key("FirewallDomainListId") ok.String(*v.FirewallDomainListId) @@ -5788,6 +5813,11 @@ func awsAwsjson11_serializeOpDocumentUpdateFirewallRuleInput(v *UpdateFirewallRu ok.String(*v.FirewallRuleGroupId) } + if v.FirewallThreatProtectionId != nil { + ok := object.Key("FirewallThreatProtectionId") + ok.String(*v.FirewallThreatProtectionId) + } + if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) diff --git a/service/route53resolver/types/enums.go b/service/route53resolver/types/enums.go index c05c14bb0de..60b2533b5c9 100644 --- a/service/route53resolver/types/enums.go +++ b/service/route53resolver/types/enums.go @@ -82,6 +82,46 @@ func (BlockResponse) Values() []BlockResponse { } } +type ConfidenceThreshold string + +// Enum values for ConfidenceThreshold +const ( + ConfidenceThresholdLow ConfidenceThreshold = "LOW" + ConfidenceThresholdMedium ConfidenceThreshold = "MEDIUM" + ConfidenceThresholdHigh ConfidenceThreshold = "HIGH" +) + +// Values returns all known values for ConfidenceThreshold. 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 (ConfidenceThreshold) Values() []ConfidenceThreshold { + return []ConfidenceThreshold{ + "LOW", + "MEDIUM", + "HIGH", + } +} + +type DnsThreatProtection string + +// Enum values for DnsThreatProtection +const ( + DnsThreatProtectionDga DnsThreatProtection = "DGA" + DnsThreatProtectionDnsTunneling DnsThreatProtection = "DNS_TUNNELING" +) + +// Values returns all known values for DnsThreatProtection. 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 (DnsThreatProtection) Values() []DnsThreatProtection { + return []DnsThreatProtection{ + "DGA", + "DNS_TUNNELING", + } +} + type FirewallDomainImportOperation string // Enum values for FirewallDomainImportOperation diff --git a/service/route53resolver/types/types.go b/service/route53resolver/types/types.go index a8e2ee59a7b..9ca4d1c08ea 100644 --- a/service/route53resolver/types/types.go +++ b/service/route53resolver/types/types.go @@ -300,9 +300,11 @@ type FirewallDomainListMetadata struct { type FirewallRule struct { // The action that DNS Firewall should take on a DNS query when it matches one of - // the domains in the rule's domain list: + // the domains in the rule's domain list, or a threat in a DNS Firewall Advanced + // rule: // - // - ALLOW - Permit the request to go through. + // - ALLOW - Permit the request to go through. Not available for DNS Firewall + // Advanced rules. // // - ALERT - Permit the request to go through but send an alert to the logs. // @@ -337,6 +339,19 @@ type FirewallRule struct { // custom handling details in the rule's BlockOverride* settings. BlockResponse BlockResponse + // The confidence threshold for DNS Firewall Advanced. You must provide this + // value when you create a DNS Firewall Advanced rule. The confidence level values + // mean: + // + // - LOW : Provides the highest detection rate for threats, but also increases + // false positives. + // + // - MEDIUM : Provides a balance between detecting threats and false positives. + // + // - HIGH : Detects only the most well corroborated threats with a low rate of + // false positives. + ConfidenceThreshold ConfidenceThreshold + // The date and time that the rule was created, in Unix time format and // Coordinated Universal Time (UTC). CreationTime *string @@ -346,24 +361,37 @@ type FirewallRule struct { // can be any unique string, for example, a timestamp. CreatorRequestId *string + // The type of the DNS Firewall Advanced rule. Valid values are: + // + // - DGA : Domain generation algorithms detection. DGAs are used by attackers to + // generate a large number of domains to to launch malware attacks. + // + // - DNS_TUNNELING : DNS tunneling detection. DNS tunneling is used by attackers + // to exfiltrate data from the client by using the DNS tunnel without making a + // network connection to the client. + DnsThreatProtection DnsThreatProtection + // The ID of the domain list that's used in the rule. FirewallDomainListId *string // How you want the the rule to evaluate DNS redirection in the DNS redirection // chain, such as CNAME or DNAME. // - // Inspect_Redirection_Domain (Default) inspects all domains in the redirection + // INSPECT_REDIRECTION_DOMAIN : (Default) inspects all domains in the redirection // chain. The individual domains in the redirection chain must be added to the // domain list. // - // Trust_Redirection_Domain inspects only the first domain in the redirection + // TRUST_REDIRECTION_DOMAIN : Inspects only the first domain in the redirection // chain. You don't need to add the subsequent domains in the domain in the // redirection list to the domain list. FirewallDomainRedirectionAction FirewallDomainRedirectionAction - // The unique identifier of the firewall rule group of the rule. + // The unique identifier of the Firewall rule group of the rule. FirewallRuleGroupId *string + // ID of the DNS Firewall Advanced rule. + FirewallThreatProtectionId *string + // The date and time that the rule was last modified, in Unix time format and // Coordinated Universal Time (UTC). ModificationTime *string @@ -983,7 +1011,7 @@ type ResolverQueryLogConfigAssociation struct { // - CREATING : Resolver is creating an association between an Amazon VPC and a // query logging configuration. // - // - CREATED : The association between an Amazon VPC and a query logging + // - ACTIVE : The association between an Amazon VPC and a query logging // configuration was successfully created. Resolver is logging queries that // originate in the specified VPC. // @@ -1168,32 +1196,8 @@ type TargetAddress struct { // The port at Ip that you want to forward DNS queries to. Port *int32 - // The protocols for the Resolver endpoints. DoH-FIPS is applicable for inbound - // endpoints only. - // - // For an inbound endpoint you can apply the protocols as follows: - // - // - Do53 and DoH in combination. - // - // - Do53 and DoH-FIPS in combination. - // - // - Do53 alone. - // - // - DoH alone. - // - // - DoH-FIPS alone. - // - // - None, which is treated as Do53. - // - // For an outbound endpoint you can apply the protocols as follows: - // - // - Do53 and DoH in combination. - // - // - Do53 alone. - // - // - DoH alone. - // - // - None, which is treated as Do53. + // The protocols for the target address. The protocol you choose needs to be + // supported by the outbound endpoint of the Resolver rule. Protocol Protocol // The Server Name Indication of the DoH server that you want to forward queries diff --git a/service/route53resolver/validators.go b/service/route53resolver/validators.go index 20edcc2f293..3af1e02b9e1 100644 --- a/service/route53resolver/validators.go +++ b/service/route53resolver/validators.go @@ -1599,9 +1599,6 @@ func validateOpCreateFirewallRuleInput(v *CreateFirewallRuleInput) error { if v.FirewallRuleGroupId == nil { invalidParams.Add(smithy.NewErrParamRequired("FirewallRuleGroupId")) } - if v.FirewallDomainListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FirewallDomainListId")) - } if v.Priority == nil { invalidParams.Add(smithy.NewErrParamRequired("Priority")) } @@ -1767,9 +1764,6 @@ func validateOpDeleteFirewallRuleInput(v *DeleteFirewallRuleInput) error { if v.FirewallRuleGroupId == nil { invalidParams.Add(smithy.NewErrParamRequired("FirewallRuleGroupId")) } - if v.FirewallDomainListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FirewallDomainListId")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2368,9 +2362,6 @@ func validateOpUpdateFirewallRuleInput(v *UpdateFirewallRuleInput) error { if v.FirewallRuleGroupId == nil { invalidParams.Add(smithy.NewErrParamRequired("FirewallRuleGroupId")) } - if v.FirewallDomainListId == nil { - invalidParams.Add(smithy.NewErrParamRequired("FirewallDomainListId")) - } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/transfer/internal/endpoints/endpoints.go b/service/transfer/internal/endpoints/endpoints.go index 92df7800c9e..3c5df9d46a7 100644 --- a/service/transfer/internal/endpoints/endpoints.go +++ b/service/transfer/internal/endpoints/endpoints.go @@ -172,6 +172,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{},