From cf05df560d96e1eba8feae415587cc548eaa131c Mon Sep 17 00:00:00 2001 From: Shantanu Kotambkar <52007797+skotambkar@users.noreply.github.com> Date: Thu, 30 Sep 2021 11:57:45 -0700 Subject: [PATCH] update models (#1443) * update models * Regenerated API Clients --- .../41575353444b40ffbf474f4155544f00.json | 11 + .../6bbb00f52bc04cbc94a61efe806bc2e1.json | 26 + .../aws-models/account.2021-02-01.json | 438 + .../aws-models/amp.2020-08-01.json | 1621 +++- .../appintegrations.2020-07-29.json | 662 +- .../aws-models/cloudcontrol.2021-09-30.json | 1606 ++++ .../aws-models/connect.2017-08-08.json | 134 +- .../aws-models/dataexchange.2017-07-25.json | 581 +- .../elasticloadbalancingv2.2015-12-01.json | 27 +- .../aws-models/imagebuilder.2019-12-02.json | 52 +- .../aws-models/lambda.2015-03-31.json | 147 +- .../aws-models/macie2.2020-01-01.json | 72 +- .../networkfirewall.2020-11-12.json | 225 +- .../aws-models/pinpoint.2016-12-01.json | 43 + .../aws-models/sesv2.2019-09-27.json | 291 +- .../aws-models/transfer.2018-11-05.json | 32 +- .../aws-models/voiceid.2021-09-27.json | 3194 ++++++++ .../aws-models/wisdom.2020-10-19.json | 3976 +++++++++ .../aws-models/workmail.2017-10-01.json | 446 +- .../aws-models/workspaces.2015-04-08.json | 187 +- .../aws/go/codegen/endpoint-prefix.json | 4 + .../smithy/aws/go/codegen/endpoints.json | 113 + service/account/LICENSE.txt | 202 + service/account/api_client.go | 261 + .../account/api_op_DeleteAlternateContact.go | 141 + service/account/api_op_GetAlternateContact.go | 145 + service/account/api_op_PutAlternateContact.go | 161 + service/account/deserializers.go | 834 ++ service/account/doc.go | 7 + service/account/endpoints.go | 160 + service/account/generated.json | 27 + service/account/go.mod | 10 + service/account/go.sum | 14 + service/account/go_module_metadata.go | 6 + .../account/internal/endpoints/endpoints.go | 124 + .../internal/endpoints/endpoints_test.go | 11 + service/account/protocol_test.go | 3 + service/account/serializers.go | 253 + service/account/types/enums.go | 23 + service/account/types/errors.go | 106 + service/account/types/types.go | 31 + service/account/validators.go | 139 + .../api_op_CreateAlertManagerDefinition.go | 134 + .../amp/api_op_CreateRuleGroupsNamespace.go | 155 + .../api_op_DeleteAlertManagerDefinition.go | 121 + .../amp/api_op_DeleteRuleGroupsNamespace.go | 126 + .../api_op_DescribeAlertManagerDefinition.go | 125 + .../amp/api_op_DescribeRuleGroupsNamespace.go | 130 + service/amp/api_op_DescribeWorkspace.go | 357 + .../amp/api_op_ListRuleGroupsNamespaces.go | 228 + .../amp/api_op_PutAlertManagerDefinition.go | 134 + service/amp/api_op_PutRuleGroupsNamespace.go | 152 + service/amp/deserializers.go | 2338 +++++- service/amp/generated.json | 12 +- service/amp/go.mod | 1 + service/amp/go.sum | 6 + service/amp/internal/endpoints/endpoints.go | 14 +- service/amp/serializers.go | 773 +- service/amp/types/enums.go | 74 + service/amp/types/types.go | 127 + service/amp/validators.go | 375 + .../api_op_CreateDataIntegration.go | 205 + .../api_op_DeleteDataIntegration.go | 123 + .../api_op_GetDataIntegration.go | 147 + .../api_op_GetEventIntegration.go | 2 +- .../api_op_ListDataIntegrationAssociations.go | 136 + .../api_op_ListDataIntegrations.go | 128 + .../api_op_UpdateDataIntegration.go | 127 + service/appintegrations/deserializers.go | 1581 +++- service/appintegrations/doc.go | 6 +- service/appintegrations/generated.json | 6 + service/appintegrations/serializers.go | 449 ++ service/appintegrations/types/types.go | 46 + service/appintegrations/validators.go | 195 + service/cloudcontrol/LICENSE.txt | 202 + service/cloudcontrol/api_client.go | 282 + .../api_op_CancelResourceRequest.go | 129 + service/cloudcontrol/api_op_CreateResource.go | 222 + service/cloudcontrol/api_op_DeleteResource.go | 214 + service/cloudcontrol/api_op_GetResource.go | 162 + .../api_op_GetResourceRequestStatus.go | 325 + .../api_op_ListResourceRequests.go | 231 + service/cloudcontrol/api_op_ListResources.go | 259 + service/cloudcontrol/api_op_UpdateResource.go | 230 + service/cloudcontrol/deserializers.go | 3317 ++++++++ service/cloudcontrol/doc.go | 16 + service/cloudcontrol/endpoints.go | 160 + service/cloudcontrol/generated.json | 33 + service/cloudcontrol/go.mod | 11 + service/cloudcontrol/go.sum | 20 + service/cloudcontrol/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 106 + .../internal/endpoints/endpoints_test.go | 11 + service/cloudcontrol/protocol_test.go | 3 + service/cloudcontrol/serializers.go | 646 ++ service/cloudcontrol/types/enums.go | 93 + service/cloudcontrol/types/errors.go | 427 + service/cloudcontrol/types/types.go | 120 + service/cloudcontrol/validators.go | 298 + .../internal/endpoints/endpoints.go | 1 + .../api_op_CreateIntegrationAssociation.go | 19 +- service/connect/api_op_CreateUseCase.go | 8 +- .../api_op_DeleteIntegrationAssociation.go | 4 +- service/connect/api_op_DeleteUseCase.go | 4 +- .../connect/api_op_GetCurrentMetricData.go | 11 +- .../api_op_ListIntegrationAssociations.go | 7 +- service/connect/api_op_ListUseCases.go | 6 +- .../api_op_StartOutboundVoiceContact.go | 17 + .../connect/api_op_UpdateInstanceAttribute.go | 4 +- service/connect/serializers.go | 38 + service/connect/types/enums.go | 32 +- service/connect/types/types.go | 20 +- service/connect/validators.go | 9 - .../dataexchange/api_op_CreateEventAction.go | 143 + .../dataexchange/api_op_DeleteEventAction.go | 116 + service/dataexchange/api_op_GetEventAction.go | 137 + .../dataexchange/api_op_ListEventActions.go | 210 + .../dataexchange/api_op_UpdateEventAction.go | 141 + service/dataexchange/deserializers.go | 1740 +++- service/dataexchange/generated.json | 5 + service/dataexchange/serializers.go | 415 + service/dataexchange/types/enums.go | 36 +- service/dataexchange/types/errors.go | 2 + service/dataexchange/types/types.go | 106 +- service/dataexchange/validators.go | 260 + .../api_op_CreateTargetGroup.go | 5 +- .../elasticloadbalancingv2/deserializers.go | 9 + service/elasticloadbalancingv2/types/enums.go | 2 + service/elasticloadbalancingv2/types/types.go | 22 +- .../imagebuilder/api_op_CreateComponent.go | 4 +- .../api_op_CreateContainerRecipe.go | 6 +- .../imagebuilder/api_op_CreateImageRecipe.go | 4 +- ...pi_op_CreateInfrastructureConfiguration.go | 16 +- .../imagebuilder/api_op_ImportComponent.go | 2 +- .../api_op_ListComponentBuildVersions.go | 6 +- service/imagebuilder/api_op_ListComponents.go | 6 +- service/imagebuilder/api_op_ListImages.go | 2 +- service/imagebuilder/types/types.go | 42 +- service/lambda/api_op_AddPermission.go | 21 +- .../lambda/api_op_CreateEventSourceMapping.go | 56 +- service/lambda/api_op_CreateFunction.go | 25 +- .../lambda/api_op_DeleteEventSourceMapping.go | 14 +- .../lambda/api_op_GetEventSourceMapping.go | 14 +- .../lambda/api_op_GetFunctionConfiguration.go | 5 + service/lambda/api_op_GetLayerVersion.go | 4 + service/lambda/api_op_GetLayerVersionByArn.go | 4 + service/lambda/api_op_Invoke.go | 3 +- service/lambda/api_op_ListLayerVersions.go | 8 +- service/lambda/api_op_ListLayers.go | 13 +- service/lambda/api_op_ListTags.go | 3 +- service/lambda/api_op_PublishLayerVersion.go | 8 + service/lambda/api_op_PublishVersion.go | 5 + .../lambda/api_op_PutFunctionConcurrency.go | 2 +- .../lambda/api_op_UpdateEventSourceMapping.go | 47 +- service/lambda/api_op_UpdateFunctionCode.go | 9 + .../api_op_UpdateFunctionConfiguration.go | 7 +- service/lambda/deserializers.go | 122 + service/lambda/serializers.go | 51 + service/lambda/types/enums.go | 18 + service/lambda/types/errors.go | 2 +- service/lambda/types/types.go | 25 +- service/macie2/api_op_GetBucketStatistics.go | 12 +- service/macie2/deserializers.go | 36 + service/macie2/types/enums.go | 16 + service/macie2/types/types.go | 117 +- service/networkfirewall/deserializers.go | 212 + service/networkfirewall/doc.go | 71 +- service/networkfirewall/serializers.go | 61 + service/networkfirewall/types/enums.go | 18 + service/networkfirewall/types/errors.go | 4 +- service/networkfirewall/types/types.go | 130 +- service/pinpoint/deserializers.go | 99 + service/pinpoint/serializers.go | 19 + service/pinpoint/types/types.go | 28 + .../sesv2/api_op_CreateConfigurationSet.go | 7 +- ..._CreateConfigurationSetEventDestination.go | 2 +- service/sesv2/api_op_CreateDedicatedIpPool.go | 8 +- service/sesv2/api_op_CreateEmailIdentity.go | 25 +- .../sesv2/api_op_CreateEmailIdentityPolicy.go | 2 +- service/sesv2/api_op_CreateEmailTemplate.go | 2 +- .../sesv2/api_op_DeleteConfigurationSet.go | 2 +- ..._DeleteConfigurationSetEventDestination.go | 5 +- ...p_DeleteCustomVerificationEmailTemplate.go | 2 +- service/sesv2/api_op_DeleteEmailIdentity.go | 2 +- .../sesv2/api_op_DeleteEmailIdentityPolicy.go | 2 +- service/sesv2/api_op_GetAccount.go | 28 +- service/sesv2/api_op_GetConfigurationSet.go | 3 +- service/sesv2/api_op_GetDedicatedIp.go | 4 +- service/sesv2/api_op_GetDedicatedIps.go | 10 +- ...pi_op_GetDeliverabilityDashboardOptions.go | 18 +- service/sesv2/api_op_GetEmailIdentity.go | 5 +- .../sesv2/api_op_GetEmailIdentityPolicies.go | 2 +- service/sesv2/api_op_GetEmailTemplate.go | 4 +- service/sesv2/api_op_ListConfigurationSets.go | 8 +- ...op_ListCustomVerificationEmailTemplates.go | 4 +- service/sesv2/api_op_ListDedicatedIpPools.go | 8 +- service/sesv2/api_op_ListEmailIdentities.go | 22 +- service/sesv2/api_op_ListEmailTemplates.go | 9 +- ...p_PutAccountDedicatedIpWarmupAttributes.go | 5 +- service/sesv2/api_op_PutAccountDetails.go | 16 +- .../api_op_PutAccountSendingAttributes.go | 6 +- ...i_op_PutConfigurationSetDeliveryOptions.go | 6 +- ...op_PutConfigurationSetReputationOptions.go | 5 +- ...pi_op_PutConfigurationSetSendingOptions.go | 5 +- ...p_PutConfigurationSetSuppressionOptions.go | 4 +- ...i_op_PutConfigurationSetTrackingOptions.go | 5 +- service/sesv2/api_op_PutDedicatedIpInPool.go | 8 +- ...api_op_PutDeliverabilityDashboardOption.go | 13 +- ...EmailIdentityConfigurationSetAttributes.go | 4 +- .../api_op_PutEmailIdentityDkimAttributes.go | 2 +- ...p_PutEmailIdentityDkimSigningAttributes.go | 28 +- ...i_op_PutEmailIdentityFeedbackAttributes.go | 3 +- ...i_op_PutEmailIdentityMailFromAttributes.go | 16 +- service/sesv2/api_op_SendBulkEmail.go | 9 +- .../api_op_SendCustomVerificationEmail.go | 11 +- service/sesv2/api_op_SendEmail.go | 24 +- .../sesv2/api_op_TestRenderEmailTemplate.go | 2 +- ..._UpdateConfigurationSetEventDestination.go | 5 +- .../sesv2/api_op_UpdateEmailIdentityPolicy.go | 2 +- service/sesv2/api_op_UpdateEmailTemplate.go | 2 +- service/sesv2/deserializers.go | 34 + service/sesv2/doc.go | 27 +- service/sesv2/serializers.go | 5 + service/sesv2/types/enums.go | 18 + service/sesv2/types/types.go | 152 +- service/sesv2/validators.go | 28 - service/transfer/api_op_CreateAccess.go | 27 +- service/transfer/api_op_CreateUser.go | 27 +- service/transfer/api_op_CreateWorkflow.go | 11 +- service/transfer/api_op_UpdateAccess.go | 27 +- service/transfer/api_op_UpdateUser.go | 27 +- service/transfer/types/types.go | 62 +- service/voiceid/LICENSE.txt | 202 + service/voiceid/api_client.go | 281 + service/voiceid/api_op_CreateDomain.go | 178 + service/voiceid/api_op_DeleteDomain.go | 116 + service/voiceid/api_op_DeleteFraudster.go | 121 + service/voiceid/api_op_DeleteSpeaker.go | 121 + service/voiceid/api_op_DescribeDomain.go | 121 + service/voiceid/api_op_DescribeFraudster.go | 126 + ...api_op_DescribeFraudsterRegistrationJob.go | 126 + service/voiceid/api_op_DescribeSpeaker.go | 126 + .../api_op_DescribeSpeakerEnrollmentJob.go | 126 + service/voiceid/api_op_EvaluateSession.go | 152 + service/voiceid/api_op_ListDomains.go | 218 + .../api_op_ListFraudsterRegistrationJobs.go | 235 + .../api_op_ListSpeakerEnrollmentJobs.go | 234 + service/voiceid/api_op_ListSpeakers.go | 226 + service/voiceid/api_op_ListTagsForResource.go | 122 + service/voiceid/api_op_OptOutSpeaker.go | 131 + .../api_op_StartFraudsterRegistrationJob.go | 192 + .../api_op_StartSpeakerEnrollmentJob.go | 192 + service/voiceid/api_op_TagResource.go | 122 + service/voiceid/api_op_UntagResource.go | 122 + service/voiceid/api_op_UpdateDomain.go | 139 + service/voiceid/deserializers.go | 5824 ++++++++++++++ service/voiceid/doc.go | 8 + service/voiceid/endpoints.go | 160 + service/voiceid/generated.json | 45 + service/voiceid/go.mod | 10 + service/voiceid/go.sum | 14 + service/voiceid/go_module_metadata.go | 6 + .../voiceid/internal/endpoints/endpoints.go | 115 + .../internal/endpoints/endpoints_test.go | 11 + service/voiceid/protocol_test.go | 3 + service/voiceid/serializers.go | 1600 ++++ service/voiceid/types/enums.go | 284 + service/voiceid/types/errors.go | 154 + service/voiceid/types/types.go | 576 ++ service/voiceid/validators.go | 961 +++ service/wisdom/LICENSE.txt | 202 + service/wisdom/api_client.go | 262 + service/wisdom/api_op_CreateAssistant.go | 139 + .../api_op_CreateAssistantAssociation.go | 141 + service/wisdom/api_op_CreateContent.go | 159 + service/wisdom/api_op_CreateKnowledgeBase.go | 170 + service/wisdom/api_op_CreateSession.go | 139 + service/wisdom/api_op_DeleteAssistant.go | 117 + .../api_op_DeleteAssistantAssociation.go | 123 + service/wisdom/api_op_DeleteContent.go | 123 + service/wisdom/api_op_DeleteKnowledgeBase.go | 127 + service/wisdom/api_op_GetAssistant.go | 122 + .../wisdom/api_op_GetAssistantAssociation.go | 128 + service/wisdom/api_op_GetContent.go | 128 + service/wisdom/api_op_GetContentSummary.go | 128 + service/wisdom/api_op_GetKnowledgeBase.go | 122 + service/wisdom/api_op_GetRecommendations.go | 145 + service/wisdom/api_op_GetSession.go | 128 + .../api_op_ListAssistantAssociations.go | 223 + service/wisdom/api_op_ListAssistants.go | 212 + service/wisdom/api_op_ListContents.go | 220 + service/wisdom/api_op_ListKnowledgeBases.go | 213 + service/wisdom/api_op_ListTagsForResource.go | 120 + .../api_op_NotifyRecommendationsReceived.go | 141 + service/wisdom/api_op_QueryAssistant.go | 228 + .../api_op_RemoveKnowledgeBaseTemplateUri.go | 117 + service/wisdom/api_op_SearchContent.go | 226 + service/wisdom/api_op_SearchSessions.go | 226 + service/wisdom/api_op_StartContentUpload.go | 151 + service/wisdom/api_op_TagResource.go | 121 + service/wisdom/api_op_UntagResource.go | 121 + service/wisdom/api_op_UpdateContent.go | 156 + .../api_op_UpdateKnowledgeBaseTemplateUri.go | 132 + service/wisdom/deserializers.go | 7144 +++++++++++++++++ service/wisdom/doc.go | 10 + service/wisdom/endpoints.go | 160 + service/wisdom/generated.json | 56 + service/wisdom/go.mod | 10 + service/wisdom/go.sum | 14 + service/wisdom/go_module_metadata.go | 6 + .../wisdom/internal/endpoints/endpoints.go | 106 + .../internal/endpoints/endpoints_test.go | 11 + service/wisdom/protocol_test.go | 3 + service/wisdom/serializers.go | 2568 ++++++ service/wisdom/types/enums.go | 185 + service/wisdom/types/errors.go | 152 + service/wisdom/types/types.go | 741 ++ service/wisdom/types/types_exported_test.go | 62 + service/wisdom/validators.go | 1321 +++ ...api_op_DeleteMobileDeviceAccessOverride.go | 138 + .../api_op_GetMobileDeviceAccessOverride.go | 157 + .../api_op_ListMobileDeviceAccessOverrides.go | 241 + .../api_op_PutMobileDeviceAccessOverride.go | 146 + service/workmail/deserializers.go | 919 ++- service/workmail/generated.json | 4 + service/workmail/serializers.go | 296 + service/workmail/types/types.go | 24 + service/workmail/validators.go | 177 + .../workspaces/api_op_CopyWorkspaceImage.go | 10 +- .../api_op_CreateConnectionAlias.go | 6 +- .../api_op_CreateUpdatedWorkspaceImage.go | 152 + .../api_op_DeregisterWorkspaceDirectory.go | 2 +- ...i_op_DescribeConnectionAliasPermissions.go | 4 +- .../api_op_DescribeWorkspaceBundles.go | 4 +- ...pi_op_DescribeWorkspaceImagePermissions.go | 7 +- .../api_op_DisassociateConnectionAlias.go | 2 +- .../workspaces/api_op_ImportWorkspaceImage.go | 5 +- ...pi_op_ListAvailableManagementCidrRanges.go | 12 +- .../api_op_RegisterWorkspaceDirectory.go | 9 +- .../workspaces/api_op_TerminateWorkspaces.go | 16 +- .../api_op_UpdateConnectionAliasPermission.go | 2 +- .../api_op_UpdateWorkspaceImagePermission.go | 32 +- service/workspaces/deserializers.go | 223 + service/workspaces/generated.json | 1 + service/workspaces/serializers.go | 76 + service/workspaces/types/types.go | 83 +- service/workspaces/validators.go | 50 + 347 files changed, 70212 insertions(+), 2163 deletions(-) create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/6bbb00f52bc04cbc94a61efe806bc2e1.json create mode 100644 codegen/sdk-codegen/aws-models/account.2021-02-01.json create mode 100644 codegen/sdk-codegen/aws-models/cloudcontrol.2021-09-30.json create mode 100644 codegen/sdk-codegen/aws-models/voiceid.2021-09-27.json create mode 100644 codegen/sdk-codegen/aws-models/wisdom.2020-10-19.json create mode 100644 service/account/LICENSE.txt create mode 100644 service/account/api_client.go create mode 100644 service/account/api_op_DeleteAlternateContact.go create mode 100644 service/account/api_op_GetAlternateContact.go create mode 100644 service/account/api_op_PutAlternateContact.go create mode 100644 service/account/deserializers.go create mode 100644 service/account/doc.go create mode 100644 service/account/endpoints.go create mode 100644 service/account/generated.json create mode 100644 service/account/go.mod create mode 100644 service/account/go.sum create mode 100644 service/account/go_module_metadata.go create mode 100644 service/account/internal/endpoints/endpoints.go create mode 100644 service/account/internal/endpoints/endpoints_test.go create mode 100644 service/account/protocol_test.go create mode 100644 service/account/serializers.go create mode 100644 service/account/types/enums.go create mode 100644 service/account/types/errors.go create mode 100644 service/account/types/types.go create mode 100644 service/account/validators.go create mode 100644 service/amp/api_op_CreateAlertManagerDefinition.go create mode 100644 service/amp/api_op_CreateRuleGroupsNamespace.go create mode 100644 service/amp/api_op_DeleteAlertManagerDefinition.go create mode 100644 service/amp/api_op_DeleteRuleGroupsNamespace.go create mode 100644 service/amp/api_op_DescribeAlertManagerDefinition.go create mode 100644 service/amp/api_op_DescribeRuleGroupsNamespace.go create mode 100644 service/amp/api_op_ListRuleGroupsNamespaces.go create mode 100644 service/amp/api_op_PutAlertManagerDefinition.go create mode 100644 service/amp/api_op_PutRuleGroupsNamespace.go create mode 100644 service/appintegrations/api_op_CreateDataIntegration.go create mode 100644 service/appintegrations/api_op_DeleteDataIntegration.go create mode 100644 service/appintegrations/api_op_GetDataIntegration.go create mode 100644 service/appintegrations/api_op_ListDataIntegrationAssociations.go create mode 100644 service/appintegrations/api_op_ListDataIntegrations.go create mode 100644 service/appintegrations/api_op_UpdateDataIntegration.go create mode 100644 service/cloudcontrol/LICENSE.txt create mode 100644 service/cloudcontrol/api_client.go create mode 100644 service/cloudcontrol/api_op_CancelResourceRequest.go create mode 100644 service/cloudcontrol/api_op_CreateResource.go create mode 100644 service/cloudcontrol/api_op_DeleteResource.go create mode 100644 service/cloudcontrol/api_op_GetResource.go create mode 100644 service/cloudcontrol/api_op_GetResourceRequestStatus.go create mode 100644 service/cloudcontrol/api_op_ListResourceRequests.go create mode 100644 service/cloudcontrol/api_op_ListResources.go create mode 100644 service/cloudcontrol/api_op_UpdateResource.go create mode 100644 service/cloudcontrol/deserializers.go create mode 100644 service/cloudcontrol/doc.go create mode 100644 service/cloudcontrol/endpoints.go create mode 100644 service/cloudcontrol/generated.json create mode 100644 service/cloudcontrol/go.mod create mode 100644 service/cloudcontrol/go.sum create mode 100644 service/cloudcontrol/go_module_metadata.go create mode 100644 service/cloudcontrol/internal/endpoints/endpoints.go create mode 100644 service/cloudcontrol/internal/endpoints/endpoints_test.go create mode 100644 service/cloudcontrol/protocol_test.go create mode 100644 service/cloudcontrol/serializers.go create mode 100644 service/cloudcontrol/types/enums.go create mode 100644 service/cloudcontrol/types/errors.go create mode 100644 service/cloudcontrol/types/types.go create mode 100644 service/cloudcontrol/validators.go create mode 100644 service/dataexchange/api_op_CreateEventAction.go create mode 100644 service/dataexchange/api_op_DeleteEventAction.go create mode 100644 service/dataexchange/api_op_GetEventAction.go create mode 100644 service/dataexchange/api_op_ListEventActions.go create mode 100644 service/dataexchange/api_op_UpdateEventAction.go create mode 100644 service/voiceid/LICENSE.txt create mode 100644 service/voiceid/api_client.go create mode 100644 service/voiceid/api_op_CreateDomain.go create mode 100644 service/voiceid/api_op_DeleteDomain.go create mode 100644 service/voiceid/api_op_DeleteFraudster.go create mode 100644 service/voiceid/api_op_DeleteSpeaker.go create mode 100644 service/voiceid/api_op_DescribeDomain.go create mode 100644 service/voiceid/api_op_DescribeFraudster.go create mode 100644 service/voiceid/api_op_DescribeFraudsterRegistrationJob.go create mode 100644 service/voiceid/api_op_DescribeSpeaker.go create mode 100644 service/voiceid/api_op_DescribeSpeakerEnrollmentJob.go create mode 100644 service/voiceid/api_op_EvaluateSession.go create mode 100644 service/voiceid/api_op_ListDomains.go create mode 100644 service/voiceid/api_op_ListFraudsterRegistrationJobs.go create mode 100644 service/voiceid/api_op_ListSpeakerEnrollmentJobs.go create mode 100644 service/voiceid/api_op_ListSpeakers.go create mode 100644 service/voiceid/api_op_ListTagsForResource.go create mode 100644 service/voiceid/api_op_OptOutSpeaker.go create mode 100644 service/voiceid/api_op_StartFraudsterRegistrationJob.go create mode 100644 service/voiceid/api_op_StartSpeakerEnrollmentJob.go create mode 100644 service/voiceid/api_op_TagResource.go create mode 100644 service/voiceid/api_op_UntagResource.go create mode 100644 service/voiceid/api_op_UpdateDomain.go create mode 100644 service/voiceid/deserializers.go create mode 100644 service/voiceid/doc.go create mode 100644 service/voiceid/endpoints.go create mode 100644 service/voiceid/generated.json create mode 100644 service/voiceid/go.mod create mode 100644 service/voiceid/go.sum create mode 100644 service/voiceid/go_module_metadata.go create mode 100644 service/voiceid/internal/endpoints/endpoints.go create mode 100644 service/voiceid/internal/endpoints/endpoints_test.go create mode 100644 service/voiceid/protocol_test.go create mode 100644 service/voiceid/serializers.go create mode 100644 service/voiceid/types/enums.go create mode 100644 service/voiceid/types/errors.go create mode 100644 service/voiceid/types/types.go create mode 100644 service/voiceid/validators.go create mode 100644 service/wisdom/LICENSE.txt create mode 100644 service/wisdom/api_client.go create mode 100644 service/wisdom/api_op_CreateAssistant.go create mode 100644 service/wisdom/api_op_CreateAssistantAssociation.go create mode 100644 service/wisdom/api_op_CreateContent.go create mode 100644 service/wisdom/api_op_CreateKnowledgeBase.go create mode 100644 service/wisdom/api_op_CreateSession.go create mode 100644 service/wisdom/api_op_DeleteAssistant.go create mode 100644 service/wisdom/api_op_DeleteAssistantAssociation.go create mode 100644 service/wisdom/api_op_DeleteContent.go create mode 100644 service/wisdom/api_op_DeleteKnowledgeBase.go create mode 100644 service/wisdom/api_op_GetAssistant.go create mode 100644 service/wisdom/api_op_GetAssistantAssociation.go create mode 100644 service/wisdom/api_op_GetContent.go create mode 100644 service/wisdom/api_op_GetContentSummary.go create mode 100644 service/wisdom/api_op_GetKnowledgeBase.go create mode 100644 service/wisdom/api_op_GetRecommendations.go create mode 100644 service/wisdom/api_op_GetSession.go create mode 100644 service/wisdom/api_op_ListAssistantAssociations.go create mode 100644 service/wisdom/api_op_ListAssistants.go create mode 100644 service/wisdom/api_op_ListContents.go create mode 100644 service/wisdom/api_op_ListKnowledgeBases.go create mode 100644 service/wisdom/api_op_ListTagsForResource.go create mode 100644 service/wisdom/api_op_NotifyRecommendationsReceived.go create mode 100644 service/wisdom/api_op_QueryAssistant.go create mode 100644 service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go create mode 100644 service/wisdom/api_op_SearchContent.go create mode 100644 service/wisdom/api_op_SearchSessions.go create mode 100644 service/wisdom/api_op_StartContentUpload.go create mode 100644 service/wisdom/api_op_TagResource.go create mode 100644 service/wisdom/api_op_UntagResource.go create mode 100644 service/wisdom/api_op_UpdateContent.go create mode 100644 service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go create mode 100644 service/wisdom/deserializers.go create mode 100644 service/wisdom/doc.go create mode 100644 service/wisdom/endpoints.go create mode 100644 service/wisdom/generated.json create mode 100644 service/wisdom/go.mod create mode 100644 service/wisdom/go.sum create mode 100644 service/wisdom/go_module_metadata.go create mode 100644 service/wisdom/internal/endpoints/endpoints.go create mode 100644 service/wisdom/internal/endpoints/endpoints_test.go create mode 100644 service/wisdom/protocol_test.go create mode 100644 service/wisdom/serializers.go create mode 100644 service/wisdom/types/enums.go create mode 100644 service/wisdom/types/errors.go create mode 100644 service/wisdom/types/types.go create mode 100644 service/wisdom/types/types_exported_test.go create mode 100644 service/wisdom/validators.go create mode 100644 service/workmail/api_op_DeleteMobileDeviceAccessOverride.go create mode 100644 service/workmail/api_op_GetMobileDeviceAccessOverride.go create mode 100644 service/workmail/api_op_ListMobileDeviceAccessOverrides.go create mode 100644 service/workmail/api_op_PutMobileDeviceAccessOverride.go create mode 100644 service/workspaces/api_op_CreateUpdatedWorkspaceImage.go diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..f5ab60bf717 --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,11 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/account", + "service/cloudcontrol", + "service/voiceid", + "service/wisdom" + ] +} \ No newline at end of file diff --git a/.changelog/6bbb00f52bc04cbc94a61efe806bc2e1.json b/.changelog/6bbb00f52bc04cbc94a61efe806bc2e1.json new file mode 100644 index 00000000000..994d204ee09 --- /dev/null +++ b/.changelog/6bbb00f52bc04cbc94a61efe806bc2e1.json @@ -0,0 +1,26 @@ +{ + "id": "6bbb00f5-2bc0-4cbc-94a6-1efe806bc2e1", + "type": "feature", + "description": "API client updated", + "modules": [ + "service/account", + "service/amp", + "service/appintegrations", + "service/cloudcontrol", + "service/cloudhsmv2", + "service/connect", + "service/dataexchange", + "service/elasticloadbalancingv2", + "service/imagebuilder", + "service/lambda", + "service/macie2", + "service/networkfirewall", + "service/pinpoint", + "service/sesv2", + "service/transfer", + "service/voiceid", + "service/wisdom", + "service/workmail", + "service/workspaces" + ] +} \ No newline at end of file diff --git a/codegen/sdk-codegen/aws-models/account.2021-02-01.json b/codegen/sdk-codegen/aws-models/account.2021-02-01.json new file mode 100644 index 00000000000..9f95e760b9a --- /dev/null +++ b/codegen/sdk-codegen/aws-models/account.2021-02-01.json @@ -0,0 +1,438 @@ +{ + "smithy": "1.0", + "shapes": { + "com.amazonaws.account#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The operation failed because the calling identity doesn't have the minimum required\n permissions.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.account#Account": { + "type": "service", + "version": "2021-02-01", + "resources": [ + { + "target": "com.amazonaws.account#AlternateContactResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "Account", + "arnNamespace": "account", + "cloudFormationName": "Account", + "cloudTrailEventSource": "CLOUDTRAIL_EVENT_SOURCE", + "endpointPrefix": "account" + }, + "aws.auth#sigv4": { + "name": "account" + }, + "aws.protocols#restJson1": {}, + "smithy.api#cors": {}, + "smithy.api#documentation": "

Operations for Amazon Web Services Account Management

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + }, + "smithy.api#title": "AWS Account" + } + }, + "com.amazonaws.account#AccountId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^\\d{12}$" + } + }, + "com.amazonaws.account#AlternateContact": { + "type": "structure", + "members": { + "Name": { + "target": "com.amazonaws.account#Name", + "traits": { + "smithy.api#documentation": "

The name associated with this alternate contact.

" + } + }, + "Title": { + "target": "com.amazonaws.account#Title", + "traits": { + "smithy.api#documentation": "

The title associated with this alternate contact.

" + } + }, + "EmailAddress": { + "target": "com.amazonaws.account#EmailAddress", + "traits": { + "smithy.api#documentation": "

The email address associated with this alternate contact.

" + } + }, + "PhoneNumber": { + "target": "com.amazonaws.account#PhoneNumber", + "traits": { + "smithy.api#documentation": "

The phone number associated with this alternate contact.

" + } + }, + "AlternateContactType": { + "target": "com.amazonaws.account#AlternateContactType", + "traits": { + "smithy.api#documentation": "

The type of alternate contact.

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

A structure that contains the details of an alternate contact associated with an Amazon Web Services\n account

" + } + }, + "com.amazonaws.account#AlternateContactResource": { + "type": "resource", + "identifiers": { + "AlternateContactType": { + "target": "com.amazonaws.account#AlternateContactType" + } + }, + "put": { + "target": "com.amazonaws.account#PutAlternateContact" + }, + "read": { + "target": "com.amazonaws.account#GetAlternateContact" + }, + "delete": { + "target": "com.amazonaws.account#DeleteAlternateContact" + }, + "traits": { + "aws.api#arn": { + "template": "AlternateContact/{AlternateContactType}", + "absolute": false, + "noAccount": false, + "noRegion": false + } + } + }, + "com.amazonaws.account#AlternateContactType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "BILLING", + "name": "BILLING" + }, + { + "value": "OPERATIONS", + "name": "OPERATIONS" + }, + { + "value": "SECURITY", + "name": "SECURITY" + } + ] + } + }, + "com.amazonaws.account#DeleteAlternateContact": { + "type": "operation", + "input": { + "target": "com.amazonaws.account#DeleteAlternateContactRequest" + }, + "errors": [ + { + "target": "com.amazonaws.account#AccessDeniedException" + }, + { + "target": "com.amazonaws.account#InternalServerException" + }, + { + "target": "com.amazonaws.account#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.account#TooManyRequestsException" + }, + { + "target": "com.amazonaws.account#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the specified alternate contact from an Amazon Web Services account.

\n

For complete details about how to use the alternate contact operations, see Access or\n updating the alternate contacts.

", + "smithy.api#http": { + "method": "POST", + "uri": "/deleteAlternateContact", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.account#DeleteAlternateContactRequest": { + "type": "structure", + "members": { + "AlternateContactType": { + "target": "com.amazonaws.account#AlternateContactType", + "traits": { + "smithy.api#documentation": "

Specifies which of the alternate contacts to delete.

", + "smithy.api#required": {} + } + }, + "AccountId": { + "target": "com.amazonaws.account#AccountId", + "traits": { + "smithy.api#documentation": "

Specifies the 12 digit account ID number of the Amazon Web Services account that \n you want to access or modify with this operation.

\n

If you do not specify this parameter, it defaults to the Amazon Web Services account of the \n identity used to call the operation.

\n

To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and \n the specified account ID must be a member account in the same organization. The\n organization must have all features \n enabled, and the organization must have trusted access enabled for the \n Account Management service, and optionally a delegated admin account \n assigned.

\n \n

The management account can't specify its own AccountId; it must call\n the operation in standalone context by not including the AccountId \n parameter.

\n
\n

To call this operation on an account that is not a member of an organization, then \n don't specify this parameter, and call the operation using an identity belonging to\n the account whose contacts you wish to retrieve or modify.

" + } + } + } + }, + "com.amazonaws.account#EmailAddress": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "[\\w+=,.-]+@[\\w.-]+\\.[\\w]+", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.account#GetAlternateContact": { + "type": "operation", + "input": { + "target": "com.amazonaws.account#GetAlternateContactRequest" + }, + "output": { + "target": "com.amazonaws.account#GetAlternateContactResponse" + }, + "errors": [ + { + "target": "com.amazonaws.account#AccessDeniedException" + }, + { + "target": "com.amazonaws.account#InternalServerException" + }, + { + "target": "com.amazonaws.account#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.account#TooManyRequestsException" + }, + { + "target": "com.amazonaws.account#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves the specified alternate contact attached to an Amazon Web Services account.

\n

For complete details about how to use the alternate contact operations, see Access or\n updating the alternate contacts.

", + "smithy.api#http": { + "method": "POST", + "uri": "/getAlternateContact", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.account#GetAlternateContactRequest": { + "type": "structure", + "members": { + "AlternateContactType": { + "target": "com.amazonaws.account#AlternateContactType", + "traits": { + "smithy.api#documentation": "

Specifies which alternate contact you want to retrieve.

", + "smithy.api#required": {} + } + }, + "AccountId": { + "target": "com.amazonaws.account#AccountId", + "traits": { + "smithy.api#documentation": "

Specifies the 12 digit account ID number of the Amazon Web Services account that \n you want to access or modify with this operation.

\n

If you do not specify this parameter, it defaults to the Amazon Web Services account of the \n identity used to call the operation.

\n

To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and \n the specified account ID must be a member account in the same organization. The\n organization must have all features \n enabled, and the organization must have trusted access enabled for the \n Account Management service, and optionally a delegated admin account \n assigned.

\n \n

The management account can't specify its own AccountId; it must call\n the operation in standalone context by not including the AccountId \n parameter.

\n
\n

To call this operation on an account that is not a member of an organization, then \n don't specify this parameter, and call the operation using an identity belonging to\n the account whose contacts you wish to retrieve or modify.

" + } + } + } + }, + "com.amazonaws.account#GetAlternateContactResponse": { + "type": "structure", + "members": { + "AlternateContact": { + "target": "com.amazonaws.account#AlternateContact", + "traits": { + "smithy.api#documentation": "

A structure that contains the details for the specified alternate contact.

" + } + } + } + }, + "com.amazonaws.account#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The operation failed because of an error internal to Amazon Web Services. Try your operation again\n later.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.account#Name": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.account#PhoneNumber": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + }, + "smithy.api#pattern": "^[\\s0-9()+-]+$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.account#PutAlternateContact": { + "type": "operation", + "input": { + "target": "com.amazonaws.account#PutAlternateContactRequest" + }, + "errors": [ + { + "target": "com.amazonaws.account#AccessDeniedException" + }, + { + "target": "com.amazonaws.account#InternalServerException" + }, + { + "target": "com.amazonaws.account#TooManyRequestsException" + }, + { + "target": "com.amazonaws.account#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Modifies the specified alternate contact attached to an Amazon Web Services account.

\n

For complete details about how to use the alternate contact operations, see Access or\n updating the alternate contacts.

", + "smithy.api#http": { + "method": "POST", + "uri": "/putAlternateContact", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.account#PutAlternateContactRequest": { + "type": "structure", + "members": { + "Name": { + "target": "com.amazonaws.account#Name", + "traits": { + "smithy.api#documentation": "

Specifies a name for the alternate contact.

", + "smithy.api#required": {} + } + }, + "Title": { + "target": "com.amazonaws.account#Title", + "traits": { + "smithy.api#documentation": "

Specifies a title for the alternate contact.

", + "smithy.api#required": {} + } + }, + "EmailAddress": { + "target": "com.amazonaws.account#EmailAddress", + "traits": { + "smithy.api#documentation": "

Specifies an email address for the alternate contact.

", + "smithy.api#required": {} + } + }, + "PhoneNumber": { + "target": "com.amazonaws.account#PhoneNumber", + "traits": { + "smithy.api#documentation": "

Specifies a phone number for the alternate contact.

", + "smithy.api#required": {} + } + }, + "AlternateContactType": { + "target": "com.amazonaws.account#AlternateContactType", + "traits": { + "smithy.api#documentation": "

Specifies which alternate contact you want to create or update.

", + "smithy.api#required": {} + } + }, + "AccountId": { + "target": "com.amazonaws.account#AccountId", + "traits": { + "smithy.api#documentation": "

Specifies the 12 digit account ID number of the Amazon Web Services account that \n you want to access or modify with this operation.

\n

If you do not specify this parameter, it defaults to the Amazon Web Services account of the \n identity used to call the operation.

\n

To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account, and \n the specified account ID must be a member account in the same organization. The\n organization must have all features \n enabled, and the organization must have trusted access enabled for the \n Account Management service, and optionally a delegated admin account \n assigned.

\n \n

The management account can't specify its own AccountId; it must call\n the operation in standalone context by not including the AccountId \n parameter.

\n
\n

To call this operation on an account that is not a member of an organization, then \n don't specify this parameter, and call the operation using an identity belonging to\n the account whose contacts you wish to retrieve or modify.

" + } + } + } + }, + "com.amazonaws.account#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The operation failed because it specified a resource that can't be found.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.account#Title": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 50 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.account#TooManyRequestsException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The operation failed because it was called too frequently and exceeded a throttle\n limit.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": { + "throttling": true + } + } + }, + "com.amazonaws.account#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The operation failed because one of the input parameters was invalid.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + } + } +} \ No newline at end of file diff --git a/codegen/sdk-codegen/aws-models/amp.2020-08-01.json b/codegen/sdk-codegen/aws-models/amp.2020-08-01.json index b9b38326f4b..9f97ba92d18 100644 --- a/codegen/sdk-codegen/aws-models/amp.2020-08-01.json +++ b/codegen/sdk-codegen/aws-models/amp.2020-08-01.json @@ -18,6 +18,136 @@ "smithy.api#httpError": 403 } }, + "com.amazonaws.amp#AlertManagerDefinition": { + "type": "resource", + "identifiers": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId" + } + }, + "put": { + "target": "com.amazonaws.amp#CreateAlertManagerDefinition" + }, + "read": { + "target": "com.amazonaws.amp#DescribeAlertManagerDefinition" + }, + "update": { + "target": "com.amazonaws.amp#PutAlertManagerDefinition" + }, + "delete": { + "target": "com.amazonaws.amp#DeleteAlertManagerDefinition" + }, + "traits": { + "aws.api#arn": { + "template": "workspace/{workspaceId}", + "absolute": false, + "noAccount": false, + "noRegion": false + }, + "smithy.api#documentation": "The definition of the alert manager in the AMP workspace" + } + }, + "com.amazonaws.amp#AlertManagerDefinitionData": { + "type": "blob", + "traits": { + "smithy.api#documentation": "The alert manager definition data." + } + }, + "com.amazonaws.amp#AlertManagerDefinitionDescription": { + "type": "structure", + "members": { + "status": { + "target": "com.amazonaws.amp#AlertManagerDefinitionStatus", + "traits": { + "smithy.api#documentation": "The status of alert manager definition.", + "smithy.api#required": {} + } + }, + "data": { + "target": "com.amazonaws.amp#AlertManagerDefinitionData", + "traits": { + "smithy.api#documentation": "The alert manager definition.", + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "The time when the alert manager definition was created.", + "smithy.api#required": {} + } + }, + "modifiedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "The time when the alert manager definition was modified.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the properties of an alert manager definition." + } + }, + "com.amazonaws.amp#AlertManagerDefinitionStatus": { + "type": "structure", + "members": { + "statusCode": { + "target": "com.amazonaws.amp#AlertManagerDefinitionStatusCode", + "traits": { + "smithy.api#documentation": "Status code of this definition.", + "smithy.api#required": {} + } + }, + "statusReason": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The reason for failure if any." + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the status of a definition." + } + }, + "com.amazonaws.amp#AlertManagerDefinitionStatusCode": { + "type": "string", + "traits": { + "smithy.api#documentation": "State of an alert manager definition.", + "smithy.api#enum": [ + { + "value": "CREATING", + "name": "CREATING", + "documentation": "Definition is being created. Update/Deletion is disallowed until definition is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "ACTIVE", + "name": "ACTIVE", + "documentation": "Definition has been created/updated. Update/Deletion is disallowed until definition is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "UPDATING", + "name": "UPDATING", + "documentation": "Definition is being updated. Update/Deletion is disallowed until definition is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "DELETING", + "name": "DELETING", + "documentation": "Definition is being deleting. Update/Deletion is disallowed until definition is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "CREATION_FAILED", + "name": "CREATION_FAILED", + "documentation": "Definition creation failed." + }, + { + "value": "UPDATE_FAILED", + "name": "UPDATE_FAILED", + "documentation": "Definition update failed." + } + ] + } + }, "com.amazonaws.amp#AmazonPrometheusService": { "type": "service", "version": "2020-08-01", @@ -107,13 +237,13 @@ "smithy.api#httpError": 409 } }, - "com.amazonaws.amp#CreateWorkspace": { + "com.amazonaws.amp#CreateAlertManagerDefinition": { "type": "operation", "input": { - "target": "com.amazonaws.amp#CreateWorkspaceRequest" + "target": "com.amazonaws.amp#CreateAlertManagerDefinitionRequest" }, "output": { - "target": "com.amazonaws.amp#CreateWorkspaceResponse" + "target": "com.amazonaws.amp#CreateAlertManagerDefinitionResponse" }, "errors": [ { @@ -125,6 +255,9 @@ { "target": "com.amazonaws.amp#InternalServerException" }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, { "target": "com.amazonaws.amp#ServiceQuotaExceededException" }, @@ -136,22 +269,31 @@ } ], "traits": { - "smithy.api#documentation": "Creates a new AMP workspace.", + "smithy.api#documentation": "Create an alert manager definition.", "smithy.api#http": { "method": "POST", - "uri": "/workspaces", + "uri": "/workspaces/{workspaceId}/alertmanager/definition", "code": 202 }, "smithy.api#idempotent": {} } }, - "com.amazonaws.amp#CreateWorkspaceRequest": { + "com.amazonaws.amp#CreateAlertManagerDefinitionRequest": { "type": "structure", "members": { - "alias": { - "target": "com.amazonaws.amp#WorkspaceAlias", + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", "traits": { - "smithy.api#documentation": "An optional user-assigned alias for this workspace. This alias is for user reference and does not need to be unique." + "smithy.api#documentation": "The ID of the workspace in which to create the alert manager definition.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "data": { + "target": "com.amazonaws.amp#AlertManagerDefinitionData", + "traits": { + "smithy.api#documentation": "The alert manager definition data.", + "smithy.api#required": {} } }, "clientToken": { @@ -160,68 +302,51 @@ "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", "smithy.api#idempotencyToken": {} } - }, - "tags": { - "target": "com.amazonaws.amp#TagMap", - "traits": { - "smithy.api#documentation": "Optional, user-provided tags for this workspace." - } } }, "traits": { - "smithy.api#documentation": "Represents the input of a CreateWorkspace operation." + "smithy.api#documentation": "Represents the input of a CreateAlertManagerDefinition operation." } }, - "com.amazonaws.amp#CreateWorkspaceResponse": { + "com.amazonaws.amp#CreateAlertManagerDefinitionResponse": { "type": "structure", "members": { - "workspaceId": { - "target": "com.amazonaws.amp#WorkspaceId", - "traits": { - "smithy.api#documentation": "The generated ID of the workspace that was just created.", - "smithy.api#required": {} - } - }, - "arn": { - "target": "com.amazonaws.amp#WorkspaceArn", - "traits": { - "smithy.api#documentation": "The ARN of the workspace that was just created.", - "smithy.api#required": {} - } - }, "status": { - "target": "com.amazonaws.amp#WorkspaceStatus", + "target": "com.amazonaws.amp#AlertManagerDefinitionStatus", "traits": { - "smithy.api#documentation": "The status of the workspace that was just created (usually CREATING).", + "smithy.api#documentation": "The status of alert manager definition.", "smithy.api#required": {} } - }, - "tags": { - "target": "com.amazonaws.amp#TagMap", - "traits": { - "smithy.api#documentation": "The tags of this workspace." - } } }, "traits": { - "smithy.api#documentation": "Represents the output of a CreateWorkspace operation." + "smithy.api#documentation": "Represents the output of a CreateAlertManagerDefinition operation." } }, - "com.amazonaws.amp#DeleteWorkspace": { + "com.amazonaws.amp#CreateRuleGroupsNamespace": { "type": "operation", "input": { - "target": "com.amazonaws.amp#DeleteWorkspaceRequest" + "target": "com.amazonaws.amp#CreateRuleGroupsNamespaceRequest" + }, + "output": { + "target": "com.amazonaws.amp#CreateRuleGroupsNamespaceResponse" }, "errors": [ { "target": "com.amazonaws.amp#AccessDeniedException" }, + { + "target": "com.amazonaws.amp#ConflictException" + }, { "target": "com.amazonaws.amp#InternalServerException" }, { "target": "com.amazonaws.amp#ResourceNotFoundException" }, + { + "target": "com.amazonaws.amp#ServiceQuotaExceededException" + }, { "target": "com.amazonaws.amp#ThrottlingException" }, @@ -230,56 +355,113 @@ } ], "traits": { - "smithy.api#documentation": "Deletes an AMP workspace.", + "smithy.api#documentation": "Create a rule group namespace.", "smithy.api#http": { - "method": "DELETE", - "uri": "/workspaces/{workspaceId}", + "method": "POST", + "uri": "/workspaces/{workspaceId}/rulegroupsnamespaces", "code": 202 }, "smithy.api#idempotent": {} } }, - "com.amazonaws.amp#DeleteWorkspaceRequest": { + "com.amazonaws.amp#CreateRuleGroupsNamespaceRequest": { "type": "structure", "members": { "workspaceId": { "target": "com.amazonaws.amp#WorkspaceId", "traits": { - "smithy.api#documentation": "The ID of the workspace to delete.", + "smithy.api#documentation": "The ID of the workspace in which to create the rule group namespace.", "smithy.api#httpLabel": {}, "smithy.api#required": {} } }, + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "The rule groups namespace name.", + "smithy.api#required": {} + } + }, + "data": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceData", + "traits": { + "smithy.api#documentation": "The namespace data that define the rule groups.", + "smithy.api#required": {} + } + }, "clientToken": { "target": "com.amazonaws.amp#IdempotencyToken", "traits": { "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", - "smithy.api#httpQuery": "clientToken", "smithy.api#idempotencyToken": {} } + }, + "tags": { + "target": "com.amazonaws.amp#TagMap", + "traits": { + "smithy.api#documentation": "Optional, user-provided tags for this rule groups namespace." + } } }, "traits": { - "smithy.api#documentation": "Represents the input of a DeleteWorkspace operation." + "smithy.api#documentation": "Represents the input of a CreateRuleGroupsNamespace operation." } }, - "com.amazonaws.amp#DescribeWorkspace": { + "com.amazonaws.amp#CreateRuleGroupsNamespaceResponse": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "The rule groups namespace name.", + "smithy.api#required": {} + } + }, + "arn": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of this rule groups namespace.", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceStatus", + "traits": { + "smithy.api#documentation": "The status of rule groups namespace.", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.amp#TagMap", + "traits": { + "smithy.api#documentation": "The tags of this rule groups namespace." + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a CreateRuleGroupsNamespace operation." + } + }, + "com.amazonaws.amp#CreateWorkspace": { "type": "operation", "input": { - "target": "com.amazonaws.amp#DescribeWorkspaceRequest" + "target": "com.amazonaws.amp#CreateWorkspaceRequest" }, "output": { - "target": "com.amazonaws.amp#DescribeWorkspaceResponse" + "target": "com.amazonaws.amp#CreateWorkspaceResponse" }, "errors": [ { "target": "com.amazonaws.amp#AccessDeniedException" }, + { + "target": "com.amazonaws.amp#ConflictException" + }, { "target": "com.amazonaws.amp#InternalServerException" }, { - "target": "com.amazonaws.amp#ResourceNotFoundException" + "target": "com.amazonaws.amp#ServiceQuotaExceededException" }, { "target": "com.amazonaws.amp#ThrottlingException" @@ -289,58 +471,1020 @@ } ], "traits": { - "smithy.api#documentation": "Describes an existing AMP workspace.", + "smithy.api#documentation": "Creates a new AMP workspace.", "smithy.api#http": { - "method": "GET", - "uri": "/workspaces/{workspaceId}", - "code": 200 + "method": "POST", + "uri": "/workspaces", + "code": 202 }, - "smithy.api#readonly": {} + "smithy.api#idempotent": {} } }, - "com.amazonaws.amp#DescribeWorkspaceRequest": { + "com.amazonaws.amp#CreateWorkspaceRequest": { "type": "structure", "members": { - "workspaceId": { - "target": "com.amazonaws.amp#WorkspaceId", + "alias": { + "target": "com.amazonaws.amp#WorkspaceAlias", "traits": { - "smithy.api#documentation": "The ID of the workspace to describe.", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} + "smithy.api#documentation": "An optional user-assigned alias for this workspace. This alias is for user reference and does not need to be unique." + } + }, + "clientToken": { + "target": "com.amazonaws.amp#IdempotencyToken", + "traits": { + "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", + "smithy.api#idempotencyToken": {} + } + }, + "tags": { + "target": "com.amazonaws.amp#TagMap", + "traits": { + "smithy.api#documentation": "Optional, user-provided tags for this workspace." } } }, "traits": { - "smithy.api#documentation": "Represents the input of a DescribeWorkspace operation." + "smithy.api#documentation": "Represents the input of a CreateWorkspace operation." } }, - "com.amazonaws.amp#DescribeWorkspaceResponse": { + "com.amazonaws.amp#CreateWorkspaceResponse": { "type": "structure", "members": { - "workspace": { - "target": "com.amazonaws.amp#WorkspaceDescription", + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", "traits": { - "smithy.api#documentation": "The properties of the selected workspace.", + "smithy.api#documentation": "The generated ID of the workspace that was just created.", + "smithy.api#required": {} + } + }, + "arn": { + "target": "com.amazonaws.amp#WorkspaceArn", + "traits": { + "smithy.api#documentation": "The ARN of the workspace that was just created.", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.amp#WorkspaceStatus", + "traits": { + "smithy.api#documentation": "The status of the workspace that was just created (usually CREATING).", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.amp#TagMap", + "traits": { + "smithy.api#documentation": "The tags of this workspace." + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a CreateWorkspace operation." + } + }, + "com.amazonaws.amp#DeleteAlertManagerDefinition": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#DeleteAlertManagerDefinitionRequest" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#ConflictException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an alert manager definition.", + "smithy.api#http": { + "method": "DELETE", + "uri": "/workspaces/{workspaceId}/alertmanager/definition", + "code": 202 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.amp#DeleteAlertManagerDefinitionRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace in which to delete the alert manager definition.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.amp#IdempotencyToken", + "traits": { + "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", + "smithy.api#httpQuery": "clientToken", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a DeleteAlertManagerDefinition operation." + } + }, + "com.amazonaws.amp#DeleteRuleGroupsNamespace": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#DeleteRuleGroupsNamespaceRequest" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#ConflictException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Delete a rule groups namespace.", + "smithy.api#http": { + "method": "DELETE", + "uri": "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}", + "code": 202 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.amp#DeleteRuleGroupsNamespaceRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace to delete rule group definition.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "The rule groups namespace name.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.amp#IdempotencyToken", + "traits": { + "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", + "smithy.api#httpQuery": "clientToken", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a DeleteRuleGroupsNamespace operation." + } + }, + "com.amazonaws.amp#DeleteWorkspace": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#DeleteWorkspaceRequest" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#ConflictException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an AMP workspace.", + "smithy.api#http": { + "method": "DELETE", + "uri": "/workspaces/{workspaceId}", + "code": 202 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.amp#DeleteWorkspaceRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace to delete.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.amp#IdempotencyToken", + "traits": { + "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", + "smithy.api#httpQuery": "clientToken", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a DeleteWorkspace operation." + } + }, + "com.amazonaws.amp#DescribeAlertManagerDefinition": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#DescribeAlertManagerDefinitionRequest" + }, + "output": { + "target": "com.amazonaws.amp#DescribeAlertManagerDefinitionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Describes an alert manager definition.", + "smithy.api#http": { + "method": "GET", + "uri": "/workspaces/{workspaceId}/alertmanager/definition", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.amp#DescribeAlertManagerDefinitionRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace to describe.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a DescribeAlertManagerDefinition operation." + } + }, + "com.amazonaws.amp#DescribeAlertManagerDefinitionResponse": { + "type": "structure", + "members": { + "alertManagerDefinition": { + "target": "com.amazonaws.amp#AlertManagerDefinitionDescription", + "traits": { + "smithy.api#documentation": "The properties of the selected workspace's alert manager definition.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a DescribeAlertManagerDefinition operation." + } + }, + "com.amazonaws.amp#DescribeRuleGroupsNamespace": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#DescribeRuleGroupsNamespaceRequest" + }, + "output": { + "target": "com.amazonaws.amp#DescribeRuleGroupsNamespaceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Describe a rule groups namespace.", + "smithy.api#http": { + "method": "GET", + "uri": "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.amp#DescribeRuleGroupsNamespaceRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace to describe.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "The rule groups namespace.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a DescribeRuleGroupsNamespace operation." + } + }, + "com.amazonaws.amp#DescribeRuleGroupsNamespaceResponse": { + "type": "structure", + "members": { + "ruleGroupsNamespace": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceDescription", + "traits": { + "smithy.api#documentation": "The selected rule groups namespace.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a DescribeRuleGroupsNamespace operation." + } + }, + "com.amazonaws.amp#DescribeWorkspace": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#DescribeWorkspaceRequest" + }, + "output": { + "target": "com.amazonaws.amp#DescribeWorkspaceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Describes an existing AMP workspace.", + "smithy.api#http": { + "method": "GET", + "uri": "/workspaces/{workspaceId}", + "code": 200 + }, + "smithy.api#readonly": {}, + "smithy.waiters#waitable": { + "WorkspaceActive": { + "documentation": "Wait until a workspace reaches ACTIVE status", + "acceptors": [ + { + "state": "success", + "matcher": { + "output": { + "path": "workspace.status.statusCode", + "expected": "ACTIVE", + "comparator": "stringEquals" + } + } + }, + { + "state": "retry", + "matcher": { + "output": { + "path": "workspace.status.statusCode", + "expected": "UPDATING", + "comparator": "stringEquals" + } + } + }, + { + "state": "retry", + "matcher": { + "output": { + "path": "workspace.status.statusCode", + "expected": "CREATING", + "comparator": "stringEquals" + } + } + } + ] + }, + "WorkspaceDeleted": { + "documentation": "Wait until a workspace reaches DELETED status", + "acceptors": [ + { + "state": "success", + "matcher": { + "errorType": "ResourceNotFoundException" + } + }, + { + "state": "retry", + "matcher": { + "output": { + "path": "workspace.status.statusCode", + "expected": "DELETING", + "comparator": "stringEquals" + } + } + } + ] + } + } + } + }, + "com.amazonaws.amp#DescribeWorkspaceRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace to describe.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a DescribeWorkspace operation." + } + }, + "com.amazonaws.amp#DescribeWorkspaceResponse": { + "type": "structure", + "members": { + "workspace": { + "target": "com.amazonaws.amp#WorkspaceDescription", + "traits": { + "smithy.api#documentation": "The properties of the selected workspace.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a DescribeWorkspace operation." + } + }, + "com.amazonaws.amp#IdempotencyToken": { + "type": "string", + "traits": { + "smithy.api#documentation": "An identifier used to ensure the idempotency of a write request.", + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "[!-~]+" + } + }, + "com.amazonaws.amp#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Description of the error.", + "smithy.api#required": {} + } + }, + "retryAfterSeconds": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Advice to clients on when the call can be safely retried.", + "smithy.api#httpHeader": "Retry-After" + } + } + }, + "traits": { + "smithy.api#documentation": "Unexpected error during processing of request.", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.amp#ListRuleGroupsNamespaces": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#ListRuleGroupsNamespacesRequest" + }, + "output": { + "target": "com.amazonaws.amp#ListRuleGroupsNamespacesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists rule groups namespaces.", + "smithy.api#http": { + "method": "GET", + "uri": "/workspaces/{workspaceId}/rulegroupsnamespaces", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "ruleGroupsNamespaces", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.amp#ListRuleGroupsNamespacesRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "Optional filter for rule groups namespace name. Only the rule groups namespace that begin with this value will be returned.", + "smithy.api#httpQuery": "name" + } + }, + "nextToken": { + "target": "com.amazonaws.amp#PaginationToken", + "traits": { + "smithy.api#documentation": "Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListRuleGroupsNamespaces request.", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Maximum results to return in response (default=100, maximum=1000).", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a ListRuleGroupsNamespaces operation." + } + }, + "com.amazonaws.amp#ListRuleGroupsNamespacesResponse": { + "type": "structure", + "members": { + "ruleGroupsNamespaces": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceSummaryList", + "traits": { + "smithy.api#documentation": "The list of the selected rule groups namespaces.", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.amp#PaginationToken", + "traits": { + "smithy.api#documentation": "Pagination token to use when requesting the next page in this list." + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a ListRuleGroupsNamespaces operation." + } + }, + "com.amazonaws.amp#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.amp#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists the tags you have assigned to the resource.", + "smithy.api#http": { + "method": "GET", + "uri": "/tags/{resourceArn}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.amp#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The ARN of the resource.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.amp#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.amp#TagMap" + } + } + }, + "com.amazonaws.amp#ListWorkspaces": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#ListWorkspacesRequest" + }, + "output": { + "target": "com.amazonaws.amp#ListWorkspacesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists all AMP workspaces, including workspaces being created or deleted.", + "smithy.api#http": { + "method": "GET", + "uri": "/workspaces", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "workspaces", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.amp#ListWorkspacesRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.amp#PaginationToken", + "traits": { + "smithy.api#documentation": "Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListWorkspaces request.", + "smithy.api#httpQuery": "nextToken" + } + }, + "alias": { + "target": "com.amazonaws.amp#WorkspaceAlias", + "traits": { + "smithy.api#documentation": "Optional filter for workspace alias. Only the workspaces with aliases that begin with this value will be returned.", + "smithy.api#httpQuery": "alias" + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Maximum results to return in response (default=100, maximum=1000).", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a ListWorkspaces operation." + } + }, + "com.amazonaws.amp#ListWorkspacesResponse": { + "type": "structure", + "members": { + "workspaces": { + "target": "com.amazonaws.amp#WorkspaceSummaryList", + "traits": { + "smithy.api#documentation": "The list of existing workspaces, including those undergoing creation or deletion.", "smithy.api#required": {} } + }, + "nextToken": { + "target": "com.amazonaws.amp#PaginationToken", + "traits": { + "smithy.api#documentation": "Pagination token to use when requesting the next page in this list." + } } }, "traits": { - "smithy.api#documentation": "Represents the output of a DescribeWorkspace operation." + "smithy.api#documentation": "Represents the output of a ListWorkspaces operation." } }, - "com.amazonaws.amp#IdempotencyToken": { + "com.amazonaws.amp#PaginationToken": { "type": "string", "traits": { - "smithy.api#documentation": "An identifier used to ensure the idempotency of a write request.", - "smithy.api#length": { - "min": 1, - "max": 64 + "smithy.api#documentation": "A token used to access the next page in a paginated result set." + } + }, + "com.amazonaws.amp#PutAlertManagerDefinition": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#PutAlertManagerDefinitionRequest" + }, + "output": { + "target": "com.amazonaws.amp#PutAlertManagerDefinitionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" }, - "smithy.api#pattern": "[!-~]+" + { + "target": "com.amazonaws.amp#ConflictException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Update an alert manager definition.", + "smithy.api#http": { + "method": "PUT", + "uri": "/workspaces/{workspaceId}/alertmanager/definition", + "code": 202 + }, + "smithy.api#idempotent": {} } }, - "com.amazonaws.amp#InternalServerException": { + "com.amazonaws.amp#PutAlertManagerDefinitionRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace in which to update the alert manager definition.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "data": { + "target": "com.amazonaws.amp#AlertManagerDefinitionData", + "traits": { + "smithy.api#documentation": "The alert manager definition data.", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.amp#IdempotencyToken", + "traits": { + "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a PutAlertManagerDefinition operation." + } + }, + "com.amazonaws.amp#PutAlertManagerDefinitionResponse": { + "type": "structure", + "members": { + "status": { + "target": "com.amazonaws.amp#AlertManagerDefinitionStatus", + "traits": { + "smithy.api#documentation": "The status of alert manager definition.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a PutAlertManagerDefinition operation." + } + }, + "com.amazonaws.amp#PutRuleGroupsNamespace": { + "type": "operation", + "input": { + "target": "com.amazonaws.amp#PutRuleGroupsNamespaceRequest" + }, + "output": { + "target": "com.amazonaws.amp#PutRuleGroupsNamespaceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.amp#AccessDeniedException" + }, + { + "target": "com.amazonaws.amp#ConflictException" + }, + { + "target": "com.amazonaws.amp#InternalServerException" + }, + { + "target": "com.amazonaws.amp#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.amp#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.amp#ThrottlingException" + }, + { + "target": "com.amazonaws.amp#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Update a rule groups namespace.", + "smithy.api#http": { + "method": "PUT", + "uri": "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}", + "code": 202 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.amp#PutRuleGroupsNamespaceRequest": { + "type": "structure", + "members": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId", + "traits": { + "smithy.api#documentation": "The ID of the workspace in which to update the rule group namespace.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "The rule groups namespace name.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "data": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceData", + "traits": { + "smithy.api#documentation": "The namespace data that define the rule groups.", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.amp#IdempotencyToken", + "traits": { + "smithy.api#documentation": "Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the input of a PutRuleGroupsNamespace operation." + } + }, + "com.amazonaws.amp#PutRuleGroupsNamespaceResponse": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "The rule groups namespace name.", + "smithy.api#required": {} + } + }, + "arn": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceArn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of this rule groups namespace.", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceStatus", + "traits": { + "smithy.api#documentation": "The status of rule groups namespace.", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.amp#TagMap", + "traits": { + "smithy.api#documentation": "The tags of this rule groups namespace." + } + } + }, + "traits": { + "smithy.api#documentation": "Represents the output of a PutRuleGroupsNamespace operation." + } + }, + "com.amazonaws.amp#ResourceNotFoundException": { "type": "structure", "members": { "message": { @@ -350,204 +1494,261 @@ "smithy.api#required": {} } }, - "retryAfterSeconds": { - "target": "smithy.api#Integer", + "resourceId": { + "target": "smithy.api#String", "traits": { - "smithy.api#documentation": "Advice to clients on when the call can be safely retried.", - "smithy.api#httpHeader": "Retry-After" + "smithy.api#documentation": "Identifier of the resource affected.", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Type of the resource affected.", + "smithy.api#required": {} } } }, "traits": { - "smithy.api#documentation": "Unexpected error during processing of request.", - "smithy.api#error": "server", - "smithy.api#httpError": 500, - "smithy.api#retryable": {} + "smithy.api#documentation": "Request references a resource which does not exist.", + "smithy.api#error": "client", + "smithy.api#httpError": 404 } }, - "com.amazonaws.amp#ListTagsForResource": { - "type": "operation", - "input": { - "target": "com.amazonaws.amp#ListTagsForResourceRequest" + "com.amazonaws.amp#RuleGroupsNamespace": { + "type": "resource", + "identifiers": { + "workspaceId": { + "target": "com.amazonaws.amp#WorkspaceId" + }, + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName" + } }, - "output": { - "target": "com.amazonaws.amp#ListTagsForResourceResponse" + "put": { + "target": "com.amazonaws.amp#CreateRuleGroupsNamespace" }, - "errors": [ - { - "target": "com.amazonaws.amp#AccessDeniedException" - }, - { - "target": "com.amazonaws.amp#InternalServerException" - }, - { - "target": "com.amazonaws.amp#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.amp#ThrottlingException" + "read": { + "target": "com.amazonaws.amp#DescribeRuleGroupsNamespace" + }, + "update": { + "target": "com.amazonaws.amp#PutRuleGroupsNamespace" + }, + "delete": { + "target": "com.amazonaws.amp#DeleteRuleGroupsNamespace" + }, + "list": { + "target": "com.amazonaws.amp#ListRuleGroupsNamespaces" + }, + "traits": { + "aws.api#arn": { + "template": "rulegroupsnamespace/{workspaceId}/{name}", + "absolute": false, + "noAccount": false, + "noRegion": false }, - { - "target": "com.amazonaws.amp#ValidationException" - } - ], + "smithy.api#documentation": "The definition of a rule group namespace in an AMP workspace" + } + }, + "com.amazonaws.amp#RuleGroupsNamespaceArn": { + "type": "string", "traits": { - "smithy.api#documentation": "Lists the tags you have assigned to the resource.", - "smithy.api#http": { - "method": "GET", - "uri": "/tags/{resourceArn}", - "code": 200 + "aws.api#arnReference": { + "type": "AWS::APS::RuleGroupsNamespace", + "service": "com.amazonaws.services.awsprometheus.serviceapi#ManagedPrometheusCP", + "resource": "com.amazonaws.amp#RuleGroupsNamespace" }, - "smithy.api#readonly": {} + "smithy.api#documentation": "An ARN identifying a rule groups namespace." } }, - "com.amazonaws.amp#ListTagsForResourceRequest": { + "com.amazonaws.amp#RuleGroupsNamespaceData": { + "type": "blob", + "traits": { + "smithy.api#documentation": "The rule groups namespace data." + } + }, + "com.amazonaws.amp#RuleGroupsNamespaceDescription": { "type": "structure", "members": { - "resourceArn": { - "target": "smithy.api#String", + "arn": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceArn", "traits": { - "smithy.api#documentation": "The ARN of the resource.", - "smithy.api#httpLabel": {}, + "smithy.api#documentation": "The Amazon Resource Name (ARN) of this rule groups namespace.", "smithy.api#required": {} } - } - } - }, - "com.amazonaws.amp#ListTagsForResourceResponse": { - "type": "structure", - "members": { - "tags": { - "target": "com.amazonaws.amp#TagMap" - } - } - }, - "com.amazonaws.amp#ListWorkspaces": { - "type": "operation", - "input": { - "target": "com.amazonaws.amp#ListWorkspacesRequest" - }, - "output": { - "target": "com.amazonaws.amp#ListWorkspacesResponse" - }, - "errors": [ - { - "target": "com.amazonaws.amp#AccessDeniedException" - }, - { - "target": "com.amazonaws.amp#InternalServerException" }, - { - "target": "com.amazonaws.amp#ThrottlingException" + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", + "traits": { + "smithy.api#documentation": "The rule groups namespace name.", + "smithy.api#required": {} + } }, - { - "target": "com.amazonaws.amp#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Lists all AMP workspaces, including workspaces being created or deleted.", - "smithy.api#http": { - "method": "GET", - "uri": "/workspaces", - "code": 200 + "status": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceStatus", + "traits": { + "smithy.api#documentation": "The status of rule groups namespace.", + "smithy.api#required": {} + } }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "items": "workspaces", - "pageSize": "maxResults" + "data": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceData", + "traits": { + "smithy.api#documentation": "The rule groups namespace data.", + "smithy.api#required": {} + } }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.amp#ListWorkspacesRequest": { - "type": "structure", - "members": { - "nextToken": { - "target": "com.amazonaws.amp#PaginationToken", + "createdAt": { + "target": "smithy.api#Timestamp", "traits": { - "smithy.api#documentation": "Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListWorkspaces request.", - "smithy.api#httpQuery": "nextToken" + "smithy.api#documentation": "The time when the rule groups namespace was created.", + "smithy.api#required": {} } }, - "alias": { - "target": "com.amazonaws.amp#WorkspaceAlias", + "modifiedAt": { + "target": "smithy.api#Timestamp", "traits": { - "smithy.api#documentation": "Optional filter for workspace alias. Only the workspaces with aliases that begin with this value will be returned.", - "smithy.api#httpQuery": "alias" + "smithy.api#documentation": "The time when the rule groups namespace was modified.", + "smithy.api#required": {} } }, - "maxResults": { - "target": "smithy.api#Integer", + "tags": { + "target": "com.amazonaws.amp#TagMap", "traits": { - "smithy.api#documentation": "Maximum results to return in response (default=100, maximum=1000).", - "smithy.api#httpQuery": "maxResults", - "smithy.api#range": { - "min": 1, - "max": 1000 - } + "smithy.api#documentation": "The tags of this rule groups namespace." } } }, "traits": { - "smithy.api#documentation": "Represents the input of a ListWorkspaces operation." + "smithy.api#documentation": "Represents a description of the rule groups namespace." } }, - "com.amazonaws.amp#ListWorkspacesResponse": { + "com.amazonaws.amp#RuleGroupsNamespaceName": { + "type": "string", + "traits": { + "smithy.api#documentation": "The namespace name that the rule group belong to.", + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "[0-9A-Za-z][-.0-9A-Z_a-z]*" + } + }, + "com.amazonaws.amp#RuleGroupsNamespaceStatus": { "type": "structure", "members": { - "workspaces": { - "target": "com.amazonaws.amp#WorkspaceSummaryList", + "statusCode": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceStatusCode", "traits": { - "smithy.api#documentation": "The list of existing workspaces, including those undergoing creation or deletion.", + "smithy.api#documentation": "Status code of this namespace.", "smithy.api#required": {} } }, - "nextToken": { - "target": "com.amazonaws.amp#PaginationToken", + "statusReason": { + "target": "smithy.api#String", "traits": { - "smithy.api#documentation": "Pagination token to use when requesting the next page in this list." + "smithy.api#documentation": "The reason for failure if any." } } }, "traits": { - "smithy.api#documentation": "Represents the output of a ListWorkspaces operation." + "smithy.api#documentation": "Represents the status of a namespace." } }, - "com.amazonaws.amp#PaginationToken": { + "com.amazonaws.amp#RuleGroupsNamespaceStatusCode": { "type": "string", "traits": { - "smithy.api#documentation": "A token used to access the next page in a paginated result set." + "smithy.api#documentation": "State of a namespace.", + "smithy.api#enum": [ + { + "value": "CREATING", + "name": "CREATING", + "documentation": "Namespace is being created. Update/Deletion is disallowed until namespace is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "ACTIVE", + "name": "ACTIVE", + "documentation": "Namespace has been created/updated. Update/Deletion is disallowed until namespace is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "UPDATING", + "name": "UPDATING", + "documentation": "Namespace is being updated. Update/Deletion is disallowed until namespace is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "DELETING", + "name": "DELETING", + "documentation": "Namespace is being deleting. Update/Deletion is disallowed until namespace is ACTIVE and workspace status is ACTIVE." + }, + { + "value": "CREATION_FAILED", + "name": "CREATION_FAILED", + "documentation": "Namespace creation failed." + }, + { + "value": "UPDATE_FAILED", + "name": "UPDATE_FAILED", + "documentation": "Namespace update failed." + } + ] } }, - "com.amazonaws.amp#ResourceNotFoundException": { + "com.amazonaws.amp#RuleGroupsNamespaceSummary": { "type": "structure", "members": { - "message": { - "target": "smithy.api#String", + "arn": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceArn", "traits": { - "smithy.api#documentation": "Description of the error.", + "smithy.api#documentation": "The Amazon Resource Name (ARN) of this rule groups namespace.", "smithy.api#required": {} } }, - "resourceId": { - "target": "smithy.api#String", + "name": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceName", "traits": { - "smithy.api#documentation": "Identifier of the resource affected.", + "smithy.api#documentation": "The rule groups namespace name.", "smithy.api#required": {} } }, - "resourceType": { - "target": "smithy.api#String", + "status": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceStatus", "traits": { - "smithy.api#documentation": "Type of the resource affected.", + "smithy.api#documentation": "The status of rule groups namespace.", + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "The time when the rule groups namespace was created.", + "smithy.api#required": {} + } + }, + "modifiedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "The time when the rule groups namespace was modified.", "smithy.api#required": {} } + }, + "tags": { + "target": "com.amazonaws.amp#TagMap", + "traits": { + "smithy.api#documentation": "The tags of this rule groups namespace." + } } }, "traits": { - "smithy.api#documentation": "Request references a resource which does not exist.", - "smithy.api#error": "client", - "smithy.api#httpError": 404 + "smithy.api#documentation": "Represents a summary of the rule groups namespace." + } + }, + "com.amazonaws.amp#RuleGroupsNamespaceSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.amp#RuleGroupsNamespaceSummary" + }, + "traits": { + "smithy.api#documentation": "A list of rule groups namespace summary." } }, "com.amazonaws.amp#ServiceQuotaExceededException": { @@ -979,6 +2180,14 @@ "list": { "target": "com.amazonaws.amp#ListWorkspaces" }, + "resources": [ + { + "target": "com.amazonaws.amp#AlertManagerDefinition" + }, + { + "target": "com.amazonaws.amp#RuleGroupsNamespace" + } + ], "traits": { "aws.api#arn": { "template": "workspace/{workspaceId}", diff --git a/codegen/sdk-codegen/aws-models/appintegrations.2020-07-29.json b/codegen/sdk-codegen/aws-models/appintegrations.2020-07-29.json index cf6e613ad66..3f8a033f4b7 100644 --- a/codegen/sdk-codegen/aws-models/appintegrations.2020-07-29.json +++ b/codegen/sdk-codegen/aws-models/appintegrations.2020-07-29.json @@ -46,15 +46,30 @@ "type": "service", "version": "2020-07-29", "operations": [ + { + "target": "com.amazonaws.appintegrations#CreateDataIntegration" + }, { "target": "com.amazonaws.appintegrations#CreateEventIntegration" }, + { + "target": "com.amazonaws.appintegrations#DeleteDataIntegration" + }, { "target": "com.amazonaws.appintegrations#DeleteEventIntegration" }, + { + "target": "com.amazonaws.appintegrations#GetDataIntegration" + }, { "target": "com.amazonaws.appintegrations#GetEventIntegration" }, + { + "target": "com.amazonaws.appintegrations#ListDataIntegrationAssociations" + }, + { + "target": "com.amazonaws.appintegrations#ListDataIntegrations" + }, { "target": "com.amazonaws.appintegrations#ListEventIntegrationAssociations" }, @@ -70,6 +85,9 @@ { "target": "com.amazonaws.appintegrations#UntagResource" }, + { + "target": "com.amazonaws.appintegrations#UpdateDataIntegration" + }, { "target": "com.amazonaws.appintegrations#UpdateEventIntegration" } @@ -86,7 +104,7 @@ "name": "app-integrations" }, "aws.protocols#restJson1": {}, - "smithy.api#documentation": "

The Amazon AppIntegrations service enables you to configure and reuse connections to external applications.

\n

For information about how you can use external applications with Amazon Connect, see Set up pre-built integrations in the Amazon Connect Administrator Guide.

", + "smithy.api#documentation": "

The Amazon AppIntegrations service enables you to configure and reuse connections to external\n applications.

\n

For information about how you can use external applications with Amazon Connect, see Set up pre-built\n integrations and Deliver information to agents using Amazon Connect Wisdom\n in the Amazon Connect Administrator Guide.

", "smithy.api#title": "Amazon AppIntegrations Service" } }, @@ -119,6 +137,151 @@ "smithy.api#pattern": ".*" } }, + "com.amazonaws.appintegrations#CreateDataIntegration": { + "type": "operation", + "input": { + "target": "com.amazonaws.appintegrations#CreateDataIntegrationRequest" + }, + "output": { + "target": "com.amazonaws.appintegrations#CreateDataIntegrationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.appintegrations#AccessDeniedException" + }, + { + "target": "com.amazonaws.appintegrations#DuplicateResourceException" + }, + { + "target": "com.amazonaws.appintegrations#InternalServiceError" + }, + { + "target": "com.amazonaws.appintegrations#InvalidRequestException" + }, + { + "target": "com.amazonaws.appintegrations#ResourceQuotaExceededException" + }, + { + "target": "com.amazonaws.appintegrations#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates and persists a DataIntegration resource.

\n \n

You cannot create a DataIntegration association for a DataIntegration that has been previously associated. \n Use a different DataIntegration, or recreate the DataIntegration using the \n CreateDataIntegration API.

\n
", + "smithy.api#http": { + "method": "POST", + "uri": "/dataIntegrations", + "code": 200 + } + } + }, + "com.amazonaws.appintegrations#CreateDataIntegrationRequest": { + "type": "structure", + "members": { + "Name": { + "target": "com.amazonaws.appintegrations#Name", + "traits": { + "smithy.api#documentation": "

The name of the DataIntegration.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "com.amazonaws.appintegrations#Description", + "traits": { + "smithy.api#documentation": "

A description of the DataIntegration.

" + } + }, + "KmsKey": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The KMS key for the DataIntegration.

" + } + }, + "SourceURI": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The URI of the data source.

" + } + }, + "ScheduleConfig": { + "target": "com.amazonaws.appintegrations#ScheduleConfiguration", + "traits": { + "smithy.api#documentation": "

The name of the data and how often it should be pulled from the source.

" + } + }, + "Tags": { + "target": "com.amazonaws.appintegrations#TagMap", + "traits": { + "smithy.api#documentation": "

One or more tags.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.appintegrations#IdempotencyToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request.

", + "smithy.api#idempotencyToken": {} + } + } + } + }, + "com.amazonaws.appintegrations#CreateDataIntegrationResponse": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.appintegrations#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN)

" + } + }, + "Id": { + "target": "com.amazonaws.appintegrations#UUID", + "traits": { + "smithy.api#documentation": "

A unique identifier.

" + } + }, + "Name": { + "target": "com.amazonaws.appintegrations#Name", + "traits": { + "smithy.api#documentation": "

The name of the DataIntegration.

" + } + }, + "Description": { + "target": "com.amazonaws.appintegrations#Description", + "traits": { + "smithy.api#documentation": "

A description of the DataIntegration.

" + } + }, + "KmsKey": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The KMS key for the DataIntegration.

" + } + }, + "SourceURI": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The URI of the data source.

" + } + }, + "ScheduleConfiguration": { + "target": "com.amazonaws.appintegrations#ScheduleConfiguration", + "traits": { + "smithy.api#documentation": "

The name of the data and how often it should be pulled from the source.

" + } + }, + "Tags": { + "target": "com.amazonaws.appintegrations#TagMap", + "traits": { + "smithy.api#documentation": "

One or more tags.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.appintegrations#IdempotencyToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request.

" + } + } + } + }, "com.amazonaws.appintegrations#CreateEventIntegration": { "type": "operation", "input": { @@ -148,7 +311,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates an EventIntegration, given a specified name, description, and a reference to an\n Amazon EventBridge bus in your account and a partner event source that pushes events to that bus. No\n objects are created in the your account, only metadata that is persisted on the EventIntegration\n control plane.

", + "smithy.api#documentation": "

Creates an EventIntegration, given a specified name, description, and a reference to an\n Amazon EventBridge bus in your account and a partner event source that pushes events to that bus. No\n objects are created in the your account, only metadata that is persisted on the\n EventIntegration control plane.

", "smithy.api#http": { "method": "POST", "uri": "/eventIntegrations", @@ -212,6 +375,133 @@ } } }, + "com.amazonaws.appintegrations#DataIntegrationAssociationSummary": { + "type": "structure", + "members": { + "DataIntegrationAssociationArn": { + "target": "com.amazonaws.appintegrations#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the DataIntegration association.

" + } + }, + "DataIntegrationArn": { + "target": "com.amazonaws.appintegrations#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN)of the DataIntegration.

" + } + }, + "ClientId": { + "target": "com.amazonaws.appintegrations#ClientId", + "traits": { + "smithy.api#documentation": "

The identifier for teh client that is associated with the DataIntegration\n association.

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

Summary information about the DataIntegration association.

" + } + }, + "com.amazonaws.appintegrations#DataIntegrationAssociationsList": { + "type": "list", + "member": { + "target": "com.amazonaws.appintegrations#DataIntegrationAssociationSummary" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.appintegrations#DataIntegrationSummary": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.appintegrations#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the DataIntegration.

" + } + }, + "Name": { + "target": "com.amazonaws.appintegrations#Name", + "traits": { + "smithy.api#documentation": "

The name of the DataIntegration.

" + } + }, + "SourceURI": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The URI of the data source.

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

Summary information about the DataIntegration.

" + } + }, + "com.amazonaws.appintegrations#DataIntegrationsList": { + "type": "list", + "member": { + "target": "com.amazonaws.appintegrations#DataIntegrationSummary" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.appintegrations#DeleteDataIntegration": { + "type": "operation", + "input": { + "target": "com.amazonaws.appintegrations#DeleteDataIntegrationRequest" + }, + "output": { + "target": "com.amazonaws.appintegrations#DeleteDataIntegrationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.appintegrations#AccessDeniedException" + }, + { + "target": "com.amazonaws.appintegrations#InternalServiceError" + }, + { + "target": "com.amazonaws.appintegrations#InvalidRequestException" + }, + { + "target": "com.amazonaws.appintegrations#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.appintegrations#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the DataIntegration. Only DataIntegrations that don't have any\n DataIntegrationAssociations can be deleted. Deleting a DataIntegration also deletes the\n underlying Amazon AppFlow flow and service linked role.

\n \n

You cannot create a DataIntegration association for a DataIntegration that has been previously associated. \nUse a different DataIntegration, or recreate the DataIntegration using the \nCreateDataIntegration API.

\n
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/dataIntegrations/{DataIntegrationIdentifier}", + "code": 200 + } + } + }, + "com.amazonaws.appintegrations#DeleteDataIntegrationRequest": { + "type": "structure", + "members": { + "DataIntegrationIdentifier": { + "target": "com.amazonaws.appintegrations#Identifier", + "traits": { + "smithy.api#documentation": "

A unique identifier for the DataIntegration.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.appintegrations#DeleteDataIntegrationResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.appintegrations#DeleteEventIntegration": { "type": "operation", "input": { @@ -433,6 +723,106 @@ } } }, + "com.amazonaws.appintegrations#GetDataIntegration": { + "type": "operation", + "input": { + "target": "com.amazonaws.appintegrations#GetDataIntegrationRequest" + }, + "output": { + "target": "com.amazonaws.appintegrations#GetDataIntegrationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.appintegrations#AccessDeniedException" + }, + { + "target": "com.amazonaws.appintegrations#InternalServiceError" + }, + { + "target": "com.amazonaws.appintegrations#InvalidRequestException" + }, + { + "target": "com.amazonaws.appintegrations#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.appintegrations#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about the DataIntegration.

\n \n

You cannot create a DataIntegration association for a DataIntegration that has been previously associated. \nUse a different DataIntegration, or recreate the DataIntegration using the \nCreateDataIntegration API.

\n
", + "smithy.api#http": { + "method": "GET", + "uri": "/dataIntegrations/{Identifier}", + "code": 200 + } + } + }, + "com.amazonaws.appintegrations#GetDataIntegrationRequest": { + "type": "structure", + "members": { + "Identifier": { + "target": "com.amazonaws.appintegrations#Identifier", + "traits": { + "smithy.api#documentation": "

A unique identifier.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.appintegrations#GetDataIntegrationResponse": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.appintegrations#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) for the DataIntegration.

" + } + }, + "Id": { + "target": "com.amazonaws.appintegrations#UUID", + "traits": { + "smithy.api#documentation": "

A unique identifier.

" + } + }, + "Name": { + "target": "com.amazonaws.appintegrations#Name", + "traits": { + "smithy.api#documentation": "

The name of the DataIntegration.

" + } + }, + "Description": { + "target": "com.amazonaws.appintegrations#Description", + "traits": { + "smithy.api#documentation": "

The KMS key for the DataIntegration.

" + } + }, + "KmsKey": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The KMS key for the DataIntegration.

" + } + }, + "SourceURI": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The URI of the data source.

" + } + }, + "ScheduleConfiguration": { + "target": "com.amazonaws.appintegrations#ScheduleConfiguration", + "traits": { + "smithy.api#documentation": "

The name of the data and how often it should be pulled from the source.

" + } + }, + "Tags": { + "target": "com.amazonaws.appintegrations#TagMap", + "traits": { + "smithy.api#documentation": "

One or more tags.

" + } + } + } + }, "com.amazonaws.appintegrations#GetEventIntegration": { "type": "operation", "input": { @@ -459,7 +849,7 @@ } ], "traits": { - "smithy.api#documentation": "

Return information about the event integration.

", + "smithy.api#documentation": "

Returns information about the event integration.

", "smithy.api#http": { "method": "GET", "uri": "/eventIntegrations/{Name}", @@ -531,6 +921,16 @@ "smithy.api#pattern": ".*" } }, + "com.amazonaws.appintegrations#Identifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "\\S" + } + }, "com.amazonaws.appintegrations#InternalServiceError": { "type": "structure", "members": { @@ -552,11 +952,156 @@ } }, "traits": { - "smithy.api#documentation": "

The request is not valid.

", + "smithy.api#documentation": "

The request is not valid.

", "smithy.api#error": "client", "smithy.api#httpError": 400 } }, + "com.amazonaws.appintegrations#ListDataIntegrationAssociations": { + "type": "operation", + "input": { + "target": "com.amazonaws.appintegrations#ListDataIntegrationAssociationsRequest" + }, + "output": { + "target": "com.amazonaws.appintegrations#ListDataIntegrationAssociationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.appintegrations#AccessDeniedException" + }, + { + "target": "com.amazonaws.appintegrations#InternalServiceError" + }, + { + "target": "com.amazonaws.appintegrations#InvalidRequestException" + }, + { + "target": "com.amazonaws.appintegrations#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.appintegrations#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a paginated list of DataIntegration associations in the account.

\n \n

You cannot create a DataIntegration association for a DataIntegration that has been previously associated. \nUse a different DataIntegration, or recreate the DataIntegration using the \nCreateDataIntegration API.

\n
", + "smithy.api#http": { + "method": "GET", + "uri": "/dataIntegrations/{DataIntegrationIdentifier}/associations", + "code": 200 + } + } + }, + "com.amazonaws.appintegrations#ListDataIntegrationAssociationsRequest": { + "type": "structure", + "members": { + "DataIntegrationIdentifier": { + "target": "com.amazonaws.appintegrations#Identifier", + "traits": { + "smithy.api#documentation": "

A unique identifier for the DataIntegration.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.appintegrations#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "MaxResults": { + "target": "com.amazonaws.appintegrations#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + } + } + }, + "com.amazonaws.appintegrations#ListDataIntegrationAssociationsResponse": { + "type": "structure", + "members": { + "DataIntegrationAssociations": { + "target": "com.amazonaws.appintegrations#DataIntegrationAssociationsList", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) and unique ID of the DataIntegration association.

" + } + }, + "NextToken": { + "target": "com.amazonaws.appintegrations#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.appintegrations#ListDataIntegrations": { + "type": "operation", + "input": { + "target": "com.amazonaws.appintegrations#ListDataIntegrationsRequest" + }, + "output": { + "target": "com.amazonaws.appintegrations#ListDataIntegrationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.appintegrations#AccessDeniedException" + }, + { + "target": "com.amazonaws.appintegrations#InternalServiceError" + }, + { + "target": "com.amazonaws.appintegrations#InvalidRequestException" + }, + { + "target": "com.amazonaws.appintegrations#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a paginated list of DataIntegrations in the account.

\n \n

You cannot create a DataIntegration association for a DataIntegration that has been previously associated. \nUse a different DataIntegration, or recreate the DataIntegration using the \nCreateDataIntegration API.

\n
", + "smithy.api#http": { + "method": "GET", + "uri": "/dataIntegrations", + "code": 200 + } + } + }, + "com.amazonaws.appintegrations#ListDataIntegrationsRequest": { + "type": "structure", + "members": { + "NextToken": { + "target": "com.amazonaws.appintegrations#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "MaxResults": { + "target": "com.amazonaws.appintegrations#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + } + } + }, + "com.amazonaws.appintegrations#ListDataIntegrationsResponse": { + "type": "structure", + "members": { + "DataIntegrations": { + "target": "com.amazonaws.appintegrations#DataIntegrationsList", + "traits": { + "smithy.api#documentation": "

The DataIntegrations associated with this account.

" + } + }, + "NextToken": { + "target": "com.amazonaws.appintegrations#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, "com.amazonaws.appintegrations#ListEventIntegrationAssociations": { "type": "operation", "input": { @@ -800,6 +1345,16 @@ "smithy.api#pattern": "\\S" } }, + "com.amazonaws.appintegrations#Object": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\/\\._\\-]+$" + } + }, "com.amazonaws.appintegrations#ResourceNotFoundException": { "type": "structure", "members": { @@ -826,6 +1381,42 @@ "smithy.api#httpError": 429 } }, + "com.amazonaws.appintegrations#Schedule": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\/\\._\\-]+$" + } + }, + "com.amazonaws.appintegrations#ScheduleConfiguration": { + "type": "structure", + "members": { + "FirstExecutionFrom": { + "target": "com.amazonaws.appintegrations#NonBlankString", + "traits": { + "smithy.api#documentation": "

The start date for objects to import in the first flow run.

" + } + }, + "Object": { + "target": "com.amazonaws.appintegrations#Object", + "traits": { + "smithy.api#documentation": "

The name of the object to pull from the data source.

" + } + }, + "ScheduleExpression": { + "target": "com.amazonaws.appintegrations#Schedule", + "traits": { + "smithy.api#documentation": "

How often the data should be pulled from data source.

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

The name of the data and how often it should be pulled from the source.

" + } + }, "com.amazonaws.appintegrations#Source": { "type": "string", "traits": { @@ -1012,6 +1603,69 @@ "type": "structure", "members": {} }, + "com.amazonaws.appintegrations#UpdateDataIntegration": { + "type": "operation", + "input": { + "target": "com.amazonaws.appintegrations#UpdateDataIntegrationRequest" + }, + "output": { + "target": "com.amazonaws.appintegrations#UpdateDataIntegrationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.appintegrations#AccessDeniedException" + }, + { + "target": "com.amazonaws.appintegrations#InternalServiceError" + }, + { + "target": "com.amazonaws.appintegrations#InvalidRequestException" + }, + { + "target": "com.amazonaws.appintegrations#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.appintegrations#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates the description of a DataIntegration.

\n \n

You cannot create a DataIntegration association for a DataIntegration that has been previously associated. \nUse a different DataIntegration, or recreate the DataIntegration using the \nCreateDataIntegration API.

\n
", + "smithy.api#http": { + "method": "PATCH", + "uri": "/dataIntegrations/{Identifier}", + "code": 200 + } + } + }, + "com.amazonaws.appintegrations#UpdateDataIntegrationRequest": { + "type": "structure", + "members": { + "Identifier": { + "target": "com.amazonaws.appintegrations#Identifier", + "traits": { + "smithy.api#documentation": "

A unique identifier for the DataIntegration.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "Name": { + "target": "com.amazonaws.appintegrations#Name", + "traits": { + "smithy.api#documentation": "

The name of the DataIntegration.

" + } + }, + "Description": { + "target": "com.amazonaws.appintegrations#Description", + "traits": { + "smithy.api#documentation": "

A description of the DataIntegration.

" + } + } + } + }, + "com.amazonaws.appintegrations#UpdateDataIntegrationResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.appintegrations#UpdateEventIntegration": { "type": "operation", "input": { diff --git a/codegen/sdk-codegen/aws-models/cloudcontrol.2021-09-30.json b/codegen/sdk-codegen/aws-models/cloudcontrol.2021-09-30.json new file mode 100644 index 00000000000..15dd2885775 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/cloudcontrol.2021-09-30.json @@ -0,0 +1,1606 @@ +{ + "smithy": "1.0", + "metadata": { + "suppressions": [ + { + "id": "HttpMethodSemantics", + "namespace": "*" + }, + { + "id": "HttpResponseCodeSemantics", + "namespace": "*" + }, + { + "id": "PaginatedTrait", + "namespace": "*" + }, + { + "id": "HttpHeaderTrait", + "namespace": "*" + }, + { + "id": "HttpUriConflict", + "namespace": "*" + }, + { + "id": "Service", + "namespace": "*" + } + ] + }, + "shapes": { + "com.amazonaws.cloudcontrol#AlreadyExistsException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "AlreadyExistsException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The resource with the name requested already exists.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudcontrol#CancelResourceRequest": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#CancelResourceRequestInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#CancelResourceRequestOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudcontrol#ConcurrentModificationException" + }, + { + "target": "com.amazonaws.cloudcontrol#RequestTokenNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Cancels the specified resource operation request. For more information, see Canceling resource operation requests in the\n Amazon Web Services Cloud Control API User Guide.

\n

Only resource operations requests with a status of PENDING or\n IN_PROGRESS can be cancelled.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.cloudcontrol#CancelResourceRequestInput": { + "type": "structure", + "members": { + "RequestToken": { + "target": "com.amazonaws.cloudcontrol#RequestToken", + "traits": { + "smithy.api#documentation": "

The RequestToken of the ProgressEvent object returned by the\n resource operation request.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.cloudcontrol#CancelResourceRequestOutput": { + "type": "structure", + "members": { + "ProgressEvent": { + "target": "com.amazonaws.cloudcontrol#ProgressEvent" + } + } + }, + "com.amazonaws.cloudcontrol#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[-A-Za-z0-9+/=]+$" + } + }, + "com.amazonaws.cloudcontrol#ClientTokenConflictException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ClientTokenConflictException", + "httpResponseCode": 409 + }, + "smithy.api#documentation": "

The specified client token has already been used in another resource request.

\n

It is best practice for client tokens to be unique for each resource operation request.\n However, client token expire after 36 hours.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.cloudcontrol#CloudApiService": { + "type": "service", + "version": "2021-09-30", + "operations": [ + { + "target": "com.amazonaws.cloudcontrol#CancelResourceRequest" + }, + { + "target": "com.amazonaws.cloudcontrol#CreateResource" + }, + { + "target": "com.amazonaws.cloudcontrol#DeleteResource" + }, + { + "target": "com.amazonaws.cloudcontrol#GetResource" + }, + { + "target": "com.amazonaws.cloudcontrol#GetResourceRequestStatus" + }, + { + "target": "com.amazonaws.cloudcontrol#ListResourceRequests" + }, + { + "target": "com.amazonaws.cloudcontrol#ListResources" + }, + { + "target": "com.amazonaws.cloudcontrol#UpdateResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "CloudControl", + "arnNamespace": "cloudcontrolapi", + "cloudFormationName": "CloudControl", + "cloudTrailEventSource": "cloudcontrol.amazonaws.com", + "endpointPrefix": "cloudcontrolapi" + }, + "aws.auth#sigv4": { + "name": "cloudcontrolapi" + }, + "aws.protocols#awsJson1_0": {}, + "smithy.api#documentation": "

Use Amazon Web Services Cloud Control API to create, read, update, delete, and list (CRUD-L) your cloud resources that\n belong to a wide range of services--both Amazon Web Services and third-party. With the Cloud Control API\n standardized set of application programming interfaces (APIs), you can perform CRUD-L operations\n on any supported resources in your Amazon Web Services account. Using Cloud Control API, you won't have to generate code\n or scripts specific to each individual service responsible for those resources.

\n

For more information about Amazon Web Services Cloud Control API, see the Amazon Web Services Cloud Control API User\n Guide.

", + "smithy.api#title": "AWS Cloud Control API" + } + }, + "com.amazonaws.cloudcontrol#ConcurrentModificationException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ConcurrentModificationException", + "httpResponseCode": 500 + }, + "smithy.api#documentation": "

The resource is currently being modified by another operation.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.cloudcontrol#ConcurrentOperationException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ConcurrentOperationException", + "httpResponseCode": 409 + }, + "smithy.api#documentation": "

Another resource operation is currently being performed on this resource.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.cloudcontrol#CreateResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#CreateResourceInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#CreateResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudcontrol#AlreadyExistsException" + }, + { + "target": "com.amazonaws.cloudcontrol#ClientTokenConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ConcurrentOperationException" + }, + { + "target": "com.amazonaws.cloudcontrol#GeneralServiceException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerInternalFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidCredentialsException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidRequestException" + }, + { + "target": "com.amazonaws.cloudcontrol#NetworkFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotStabilizedException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotUpdatableException" + }, + { + "target": "com.amazonaws.cloudcontrol#PrivateTypeException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceInternalErrorException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceLimitExceededException" + }, + { + "target": "com.amazonaws.cloudcontrol#ThrottlingException" + }, + { + "target": "com.amazonaws.cloudcontrol#TypeNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#UnsupportedActionException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates the specified resource. For more information, see Creating a\n resource in the Amazon Web Services Cloud Control API User Guide.

\n

After you have initiated a resource creation request, you can monitor the progress of your\n request by calling GetResourceRequestStatus using the RequestToken of the\n ProgressEvent type returned by CreateResource.

" + } + }, + "com.amazonaws.cloudcontrol#CreateResourceInput": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type.

", + "smithy.api#required": {} + } + }, + "TypeVersionId": { + "target": "com.amazonaws.cloudcontrol#TypeVersionId", + "traits": { + "smithy.api#documentation": "

For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.

" + } + }, + "RoleArn": { + "target": "com.amazonaws.cloudcontrol#RoleArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the \n handlers\n section of the resource type definition schema.

\n

If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.

\n

For more information, see Specifying credentials in the Amazon Web Services Cloud Control API User Guide.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.cloudcontrol#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.

\n

A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.

\n

If you do not specify a client token, one is generated for inclusion in the request.

\n

For more information, see Ensuring resource operation requests are unique in the Amazon Web Services Cloud Control API User Guide.

", + "smithy.api#idempotencyToken": {} + } + }, + "DesiredState": { + "target": "com.amazonaws.cloudcontrol#Properties", + "traits": { + "smithy.api#documentation": "

Structured data format representing the desired state of the resource, consisting of that\n resource's properties and their desired values.

\n \n

Cloud Control API currently supports JSON as a structured data format.

\n
\n \n

Specify the desired state as one of the following:

\n \n

For more information, see Composing the desired state of the resource in the Amazon Web Services Cloud Control API User\n Guide.

\n

For more information about the properties of a specific resource, refer to the related\n topic for the resource in the Resource and property types reference in the Amazon Web Services\n CloudFormation Users Guide.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.cloudcontrol#CreateResourceOutput": { + "type": "structure", + "members": { + "ProgressEvent": { + "target": "com.amazonaws.cloudcontrol#ProgressEvent", + "traits": { + "smithy.api#documentation": "

Represents the current status of the resource creation request.

\n

After you have initiated a resource creation request, you can monitor the progress of your\n request by calling GetResourceRequestStatus using the RequestToken of the\n ProgressEvent returned by CreateResource.

" + } + } + } + }, + "com.amazonaws.cloudcontrol#DeleteResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#DeleteResourceInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#DeleteResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudcontrol#AlreadyExistsException" + }, + { + "target": "com.amazonaws.cloudcontrol#ClientTokenConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ConcurrentOperationException" + }, + { + "target": "com.amazonaws.cloudcontrol#GeneralServiceException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerInternalFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidCredentialsException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidRequestException" + }, + { + "target": "com.amazonaws.cloudcontrol#NetworkFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotStabilizedException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotUpdatableException" + }, + { + "target": "com.amazonaws.cloudcontrol#PrivateTypeException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceInternalErrorException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceLimitExceededException" + }, + { + "target": "com.amazonaws.cloudcontrol#ThrottlingException" + }, + { + "target": "com.amazonaws.cloudcontrol#TypeNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#UnsupportedActionException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the specified resource. For details, see Deleting a\n resource in the Amazon Web Services Cloud Control API User Guide.

\n

After you have initiated a resource deletion request, you can monitor the progress of your\n request by calling GetResourceRequestStatus using the RequestToken of the\n ProgressEvent returned by DeleteResource.

" + } + }, + "com.amazonaws.cloudcontrol#DeleteResourceInput": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type.

", + "smithy.api#required": {} + } + }, + "TypeVersionId": { + "target": "com.amazonaws.cloudcontrol#TypeVersionId", + "traits": { + "smithy.api#documentation": "

For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.

" + } + }, + "RoleArn": { + "target": "com.amazonaws.cloudcontrol#RoleArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the \n handlers\n section of the resource type definition schema.

\n

If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.

\n

For more information, see Specifying credentials in the Amazon Web Services Cloud Control API User Guide.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.cloudcontrol#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.

\n

A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.

\n

If you do not specify a client token, one is generated for inclusion in the request.

\n

For more information, see Ensuring resource operation requests are unique in the Amazon Web Services Cloud Control API User Guide.

", + "smithy.api#idempotencyToken": {} + } + }, + "Identifier": { + "target": "com.amazonaws.cloudcontrol#Identifier", + "traits": { + "smithy.api#documentation": "

The identifier for the resource.

\n

You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.

\n

For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values in the order they are specified in the primary identifier definition, separated by |.

\n

For more information, see Identifying resources in the Amazon Web Services Cloud Control API User Guide.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.cloudcontrol#DeleteResourceOutput": { + "type": "structure", + "members": { + "ProgressEvent": { + "target": "com.amazonaws.cloudcontrol#ProgressEvent", + "traits": { + "smithy.api#documentation": "

Represents the current status of the resource deletion request.

\n

After you have initiated a resource deletion request, you can monitor the progress of your\n request by calling GetResourceRequestStatus using the RequestToken of the\n ProgressEvent returned by DeleteResource.

" + } + } + } + }, + "com.amazonaws.cloudcontrol#ErrorMessage": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.cloudcontrol#GeneralServiceException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "GeneralServiceException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The resource handler has returned that the downstream service generated an error that does\n not map to any other handler error code.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudcontrol#GetResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#GetResourceInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#GetResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudcontrol#AlreadyExistsException" + }, + { + "target": "com.amazonaws.cloudcontrol#GeneralServiceException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerInternalFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidCredentialsException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidRequestException" + }, + { + "target": "com.amazonaws.cloudcontrol#NetworkFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotStabilizedException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotUpdatableException" + }, + { + "target": "com.amazonaws.cloudcontrol#PrivateTypeException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceInternalErrorException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceLimitExceededException" + }, + { + "target": "com.amazonaws.cloudcontrol#ThrottlingException" + }, + { + "target": "com.amazonaws.cloudcontrol#TypeNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#UnsupportedActionException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about the current state of the specified resource. For details, see\n Reading a resource's current state.

\n

You can use this action to return information about an existing resource in your account\n and Amazon Web Services Region, whether or not those resources were provisioned using Cloud Control API.

" + } + }, + "com.amazonaws.cloudcontrol#GetResourceInput": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type.

", + "smithy.api#required": {} + } + }, + "TypeVersionId": { + "target": "com.amazonaws.cloudcontrol#TypeVersionId", + "traits": { + "smithy.api#documentation": "

For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.

" + } + }, + "RoleArn": { + "target": "com.amazonaws.cloudcontrol#RoleArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the \n handlers\n section of the resource type definition schema.

\n

If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.

\n

For more information, see Specifying credentials in the Amazon Web Services Cloud Control API User Guide.

" + } + }, + "Identifier": { + "target": "com.amazonaws.cloudcontrol#Identifier", + "traits": { + "smithy.api#documentation": "

The identifier for the resource.

\n

You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.

\n

For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values in the order they are specified in the primary identifier definition, separated by |.

\n

For more information, see Identifying resources in the Amazon Web Services Cloud Control API User Guide.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.cloudcontrol#GetResourceOutput": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type.

" + } + }, + "ResourceDescription": { + "target": "com.amazonaws.cloudcontrol#ResourceDescription" + } + } + }, + "com.amazonaws.cloudcontrol#GetResourceRequestStatus": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#GetResourceRequestStatusInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#GetResourceRequestStatusOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudcontrol#RequestTokenNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns the current status of a resource operation request. For more information, see\n Tracking the progress of resource operation requests in the\n Amazon Web Services Cloud Control API User Guide.

", + "smithy.waiters#waitable": { + "ResourceRequestSuccess": { + "documentation": "Wait until resource operation request is successful", + "acceptors": [ + { + "state": "success", + "matcher": { + "output": { + "path": "ProgressEvent.OperationStatus", + "expected": "SUCCESS", + "comparator": "stringEquals" + } + } + }, + { + "state": "failure", + "matcher": { + "output": { + "path": "ProgressEvent.OperationStatus", + "expected": "FAILED", + "comparator": "stringEquals" + } + } + }, + { + "state": "failure", + "matcher": { + "output": { + "path": "ProgressEvent.OperationStatus", + "expected": "CANCEL_COMPLETE", + "comparator": "stringEquals" + } + } + } + ], + "minDelay": 5 + } + } + } + }, + "com.amazonaws.cloudcontrol#GetResourceRequestStatusInput": { + "type": "structure", + "members": { + "RequestToken": { + "target": "com.amazonaws.cloudcontrol#RequestToken", + "traits": { + "smithy.api#documentation": "

A unique token used to track the progress of the resource operation request.

\n

Request tokens are included in the ProgressEvent type returned by a resource\n operation request.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.cloudcontrol#GetResourceRequestStatusOutput": { + "type": "structure", + "members": { + "ProgressEvent": { + "target": "com.amazonaws.cloudcontrol#ProgressEvent", + "traits": { + "smithy.api#documentation": "

Represents the current status of the resource operation request.

" + } + } + } + }, + "com.amazonaws.cloudcontrol#HandlerErrorCode": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "NotUpdatable", + "name": "NOT_UPDATABLE" + }, + { + "value": "InvalidRequest", + "name": "INVALID_REQUEST" + }, + { + "value": "AccessDenied", + "name": "ACCESS_DENIED" + }, + { + "value": "InvalidCredentials", + "name": "INVALID_CREDENTIALS" + }, + { + "value": "AlreadyExists", + "name": "ALREADY_EXISTS" + }, + { + "value": "NotFound", + "name": "NOT_FOUND" + }, + { + "value": "ResourceConflict", + "name": "RESOURCE_CONFLICT" + }, + { + "value": "Throttling", + "name": "THROTTLING" + }, + { + "value": "ServiceLimitExceeded", + "name": "SERVICE_LIMIT_EXCEEDED" + }, + { + "value": "NotStabilized", + "name": "NOT_STABILIZED" + }, + { + "value": "GeneralServiceException", + "name": "GENERAL_SERVICE_EXCEPTION" + }, + { + "value": "ServiceInternalError", + "name": "SERVICE_INTERNAL_ERROR" + }, + { + "value": "ServiceTimeout", + "name": "SERVICE_TIMEOUT" + }, + { + "value": "NetworkFailure", + "name": "NETWORK_FAILURE" + }, + { + "value": "InternalFailure", + "name": "INTERNAL_FAILURE" + } + ] + } + }, + "com.amazonaws.cloudcontrol#HandlerFailureException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "HandlerFailureException", + "httpResponseCode": 502 + }, + "smithy.api#documentation": "

The resource handler has failed without a returning a more specific error code. This can\n include timeouts.

", + "smithy.api#error": "server", + "smithy.api#httpError": 502 + } + }, + "com.amazonaws.cloudcontrol#HandlerInternalFailureException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "HandlerInternalFailureException", + "httpResponseCode": 502 + }, + "smithy.api#documentation": "

The resource handler has returned that an unexpected error occurred within the resource\n handler.

", + "smithy.api#error": "server", + "smithy.api#httpError": 502 + } + }, + "com.amazonaws.cloudcontrol#HandlerNextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^.+$" + } + }, + "com.amazonaws.cloudcontrol#Identifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^.+$" + } + }, + "com.amazonaws.cloudcontrol#InvalidCredentialsException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "InvalidCredentialsException", + "httpResponseCode": 401 + }, + "smithy.api#documentation": "

The resource handler has returned that the credentials provided by the user are\n invalid.

", + "smithy.api#error": "client", + "smithy.api#httpError": 401 + } + }, + "com.amazonaws.cloudcontrol#InvalidRequestException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "InvalidRequestException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The resource handler has returned that invalid input from the user has generated a generic\n exception.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudcontrol#ListResourceRequests": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#ListResourceRequestsInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#ListResourceRequestsOutput" + }, + "traits": { + "smithy.api#documentation": "

Returns existing resource operation requests. This includes requests of all status types.\n For more information, see Listing active resource operation requests in the\n Amazon Web Services Cloud Control API User Guide.

\n \n

Resource operation requests expire after seven days.

\n
", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.cloudcontrol#ListResourceRequestsInput": { + "type": "structure", + "members": { + "MaxResults": { + "target": "com.amazonaws.cloudcontrol#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned with a single call. If the number of\n available results exceeds this maximum, the response includes a NextToken value\n that you can assign to the NextToken request parameter to get the next set of\n results.

\n

The default is 20.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudcontrol#NextToken", + "traits": { + "smithy.api#documentation": "

If the previous paginated request didn't return all of the remaining results, the response object's NextToken parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object's NextToken parameter. If there are no remaining results, the previous response object's NextToken parameter is set to null.

" + } + }, + "ResourceRequestStatusFilter": { + "target": "com.amazonaws.cloudcontrol#ResourceRequestStatusFilter", + "traits": { + "smithy.api#documentation": "

The filter criteria to apply to the requests returned.

" + } + } + } + }, + "com.amazonaws.cloudcontrol#ListResourceRequestsOutput": { + "type": "structure", + "members": { + "ResourceRequestStatusSummaries": { + "target": "com.amazonaws.cloudcontrol#ResourceRequestStatusSummaries", + "traits": { + "smithy.api#documentation": "

The requests that match the specified filter criteria.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudcontrol#NextToken", + "traits": { + "smithy.api#documentation": "

If the request doesn't return all of the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResources again and assign that token to the request object's NextToken parameter. If the request returns all results, NextToken is set to null.

" + } + } + } + }, + "com.amazonaws.cloudcontrol#ListResources": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#ListResourcesInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#ListResourcesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudcontrol#AlreadyExistsException" + }, + { + "target": "com.amazonaws.cloudcontrol#GeneralServiceException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerInternalFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidCredentialsException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidRequestException" + }, + { + "target": "com.amazonaws.cloudcontrol#NetworkFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotStabilizedException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotUpdatableException" + }, + { + "target": "com.amazonaws.cloudcontrol#PrivateTypeException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceInternalErrorException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceLimitExceededException" + }, + { + "target": "com.amazonaws.cloudcontrol#ThrottlingException" + }, + { + "target": "com.amazonaws.cloudcontrol#TypeNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#UnsupportedActionException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about the specified resources. For more information, see Discovering\n resources in the Amazon Web Services Cloud Control API User Guide.

\n

You can use this action to return information about existing resources in your account and\n Amazon Web Services Region, whether or not those resources were provisioned using Cloud Control API.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.cloudcontrol#ListResourcesInput": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type.

", + "smithy.api#required": {} + } + }, + "TypeVersionId": { + "target": "com.amazonaws.cloudcontrol#TypeVersionId", + "traits": { + "smithy.api#documentation": "

For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.

" + } + }, + "RoleArn": { + "target": "com.amazonaws.cloudcontrol#RoleArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the \n handlers\n section of the resource type definition schema.

\n

If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.

\n

For more information, see Specifying credentials in the Amazon Web Services Cloud Control API User Guide.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudcontrol#HandlerNextToken", + "traits": { + "smithy.api#documentation": "

If the previous paginated request didn't return all of the remaining results, the response object's NextToken parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object's NextToken parameter. If there are no remaining results, the previous response object's NextToken parameter is set to null.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.cloudcontrol#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned with a single call. If the number of\n available results exceeds this maximum, the response includes a NextToken value\n that you can assign to the NextToken request parameter to get the next set of\n results.

\n

The default is 20.

" + } + }, + "ResourceModel": { + "target": "com.amazonaws.cloudcontrol#Properties", + "traits": { + "smithy.api#documentation": "

The resource model to use to select the resources to return.

" + } + } + } + }, + "com.amazonaws.cloudcontrol#ListResourcesOutput": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type.

" + } + }, + "ResourceDescriptions": { + "target": "com.amazonaws.cloudcontrol#ResourceDescriptions", + "traits": { + "smithy.api#documentation": "

Information about the specified resources, including primary identifier and resource\n model.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudcontrol#HandlerNextToken", + "traits": { + "smithy.api#documentation": "

If the request doesn't return all of the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResources again and assign that token to the request object's NextToken parameter. If the request returns all results, NextToken is set to null.

" + } + } + } + }, + "com.amazonaws.cloudcontrol#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.cloudcontrol#NetworkFailureException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "NetworkFailureException", + "httpResponseCode": 502 + }, + "smithy.api#documentation": "

The resource handler has returned that the request could not be completed due to\n networking issues, such as a failure to receive a response from the server.

", + "smithy.api#error": "server", + "smithy.api#httpError": 502 + } + }, + "com.amazonaws.cloudcontrol#NextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^[-A-Za-z0-9+/=]+$" + } + }, + "com.amazonaws.cloudcontrol#NotStabilizedException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "NotStabilizedException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The resource handler has returned that the downstream resource failed to complete all of\n its ready-state checks.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudcontrol#NotUpdatableException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "NotUpdatableException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

One or more properties included in this resource operation are defined as create-only, and\n therefore cannot be updated.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudcontrol#Operation": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATE", + "name": "CREATE" + }, + { + "value": "DELETE", + "name": "DELETE" + }, + { + "value": "UPDATE", + "name": "UPDATE" + } + ] + } + }, + "com.amazonaws.cloudcontrol#OperationStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "PENDING", + "name": "PENDING" + }, + { + "value": "IN_PROGRESS", + "name": "IN_PROGRESS" + }, + { + "value": "SUCCESS", + "name": "SUCCESS" + }, + { + "value": "FAILED", + "name": "FAILED" + }, + { + "value": "CANCEL_IN_PROGRESS", + "name": "CANCEL_IN_PROGRESS" + }, + { + "value": "CANCEL_COMPLETE", + "name": "CANCEL_COMPLETE" + } + ] + } + }, + "com.amazonaws.cloudcontrol#OperationStatuses": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudcontrol#OperationStatus" + } + }, + "com.amazonaws.cloudcontrol#Operations": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudcontrol#Operation" + } + }, + "com.amazonaws.cloudcontrol#PatchDocument": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 65536 + }, + "smithy.api#pattern": "^(.|\\s)*$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.cloudcontrol#PrivateTypeException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "PrivateTypeException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

Cloud Control API has not received a valid response from the resource handler, due to a\n configuration error. This includes issues such as the resource handler returning an invalid\n response, or timing out.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudcontrol#ProgressEvent": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type used in the operation.

" + } + }, + "Identifier": { + "target": "com.amazonaws.cloudcontrol#Identifier", + "traits": { + "smithy.api#documentation": "

The primary identifier for the resource.

\n \n

In some cases, the resource identifier may be available before the resource operation\n has reached a status of SUCCESS.

\n
" + } + }, + "RequestToken": { + "target": "com.amazonaws.cloudcontrol#RequestToken", + "traits": { + "smithy.api#documentation": "

The unique token representing this resource operation request.

\n

Use the RequestToken with GetResourceRequestStatus to return the current status of a resource operation\n request.

" + } + }, + "Operation": { + "target": "com.amazonaws.cloudcontrol#Operation", + "traits": { + "smithy.api#documentation": "

The resource operation type.

" + } + }, + "OperationStatus": { + "target": "com.amazonaws.cloudcontrol#OperationStatus", + "traits": { + "smithy.api#documentation": "

The current status of the resource operation request.

\n " + } + }, + "EventTime": { + "target": "com.amazonaws.cloudcontrol#Timestamp", + "traits": { + "smithy.api#documentation": "

When the resource operation request was initiated.

" + } + }, + "ResourceModel": { + "target": "com.amazonaws.cloudcontrol#Properties", + "traits": { + "smithy.api#documentation": "

A JSON string containing the resource model, consisting of each resource property and its\n current value.

" + } + }, + "StatusMessage": { + "target": "com.amazonaws.cloudcontrol#StatusMessage", + "traits": { + "smithy.api#documentation": "

Any message explaining the current status.

" + } + }, + "ErrorCode": { + "target": "com.amazonaws.cloudcontrol#HandlerErrorCode", + "traits": { + "smithy.api#documentation": "

For requests with a status of FAILED, the associated error code.

\n

For error code definitions, see Handler error codes in the CloudFormation Command\n Line Interface User Guide for Extension Development.

" + } + }, + "RetryAfter": { + "target": "com.amazonaws.cloudcontrol#Timestamp", + "traits": { + "smithy.api#documentation": "

When to next request the status of this resource operation request.

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

Represents the current status of a resource operation request. For more information, see\n Managing resource operation requests in the\n Amazon Web Services Cloud Control API User Guide.

" + } + }, + "com.amazonaws.cloudcontrol#Properties": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 16384 + }, + "smithy.api#pattern": "^(.|\\s)*$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.cloudcontrol#RequestToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[-A-Za-z0-9+/=]+$" + } + }, + "com.amazonaws.cloudcontrol#RequestTokenNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "RequestTokenNotFoundException", + "httpResponseCode": 404 + }, + "smithy.api#documentation": "

A resource operation with the specified request token cannot be found.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.cloudcontrol#ResourceConflictException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ResourceConflictException", + "httpResponseCode": 409 + }, + "smithy.api#documentation": "

The resource is temporarily unavailable to be acted upon. For example, if the resource is\n currently undergoing an operation and cannot be acted upon until that operation is\n finished.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.cloudcontrol#ResourceDescription": { + "type": "structure", + "members": { + "Identifier": { + "target": "com.amazonaws.cloudcontrol#Identifier", + "traits": { + "smithy.api#documentation": "

The primary identifier for the resource.

\n

For more information, see Identifying\n resources in the Amazon Web Services Cloud Control API User Guide.

" + } + }, + "Properties": { + "target": "com.amazonaws.cloudcontrol#Properties", + "traits": { + "smithy.api#documentation": "

A list of the resource properties and their current values.

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

Represents information about a provisioned resource.

" + } + }, + "com.amazonaws.cloudcontrol#ResourceDescriptions": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudcontrol#ResourceDescription" + } + }, + "com.amazonaws.cloudcontrol#ResourceNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ResourceNotFoundException", + "httpResponseCode": 404 + }, + "smithy.api#documentation": "

A resource with the specified identifier cannot be found.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.cloudcontrol#ResourceRequestStatusFilter": { + "type": "structure", + "members": { + "Operations": { + "target": "com.amazonaws.cloudcontrol#Operations", + "traits": { + "smithy.api#documentation": "

The operation types to include in the filter.

" + } + }, + "OperationStatuses": { + "target": "com.amazonaws.cloudcontrol#OperationStatuses", + "traits": { + "smithy.api#documentation": "

The operation statuses to include in the filter.

\n " + } + } + }, + "traits": { + "smithy.api#documentation": "

The filter criteria to use in determining the requests returned.

" + } + }, + "com.amazonaws.cloudcontrol#ResourceRequestStatusSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudcontrol#ProgressEvent" + } + }, + "com.amazonaws.cloudcontrol#RoleArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:.+:iam::[0-9]{12}:role/.+$" + } + }, + "com.amazonaws.cloudcontrol#ServiceInternalErrorException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ServiceInternalErrorException", + "httpResponseCode": 502 + }, + "smithy.api#documentation": "

The resource handler has returned that the downstream service returned an internal error,\n typically with a 5XX HTTP status code.

", + "smithy.api#error": "server", + "smithy.api#httpError": 502 + } + }, + "com.amazonaws.cloudcontrol#ServiceLimitExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ServiceLimitExceededException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The resource handler has returned that a non-transient resource limit was reached on the\n service side.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudcontrol#StatusMessage": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^(.|\\s)*$" + } + }, + "com.amazonaws.cloudcontrol#ThrottlingException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ThrottlingException", + "httpResponseCode": 429 + }, + "smithy.api#documentation": "

The request was denied due to request throttling.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, + "com.amazonaws.cloudcontrol#Timestamp": { + "type": "timestamp" + }, + "com.amazonaws.cloudcontrol#TypeName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 10, + "max": 196 + }, + "smithy.api#pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$" + } + }, + "com.amazonaws.cloudcontrol#TypeNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "TypeNotFoundException", + "httpResponseCode": 404 + }, + "smithy.api#documentation": "

The specified extension does not exist in the CloudFormation registry.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.cloudcontrol#TypeVersionId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[A-Za-z0-9-]+$" + } + }, + "com.amazonaws.cloudcontrol#UnsupportedActionException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudcontrol#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "UnsupportedActionException", + "httpResponseCode": 405 + }, + "smithy.api#documentation": "

The specified resource does not support this resource operation.

", + "smithy.api#error": "client", + "smithy.api#httpError": 405 + } + }, + "com.amazonaws.cloudcontrol#UpdateResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudcontrol#UpdateResourceInput" + }, + "output": { + "target": "com.amazonaws.cloudcontrol#UpdateResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudcontrol#AlreadyExistsException" + }, + { + "target": "com.amazonaws.cloudcontrol#ClientTokenConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ConcurrentOperationException" + }, + { + "target": "com.amazonaws.cloudcontrol#GeneralServiceException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#HandlerInternalFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidCredentialsException" + }, + { + "target": "com.amazonaws.cloudcontrol#InvalidRequestException" + }, + { + "target": "com.amazonaws.cloudcontrol#NetworkFailureException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotStabilizedException" + }, + { + "target": "com.amazonaws.cloudcontrol#NotUpdatableException" + }, + { + "target": "com.amazonaws.cloudcontrol#PrivateTypeException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceConflictException" + }, + { + "target": "com.amazonaws.cloudcontrol#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceInternalErrorException" + }, + { + "target": "com.amazonaws.cloudcontrol#ServiceLimitExceededException" + }, + { + "target": "com.amazonaws.cloudcontrol#ThrottlingException" + }, + { + "target": "com.amazonaws.cloudcontrol#TypeNotFoundException" + }, + { + "target": "com.amazonaws.cloudcontrol#UnsupportedActionException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates the specified property values in the resource.

\n

You specify your resource property updates as a list of patch operations contained in a\n JSON patch document that adheres to the \n RFC 6902 - JavaScript Object\n Notation (JSON) Patch\n standard.

\n

For details on how Cloud Control API performs resource update operations, see Updating a resource in the Amazon Web Services Cloud Control API User Guide.

\n

After you have initiated a resource update request, you can monitor the progress of your\n request by calling GetResourceRequestStatus using the RequestToken of the\n ProgressEvent returned by UpdateResource.

\n

For more information about the properties of a specific resource, refer to the related\n topic for the resource in the Resource and property types reference in the Amazon Web Services\n CloudFormation Users Guide.

" + } + }, + "com.amazonaws.cloudcontrol#UpdateResourceInput": { + "type": "structure", + "members": { + "TypeName": { + "target": "com.amazonaws.cloudcontrol#TypeName", + "traits": { + "smithy.api#documentation": "

The name of the resource type.

", + "smithy.api#required": {} + } + }, + "TypeVersionId": { + "target": "com.amazonaws.cloudcontrol#TypeVersionId", + "traits": { + "smithy.api#documentation": "

For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.

" + } + }, + "RoleArn": { + "target": "com.amazonaws.cloudcontrol#RoleArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the \n handlers\n section of the resource type definition schema.

\n

If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.

\n

For more information, see Specifying credentials in the Amazon Web Services Cloud Control API User Guide.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.cloudcontrol#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.

\n

A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.

\n

If you do not specify a client token, one is generated for inclusion in the request.

\n

For more information, see Ensuring resource operation requests are unique in the Amazon Web Services Cloud Control API User Guide.

", + "smithy.api#idempotencyToken": {} + } + }, + "Identifier": { + "target": "com.amazonaws.cloudcontrol#Identifier", + "traits": { + "smithy.api#documentation": "

The identifier for the resource.

\n

You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.

\n

For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values in the order they are specified in the primary identifier definition, separated by |.

\n

For more information, see Identifying resources in the Amazon Web Services Cloud Control API User Guide.

", + "smithy.api#required": {} + } + }, + "PatchDocument": { + "target": "com.amazonaws.cloudcontrol#PatchDocument", + "traits": { + "smithy.api#documentation": "

A JavaScript Object Notation (JSON) document listing the patch operations that represent\n the updates to apply to the current resource properties. For details, see Composing the patch document in the Amazon Web Services Cloud Control API User\n Guide.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.cloudcontrol#UpdateResourceOutput": { + "type": "structure", + "members": { + "ProgressEvent": { + "target": "com.amazonaws.cloudcontrol#ProgressEvent", + "traits": { + "smithy.api#documentation": "

Represents the current status of the resource update request.

\n

Use the RequestToken of the ProgressEvent with GetResourceRequestStatus to return the current status of a resource operation\n request.

" + } + } + } + } + } +} diff --git a/codegen/sdk-codegen/aws-models/connect.2017-08-08.json b/codegen/sdk-codegen/aws-models/connect.2017-08-08.json index 1730e2c0df1..8a0c583bc43 100644 --- a/codegen/sdk-codegen/aws-models/connect.2017-08-08.json +++ b/codegen/sdk-codegen/aws-models/connect.2017-08-08.json @@ -595,6 +595,26 @@ "smithy.api#title": "Amazon Connect Service" } }, + "com.amazonaws.connect#AnswerMachineDetectionConfig": { + "type": "structure", + "members": { + "EnableAnswerMachineDetection": { + "target": "com.amazonaws.connect#Boolean", + "traits": { + "smithy.api#documentation": "

The flag to indicate if answer machine detection analysis needs to be performed for a voice\n call. If set to true, TrafficType must be set as CAMPAIGN.\n

" + } + }, + "AwaitAnswerMachinePrompt": { + "target": "com.amazonaws.connect#Boolean", + "traits": { + "smithy.api#documentation": "

Wait for the answering machine prompt.

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

Configuration of the answering machine detection.

" + } + }, "com.amazonaws.connect#AssociateApprovedOrigin": { "type": "operation", "input": { @@ -1178,6 +1198,15 @@ } } }, + "com.amazonaws.connect#CampaignId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, "com.amazonaws.connect#Channel": { "type": "string", "traits": { @@ -1937,7 +1966,7 @@ } ], "traits": { - "smithy.api#documentation": "

Create an AppIntegration association with an Amazon Connect instance.

", + "smithy.api#documentation": "

Creates an AWS resource association with an Amazon Connect instance.

", "smithy.api#http": { "method": "PUT", "uri": "/instance/{InstanceId}/integration-associations", @@ -1973,22 +2002,19 @@ "SourceApplicationUrl": { "target": "com.amazonaws.connect#URI", "traits": { - "smithy.api#documentation": "

The URL for the external application.

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

The URL for the external application. This field is only required for the EVENT integration type.

" } }, "SourceApplicationName": { "target": "com.amazonaws.connect#SourceApplicationName", "traits": { - "smithy.api#documentation": "

The name of the external application.

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

The name of the external application. This field is only required for the EVENT integration type.

" } }, "SourceType": { "target": "com.amazonaws.connect#SourceType", "traits": { - "smithy.api#documentation": "

The type of the data source.

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

The type of the data source. This field is only required for the EVENT integration type.

" } }, "Tags": { @@ -2005,7 +2031,7 @@ "IntegrationAssociationId": { "target": "com.amazonaws.connect#IntegrationAssociationId", "traits": { - "smithy.api#documentation": "

The identifier for the association.

" + "smithy.api#documentation": "

The identifier for the integration association.

" } }, "IntegrationAssociationArn": { @@ -2363,7 +2389,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a use case for an AppIntegration association.

", + "smithy.api#documentation": "

Creates a use case for an integration association.

", "smithy.api#http": { "method": "PUT", "uri": "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases", @@ -2385,7 +2411,7 @@ "IntegrationAssociationId": { "target": "com.amazonaws.connect#IntegrationAssociationId", "traits": { - "smithy.api#documentation": "

The identifier for the AppIntegration association.

", + "smithy.api#documentation": "

The identifier for the integration association.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -2393,7 +2419,7 @@ "UseCaseType": { "target": "com.amazonaws.connect#UseCaseType", "traits": { - "smithy.api#documentation": "

The type of use case to associate to the AppIntegration association. Each AppIntegration\n association can have only one of each use case type.

", + "smithy.api#documentation": "

The type of use case to associate to the integration association. Each integration\n association can have only one of each use case type.

", "smithy.api#required": {} } }, @@ -2923,7 +2949,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes an AppIntegration association from an Amazon Connect instance. The association must not have\n any use cases associated with it.

", + "smithy.api#documentation": "

Deletes an AWS resource association from an Amazon Connect instance. The association must not have\n any use cases associated with it.

", "smithy.api#http": { "method": "DELETE", "uri": "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}", @@ -2945,7 +2971,7 @@ "IntegrationAssociationId": { "target": "com.amazonaws.connect#IntegrationAssociationId", "traits": { - "smithy.api#documentation": "

The identifier for the AppIntegration association.

", + "smithy.api#documentation": "

The identifier for the integration association.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -3024,7 +3050,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes a use case from an AppIntegration association.

", + "smithy.api#documentation": "

Deletes a use case from an integration association.

", "smithy.api#http": { "method": "DELETE", "uri": "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases/{UseCaseId}", @@ -3046,7 +3072,7 @@ "IntegrationAssociationId": { "target": "com.amazonaws.connect#IntegrationAssociationId", "traits": { - "smithy.api#documentation": "

The identifier for the AppIntegration association.

", + "smithy.api#documentation": "

The identifier for the integration association.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -4523,7 +4549,7 @@ "KeyId": { "target": "com.amazonaws.connect#KeyId", "traits": { - "smithy.api#documentation": "

The identifier of the encryption key.

", + "smithy.api#documentation": "

The full ARN of the encryption key.

\n \n

Be sure to provide the full ARN of the encryption key, not just the ID.

\n
", "smithy.api#required": {} } } @@ -4704,7 +4730,7 @@ "CurrentMetrics": { "target": "com.amazonaws.connect#CurrentMetrics", "traits": { - "smithy.api#documentation": "

The metrics to retrieve. Specify the name and unit for each metric. The following metrics\n are available. For a description of all the metrics, see Real-time Metrics\n Definitions in the Amazon Connect Administrator Guide.

\n
\n
AGENTS_AFTER_CONTACT_WORK
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: ACW\n

\n\n
\n
AGENTS_AVAILABLE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Available\n

\n
\n
AGENTS_ERROR
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Error\n

\n
\n
AGENTS_NON_PRODUCTIVE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: NPT (Non-Productive Time)\n

\n
\n
AGENTS_ON_CALL
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: On\n contact\n

\n
\n
AGENTS_ON_CONTACT
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: On\n contact\n

\n
\n
AGENTS_ONLINE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Online\n

\n
\n
AGENTS_STAFFED
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Staffed\n

\n
\n
CONTACTS_IN_QUEUE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: In\n queue\n

\n
\n
CONTACTS_SCHEDULED
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Scheduled\n

\n
\n
OLDEST_CONTACT_AGE
\n
\n

Unit: SECONDS

\n

When you use groupings, Unit says SECONDS but the Value is returned in MILLISECONDS. For\n example, if you get a response like this:

\n

\n { \"Metric\": { \"Name\": \"OLDEST_CONTACT_AGE\", \"Unit\": \"SECONDS\" }, \"Value\": 24113.0\n }

\n

The actual OLDEST_CONTACT_AGE is 24 seconds.

\n\n

Name in real-time metrics report: Oldest\n

\n
\n
SLOTS_ACTIVE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Active\n

\n
\n
SLOTS_AVAILABLE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Availability\n

\n
\n
", + "smithy.api#documentation": "

The metrics to retrieve. Specify the name and unit for each metric. The following metrics\n are available. For a description of all the metrics, see Real-time Metrics\n Definitions in the Amazon Connect Administrator Guide.

\n
\n
AGENTS_AFTER_CONTACT_WORK
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: ACW\n

\n\n
\n
AGENTS_AVAILABLE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Available\n

\n
\n
AGENTS_ERROR
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Error\n

\n
\n
AGENTS_NON_PRODUCTIVE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: NPT (Non-Productive Time)\n

\n
\n
AGENTS_ON_CALL
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: On\n contact\n

\n
\n
AGENTS_ON_CONTACT
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: On\n contact\n

\n
\n
AGENTS_ONLINE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Online\n

\n
\n
AGENTS_STAFFED
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Staffed\n

\n
\n
CONTACTS_IN_QUEUE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: In\n queue\n

\n
\n
CONTACTS_SCHEDULED
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Scheduled\n

\n
\n
OLDEST_CONTACT_AGE
\n
\n

Unit: SECONDS

\n

When you use groupings, Unit says SECONDS and the Value is returned in SECONDS.

\n

When you do not use groupings, Unit says SECONDS but the Value is returned in MILLISECONDS. For\n example, if you get a response like this:

\n

\n { \"Metric\": { \"Name\": \"OLDEST_CONTACT_AGE\", \"Unit\": \"SECONDS\" }, \"Value\": 24113.0\n }

\n

The actual OLDEST_CONTACT_AGE is 24 seconds.

\n\n

Name in real-time metrics report: Oldest\n

\n
\n
SLOTS_ACTIVE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Active\n

\n
\n
SLOTS_AVAILABLE
\n
\n

Unit: COUNT

\n

Name in real-time metrics report: Availability\n

\n
\n
", "smithy.api#required": {} } }, @@ -5989,6 +6015,22 @@ { "value": "EVENT", "name": "EVENT" + }, + { + "value": "VOICE_ID", + "name": "VOICE_ID" + }, + { + "value": "PINPOINT_APP", + "name": "PINPOINT_APP" + }, + { + "value": "WISDOM_ASSISTANT", + "name": "WISDOM_ASSISTANT" + }, + { + "value": "WISDOM_KNOWLEDGE_BASE", + "name": "WISDOM_KNOWLEDGE_BASE" } ] } @@ -6943,7 +6985,7 @@ } ], "traits": { - "smithy.api#documentation": "

Provides summary information about the AppIntegration associations for the specified Amazon Connect\n instance.

", + "smithy.api#documentation": "

Provides summary information about the AWS resource associations for the specified Amazon Connect\n instance.

", "smithy.api#http": { "method": "GET", "uri": "/instance/{InstanceId}/integration-associations", @@ -6968,6 +7010,13 @@ "smithy.api#required": {} } }, + "IntegrationType": { + "target": "com.amazonaws.connect#IntegrationType", + "traits": { + "smithy.api#documentation": "

", + "smithy.api#httpQuery": "integrationType" + } + }, "NextToken": { "target": "com.amazonaws.connect#NextToken", "traits": { @@ -6991,7 +7040,7 @@ "IntegrationAssociationSummaryList": { "target": "com.amazonaws.connect#IntegrationAssociationSummaryList", "traits": { - "smithy.api#documentation": "

The AppIntegration associations.

" + "smithy.api#documentation": "

The associations.

" } }, "NextToken": { @@ -8060,7 +8109,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists the use cases.

", + "smithy.api#documentation": "

Lists the use cases for the integration association.

", "smithy.api#http": { "method": "GET", "uri": "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases", @@ -8110,7 +8159,7 @@ } }, "traits": { - "smithy.api#documentation": "

Provides summary information about the use cases for the specified Amazon Connect AppIntegration\n association.

" + "smithy.api#documentation": "

Provides summary information about the use cases for the specified integration\n association.

" } }, "com.amazonaws.connect#ListUseCasesResponse": { @@ -10902,7 +10951,7 @@ } ], "traits": { - "smithy.api#documentation": "

Places an outbound call to a contact, and then initiates the contact flow. It performs the\n actions in the contact flow that's specified (in ContactFlowId).

\n\n

Agents do not initiate the outbound API, which means that they do not dial the contact. If\n the contact flow places an outbound call to a contact, and then puts the contact in queue, the\n call is then routed to the agent, like any other inbound case.

\n\n

There is a 60-second dialing timeout for this operation. If the call is not connected after\n 60 seconds, it fails.

\n \n

UK numbers with a 447 prefix are not allowed by default. Before you can dial these UK\n mobile numbers, you must submit a service quota increase request. For more information, see\n Amazon Connect Service Quotas in the Amazon Connect Administrator Guide.

\n
", + "smithy.api#documentation": "

Places an outbound call to a contact, and then initiates the contact flow. It performs the\n actions in the contact flow that's specified (in ContactFlowId).

\n \n

Agents do not initiate the outbound API, which means that they do not dial the contact. If\n the contact flow places an outbound call to a contact, and then puts the contact in queue, the\n call is then routed to the agent, like any other inbound case.

\n\n

There is a 60-second dialing timeout for this operation. If the call is not connected after\n 60 seconds, it fails.

\n \n

UK numbers with a 447 prefix are not allowed by default. Before you can dial these UK\n mobile numbers, you must submit a service quota increase request. For more information, see\n Amazon Connect Service Quotas in the Amazon Connect Administrator Guide.

\n
\n \n

Campaign calls are not allowed by default. Before you can make a call with \n TrafficType = CAMPAIGN, you must submit a service quota increase request. For more information, see \n Amazon Connect Service Quotas in the Amazon Connect Administrator Guide.

\n
", "smithy.api#http": { "method": "PUT", "uri": "/contact/outbound-voice", @@ -10958,6 +11007,24 @@ "traits": { "smithy.api#documentation": "

A custom key-value pair using an attribute map. The attributes are standard Amazon Connect\n attributes, and can be accessed in contact flows just like any other contact attributes.

\n

There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys\n can include only alphanumeric, dash, and underscore characters.

" } + }, + "AnswerMachineDetectionConfig": { + "target": "com.amazonaws.connect#AnswerMachineDetectionConfig", + "traits": { + "smithy.api#documentation": "

Configuration of the answering machine detection for this outbound call.

" + } + }, + "CampaignId": { + "target": "com.amazonaws.connect#CampaignId", + "traits": { + "smithy.api#documentation": "

The campaign identifier of the outbound communication.

" + } + }, + "TrafficType": { + "target": "com.amazonaws.connect#TrafficType", + "traits": { + "smithy.api#documentation": "

Denotes the class of traffic. Calls with different traffic types are handled differently by\n Amazon Connect. The default value is GENERAL. Use CAMPAIGN if\n EnableAnswerMachineDetection is set to true. For all other cases, use\n GENERAL.

" + } } } }, @@ -11442,6 +11509,21 @@ "com.amazonaws.connect#Timestamp": { "type": "timestamp" }, + "com.amazonaws.connect#TrafficType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "GENERAL", + "name": "GENERAL" + }, + { + "value": "CAMPAIGN", + "name": "CAMPAIGN" + } + ] + } + }, "com.amazonaws.connect#URI": { "type": "string", "traits": { @@ -11943,7 +12025,7 @@ "AttributeType": { "target": "com.amazonaws.connect#InstanceAttributeType", "traits": { - "smithy.api#documentation": "

The type of attribute.

", + "smithy.api#documentation": "

The type of attribute.

\n \n

Only allowlisted customers can consume USE_CUSTOM_TTS_VOICES. To access this feature, contact AWS Support for allowlisting.

\n
", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -13130,7 +13212,7 @@ "UseCaseType": { "target": "com.amazonaws.connect#UseCaseType", "traits": { - "smithy.api#documentation": "

The type of use case to associate to the AppIntegration association. Each AppIntegration\n association can have only one of each use case type.

" + "smithy.api#documentation": "

The type of use case to associate to the integration association. Each integration\n association can have only one of each use case type.

" } } }, @@ -13160,6 +13242,10 @@ { "value": "RULES_EVALUATION", "name": "RULES_EVALUATION" + }, + { + "value": "CONNECT_CAMPAIGNS", + "name": "CONNECT_CAMPAIGNS" } ] } diff --git a/codegen/sdk-codegen/aws-models/dataexchange.2017-07-25.json b/codegen/sdk-codegen/aws-models/dataexchange.2017-07-25.json index 3b0f6353b93..67849e769c3 100644 --- a/codegen/sdk-codegen/aws-models/dataexchange.2017-07-25.json +++ b/codegen/sdk-codegen/aws-models/dataexchange.2017-07-25.json @@ -46,6 +46,14 @@ "smithy.api#httpError": 403 } }, + "com.amazonaws.dataexchange#Action": { + "type": "structure", + "members": { + "ExportRevisionToS3": { + "target": "com.amazonaws.dataexchange#AutoExportRevisionToS3RequestDetails" + } + } + }, "com.amazonaws.dataexchange#Arn": { "type": "string", "traits": { @@ -205,6 +213,44 @@ ] } }, + "com.amazonaws.dataexchange#AutoExportRevisionDestinationEntry": { + "type": "structure", + "members": { + "Bucket": { + "target": "com.amazonaws.dataexchange#__string", + "traits": { + "smithy.api#documentation": "

The S3 bucket that is the destination for the event action.

", + "smithy.api#required": {} + } + }, + "KeyPattern": { + "target": "com.amazonaws.dataexchange#__string", + "traits": { + "smithy.api#documentation": "

A string representing the pattern for generated names of the individual assets in the revision. For more information about key patterns, see Key patterns when exporting revisions.

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

A revision destination is the Amazon S3 bucket folder destination to where the export will be sent.

" + } + }, + "com.amazonaws.dataexchange#AutoExportRevisionToS3RequestDetails": { + "type": "structure", + "members": { + "Encryption": { + "target": "com.amazonaws.dataexchange#ExportServerSideEncryption" + }, + "RevisionDestination": { + "target": "com.amazonaws.dataexchange#AutoExportRevisionDestinationEntry", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Details of the operation to be performed by the job.

" + } + }, "com.amazonaws.dataexchange#CancelJob": { "type": "operation", "input": { @@ -453,6 +499,103 @@ } } }, + "com.amazonaws.dataexchange#CreateEventAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.dataexchange#CreateEventActionRequest" + }, + "output": { + "target": "com.amazonaws.dataexchange#CreateEventActionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.dataexchange#AccessDeniedException" + }, + { + "target": "com.amazonaws.dataexchange#InternalServerException" + }, + { + "target": "com.amazonaws.dataexchange#ServiceLimitExceededException" + }, + { + "target": "com.amazonaws.dataexchange#ThrottlingException" + }, + { + "target": "com.amazonaws.dataexchange#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation creates an event action.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/event-actions", + "code": 201 + } + } + }, + "com.amazonaws.dataexchange#CreateEventActionRequest": { + "type": "structure", + "members": { + "Action": { + "target": "com.amazonaws.dataexchange#Action", + "traits": { + "smithy.api#documentation": "

What occurs after a certain event.

", + "smithy.api#required": {} + } + }, + "Event": { + "target": "com.amazonaws.dataexchange#Event", + "traits": { + "smithy.api#documentation": "

What occurs to start an action.

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

The request body for CreateEventAction.

" + } + }, + "com.amazonaws.dataexchange#CreateEventActionResponse": { + "type": "structure", + "members": { + "Action": { + "target": "com.amazonaws.dataexchange#Action", + "traits": { + "smithy.api#documentation": "

What occurs after a certain event.

" + } + }, + "Arn": { + "target": "com.amazonaws.dataexchange#Arn", + "traits": { + "smithy.api#documentation": "

The ARN for the event action.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was created, in ISO 8601 format.

" + } + }, + "Event": { + "target": "com.amazonaws.dataexchange#Event", + "traits": { + "smithy.api#documentation": "

What occurs to start an action.

" + } + }, + "Id": { + "target": "com.amazonaws.dataexchange#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event action.

" + } + }, + "UpdatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was last updated, in ISO 8601 format.

" + } + } + } + }, "com.amazonaws.dataexchange#CreateJob": { "type": "operation", "input": { @@ -693,6 +836,9 @@ { "target": "com.amazonaws.dataexchange#CreateDataSet" }, + { + "target": "com.amazonaws.dataexchange#CreateEventAction" + }, { "target": "com.amazonaws.dataexchange#CreateJob" }, @@ -705,6 +851,9 @@ { "target": "com.amazonaws.dataexchange#DeleteDataSet" }, + { + "target": "com.amazonaws.dataexchange#DeleteEventAction" + }, { "target": "com.amazonaws.dataexchange#DeleteRevision" }, @@ -714,6 +863,9 @@ { "target": "com.amazonaws.dataexchange#GetDataSet" }, + { + "target": "com.amazonaws.dataexchange#GetEventAction" + }, { "target": "com.amazonaws.dataexchange#GetJob" }, @@ -726,6 +878,9 @@ { "target": "com.amazonaws.dataexchange#ListDataSets" }, + { + "target": "com.amazonaws.dataexchange#ListEventActions" + }, { "target": "com.amazonaws.dataexchange#ListJobs" }, @@ -750,6 +905,9 @@ { "target": "com.amazonaws.dataexchange#UpdateDataSet" }, + { + "target": "com.amazonaws.dataexchange#UpdateEventAction" + }, { "target": "com.amazonaws.dataexchange#UpdateRevision" } @@ -956,6 +1114,47 @@ } } }, + "com.amazonaws.dataexchange#DeleteEventAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.dataexchange#DeleteEventActionRequest" + }, + "errors": [ + { + "target": "com.amazonaws.dataexchange#InternalServerException" + }, + { + "target": "com.amazonaws.dataexchange#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dataexchange#ThrottlingException" + }, + { + "target": "com.amazonaws.dataexchange#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation deletes the event action.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/event-actions/{EventActionId}", + "code": 204 + } + } + }, + "com.amazonaws.dataexchange#DeleteEventActionRequest": { + "type": "structure", + "members": { + "EventActionId": { + "target": "com.amazonaws.dataexchange#__string", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event action.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, "com.amazonaws.dataexchange#DeleteRevision": { "type": "operation", "input": { @@ -1028,6 +1227,79 @@ } } }, + "com.amazonaws.dataexchange#Event": { + "type": "structure", + "members": { + "RevisionPublished": { + "target": "com.amazonaws.dataexchange#RevisionPublished" + } + } + }, + "com.amazonaws.dataexchange#EventActionEntry": { + "type": "structure", + "members": { + "Action": { + "target": "com.amazonaws.dataexchange#Action", + "traits": { + "smithy.api#documentation": "

What occurs after a certain event.

", + "smithy.api#required": {} + } + }, + "Arn": { + "target": "com.amazonaws.dataexchange#Arn", + "traits": { + "smithy.api#documentation": "

The ARN for the event action.

", + "smithy.api#required": {} + } + }, + "CreatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was created, in ISO 8601 format.

", + "smithy.api#required": {} + } + }, + "Event": { + "target": "com.amazonaws.dataexchange#Event", + "traits": { + "smithy.api#documentation": "

What occurs to start an action.

", + "smithy.api#required": {} + } + }, + "Id": { + "target": "com.amazonaws.dataexchange#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event action.

", + "smithy.api#required": {} + } + }, + "UpdatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was last updated, in ISO 8601 format.

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

An event action is an object that defines the relationship between a specific event and an automated action that will be taken on behalf of the customer.

" + } + }, + "com.amazonaws.dataexchange#ExceptionCause": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "InsufficientS3BucketPolicy", + "name": "InsufficientS3BucketPolicy" + }, + { + "value": "S3AccessDenied", + "name": "S3AccessDenied" + } + ] + } + }, "com.amazonaws.dataexchange#ExportAssetToSignedUrlRequestDetails": { "type": "structure", "members": { @@ -1230,7 +1502,7 @@ "KmsKeyArn": { "target": "com.amazonaws.dataexchange#__string", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the the AWS KMS key you want to use to encrypt the Amazon S3 objects. This parameter is required if you choose aws:kms as an encryption type.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the AWS KMS key you want to use to encrypt the Amazon S3 objects. This parameter is required if you choose aws:kms as an encryption type.

" } }, "Type": { @@ -1242,7 +1514,7 @@ } }, "traits": { - "smithy.api#documentation": "

Encryption configuration of the export job. Includes the encryption type as well as the AWS KMS key. The KMS key is only necessary if you chose the KMS encryption type.

" + "smithy.api#documentation": "

Encryption configuration of the export job. Includes the encryption type in addition to the AWS KMS key. The KMS key is only necessary if you chose the KMS encryption. type.

" } }, "com.amazonaws.dataexchange#GetAsset": { @@ -1485,6 +1757,91 @@ } } }, + "com.amazonaws.dataexchange#GetEventAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.dataexchange#GetEventActionRequest" + }, + "output": { + "target": "com.amazonaws.dataexchange#GetEventActionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.dataexchange#InternalServerException" + }, + { + "target": "com.amazonaws.dataexchange#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dataexchange#ThrottlingException" + }, + { + "target": "com.amazonaws.dataexchange#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation retrieves information about an event action.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/event-actions/{EventActionId}", + "code": 200 + } + } + }, + "com.amazonaws.dataexchange#GetEventActionRequest": { + "type": "structure", + "members": { + "EventActionId": { + "target": "com.amazonaws.dataexchange#__string", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event action.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dataexchange#GetEventActionResponse": { + "type": "structure", + "members": { + "Action": { + "target": "com.amazonaws.dataexchange#Action", + "traits": { + "smithy.api#documentation": "

What occurs after a certain event.

" + } + }, + "Arn": { + "target": "com.amazonaws.dataexchange#Arn", + "traits": { + "smithy.api#documentation": "

The ARN for the event action.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was created, in ISO 8601 format.

" + } + }, + "Event": { + "target": "com.amazonaws.dataexchange#Event", + "traits": { + "smithy.api#documentation": "

What occurs to start an action.

" + } + }, + "Id": { + "target": "com.amazonaws.dataexchange#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event action.

" + } + }, + "UpdatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was last updated, in ISO 8601 format.

" + } + } + } + }, "com.amazonaws.dataexchange#GetJob": { "type": "operation", "input": { @@ -2008,6 +2365,10 @@ { "value": "ASSET", "name": "ASSET" + }, + { + "value": "DATA_SET", + "name": "DATA_SET" } ] } @@ -2063,6 +2424,18 @@ { "value": "Concurrent in progress jobs to export assets to a signed URL", "name": "Concurrent_in_progress_jobs_to_export_assets_to_a_signed_URL" + }, + { + "value": "Concurrent in progress jobs to export revisions to Amazon S3", + "name": "Concurrent_in_progress_jobs_to_export_revisions_to_Amazon_S3" + }, + { + "value": "Event actions per account", + "name": "Event_actions_per_account" + }, + { + "value": "Auto export event actions per data set", + "name": "Auto_export_event_actions_per_data_set" } ] } @@ -2228,6 +2601,86 @@ } } }, + "com.amazonaws.dataexchange#ListEventActions": { + "type": "operation", + "input": { + "target": "com.amazonaws.dataexchange#ListEventActionsRequest" + }, + "output": { + "target": "com.amazonaws.dataexchange#ListEventActionsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.dataexchange#InternalServerException" + }, + { + "target": "com.amazonaws.dataexchange#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dataexchange#ThrottlingException" + }, + { + "target": "com.amazonaws.dataexchange#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation lists your event actions.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/event-actions", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "EventActions", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.dataexchange#ListEventActionsRequest": { + "type": "structure", + "members": { + "EventSourceId": { + "target": "com.amazonaws.dataexchange#__string", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event source.

", + "smithy.api#httpQuery": "eventSourceId" + } + }, + "MaxResults": { + "target": "com.amazonaws.dataexchange#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results returned by a single call.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.dataexchange#__string", + "traits": { + "smithy.api#documentation": "

The token value retrieved from a previous call to access the next page of results.

", + "smithy.api#httpQuery": "nextToken" + } + } + } + }, + "com.amazonaws.dataexchange#ListEventActionsResponse": { + "type": "structure", + "members": { + "EventActions": { + "target": "com.amazonaws.dataexchange#ListOfEventActionEntry", + "traits": { + "smithy.api#documentation": "

The event action objects listed by the request.

" + } + }, + "NextToken": { + "target": "com.amazonaws.dataexchange#NextToken", + "traits": { + "smithy.api#documentation": "

The token value retrieved from a previous call to access the next page of results.

" + } + } + } + }, "com.amazonaws.dataexchange#ListJobs": { "type": "operation", "input": { @@ -2345,6 +2798,12 @@ "target": "com.amazonaws.dataexchange#DataSetEntry" } }, + "com.amazonaws.dataexchange#ListOfEventActionEntry": { + "type": "list", + "member": { + "target": "com.amazonaws.dataexchange#EventActionEntry" + } + }, "com.amazonaws.dataexchange#ListOfJobEntry": { "type": "list", "member": { @@ -2652,6 +3111,10 @@ { "value": "JOB", "name": "JOB" + }, + { + "value": "EVENT_ACTION", + "name": "EVENT_ACTION" } ] } @@ -2783,6 +3246,17 @@ "smithy.api#documentation": "

A revision is a container for one or more assets.

" } }, + "com.amazonaws.dataexchange#RevisionPublished": { + "type": "structure", + "members": { + "DataSetId": { + "target": "com.amazonaws.dataexchange#Id", + "traits": { + "smithy.api#required": {} + } + } + } + }, "com.amazonaws.dataexchange#S3SnapshotAsset": { "type": "structure", "members": { @@ -3320,6 +3794,103 @@ } } }, + "com.amazonaws.dataexchange#UpdateEventAction": { + "type": "operation", + "input": { + "target": "com.amazonaws.dataexchange#UpdateEventActionRequest" + }, + "output": { + "target": "com.amazonaws.dataexchange#UpdateEventActionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.dataexchange#AccessDeniedException" + }, + { + "target": "com.amazonaws.dataexchange#InternalServerException" + }, + { + "target": "com.amazonaws.dataexchange#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dataexchange#ThrottlingException" + }, + { + "target": "com.amazonaws.dataexchange#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation updates the event action.

", + "smithy.api#http": { + "method": "PATCH", + "uri": "/v1/event-actions/{EventActionId}", + "code": 200 + } + } + }, + "com.amazonaws.dataexchange#UpdateEventActionRequest": { + "type": "structure", + "members": { + "Action": { + "target": "com.amazonaws.dataexchange#Action", + "traits": { + "smithy.api#documentation": "

What occurs after a certain event.

" + } + }, + "EventActionId": { + "target": "com.amazonaws.dataexchange#__string", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event action.

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

The request body for UpdateEventAction.

" + } + }, + "com.amazonaws.dataexchange#UpdateEventActionResponse": { + "type": "structure", + "members": { + "Action": { + "target": "com.amazonaws.dataexchange#Action", + "traits": { + "smithy.api#documentation": "

What occurs after a certain event.

" + } + }, + "Arn": { + "target": "com.amazonaws.dataexchange#Arn", + "traits": { + "smithy.api#documentation": "

The ARN for the event action.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was created, in ISO 8601 format.

" + } + }, + "Event": { + "target": "com.amazonaws.dataexchange#Event", + "traits": { + "smithy.api#documentation": "

What occurs to start an action.

" + } + }, + "Id": { + "target": "com.amazonaws.dataexchange#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier for the event action.

" + } + }, + "UpdatedAt": { + "target": "com.amazonaws.dataexchange#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that the event action was last updated, in ISO 8601 format.

" + } + } + } + }, "com.amazonaws.dataexchange#UpdateRevision": { "type": "operation", "input": { @@ -3455,6 +4026,12 @@ "smithy.api#documentation": "

The message that informs you about what was invalid about the request.

", "smithy.api#required": {} } + }, + "ExceptionCause": { + "target": "com.amazonaws.dataexchange#ExceptionCause", + "traits": { + "smithy.api#documentation": "

The message that informs you about what the exception was.

" + } } }, "traits": { diff --git a/codegen/sdk-codegen/aws-models/elasticloadbalancingv2.2015-12-01.json b/codegen/sdk-codegen/aws-models/elasticloadbalancingv2.2015-12-01.json index 268205b148e..7abb33fe97d 100644 --- a/codegen/sdk-codegen/aws-models/elasticloadbalancingv2.2015-12-01.json +++ b/codegen/sdk-codegen/aws-models/elasticloadbalancingv2.2015-12-01.json @@ -211,9 +211,15 @@ { "target": "com.amazonaws.elasticloadbalancingv2#DuplicateTagKeysException" }, + { + "target": "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException" + }, { "target": "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException" }, + { + "target": "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException" + }, { "target": "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException" }, @@ -1133,7 +1139,7 @@ "HealthCheckEnabled": { "target": "com.amazonaws.elasticloadbalancingv2#HealthCheckEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether health checks are enabled. If the target type is lambda,\n health checks are disabled by default but can be enabled. If the target type is\n instance or ip, health checks are always enabled and cannot be\n disabled.

" + "smithy.api#documentation": "

Indicates whether health checks are enabled. If the target type is lambda,\n health checks are disabled by default but can be enabled. If the target type is\n instance, ip, or alb, health checks are always\n enabled and cannot be disabled.

" } }, "HealthCheckPath": { @@ -1175,7 +1181,7 @@ "TargetType": { "target": "com.amazonaws.elasticloadbalancingv2#TargetTypeEnum", "traits": { - "smithy.api#documentation": "

The type of target that you must specify when registering targets with this target group.\n You can't specify targets for a target group using more than one target type.

\n " + "smithy.api#documentation": "

The type of target that you must specify when registering targets with this target group.\n You can't specify targets for a target group using more than one target type.

\n " } }, "Tags": { @@ -1230,6 +1236,9 @@ "errors": [ { "target": "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#ResourceInUseException" } ], "traits": { @@ -2940,7 +2949,7 @@ "Key": { "target": "com.amazonaws.elasticloadbalancingv2#LoadBalancerAttributeKey", "traits": { - "smithy.api#documentation": "

The name of the attribute.

\n\n

The following attribute is supported by all load balancers:

\n \n\n

The following attributes are supported by both Application Load Balancers and Network Load\n Balancers:

\n \n\n

The following attributes are supported by only Application Load Balancers:

\n \n\n

The following attribute is supported by Network Load Balancers and Gateway Load\n Balancers:

\n " + "smithy.api#documentation": "

The name of the attribute.

\n\n

The following attribute is supported by all load balancers:

\n \n\n

The following attributes are supported by both Application Load Balancers and Network Load\n Balancers:

\n \n\n

The following attributes are supported by only Application Load Balancers:

\n \n\n

The following attribute is supported by Network Load Balancers and Gateway Load\n Balancers:

\n " } }, "Value": { @@ -4605,20 +4614,20 @@ "Id": { "target": "com.amazonaws.elasticloadbalancingv2#TargetId", "traits": { - "smithy.api#documentation": "

The ID of the target. If the target type of the target group is instance,\n specify an instance ID. If the target type is ip, specify an IP address. If the\n target type is lambda, specify the ARN of the Lambda function.

", + "smithy.api#documentation": "

The ID of the target. If the target type of the target group is instance,\n specify an instance ID. If the target type is ip, specify an IP address. If the\n target type is lambda, specify the ARN of the Lambda function. If the target type\n is alb, specify the ARN of the Application Load Balancer target.

", "smithy.api#required": {} } }, "Port": { "target": "com.amazonaws.elasticloadbalancingv2#Port", "traits": { - "smithy.api#documentation": "

The port on which the target is listening. If the target group protocol is GENEVE, the\n supported port is 6081. Not used if the target is a Lambda function.

" + "smithy.api#documentation": "

The port on which the target is listening. If the target group protocol is GENEVE, the\n supported port is 6081. If the target type is alb, the targeted Application Load\n Balancer must have at least one listener whose port matches the target group port. Not used if\n the target is a Lambda function.

" } }, "AvailabilityZone": { "target": "com.amazonaws.elasticloadbalancingv2#ZoneName", "traits": { - "smithy.api#documentation": "

An Availability Zone or all. This determines whether the target receives\n traffic from the load balancer nodes in the specified Availability Zone or from all enabled\n Availability Zones for the load balancer.

\n

This parameter is not supported if the target type of the target group is\n instance.

\n

If the target type is ip and the IP address is in a subnet of the VPC for the\n target group, the Availability Zone is automatically detected and this parameter is optional.\n If the IP address is outside the VPC, this parameter is required.

\n

With an Application Load Balancer, if the target type is ip and the IP\n address is outside the VPC for the target group, the only supported value is\n all.

\n

If the target type is lambda, this parameter is optional and the only\n supported value is all.

" + "smithy.api#documentation": "

An Availability Zone or all. This determines whether the target receives\n traffic from the load balancer nodes in the specified Availability Zone or from all enabled\n Availability Zones for the load balancer.

\n

This parameter is not supported if the target type of the target group is\n instance or alb.

\n

If the target type is ip and the IP address is in a subnet of the VPC for the\n target group, the Availability Zone is automatically detected and this parameter is optional.\n If the IP address is outside the VPC, this parameter is required.

\n

With an Application Load Balancer, if the target type is ip and the IP\n address is outside the VPC for the target group, the only supported value is\n all.

\n

If the target type is lambda, this parameter is optional and the only\n supported value is all.

" } } }, @@ -4728,7 +4737,7 @@ "TargetType": { "target": "com.amazonaws.elasticloadbalancingv2#TargetTypeEnum", "traits": { - "smithy.api#documentation": "

The type of target that you must specify when registering targets with this target group.\n The possible values are instance (register targets by instance ID),\n ip (register targets by IP address), or lambda (register a single\n Lambda function as a target).

" + "smithy.api#documentation": "

The type of target that you must specify when registering targets with this target group.\n The possible values are instance (register targets by instance ID),\n ip (register targets by IP address), lambda (register a single\n Lambda function as a target), or alb (register a single Application Load Balancer\n as a target).

" } }, "ProtocolVersion": { @@ -5065,6 +5074,10 @@ { "value": "lambda", "name": "LAMBDA" + }, + { + "value": "alb", + "name": "ALB" } ] } diff --git a/codegen/sdk-codegen/aws-models/imagebuilder.2019-12-02.json b/codegen/sdk-codegen/aws-models/imagebuilder.2019-12-02.json index 1a1b087ed95..c68804e36e7 100644 --- a/codegen/sdk-codegen/aws-models/imagebuilder.2019-12-02.json +++ b/codegen/sdk-codegen/aws-models/imagebuilder.2019-12-02.json @@ -59,7 +59,7 @@ "userDataOverride": { "target": "com.amazonaws.imagebuilder#UserDataOverride", "traits": { - "smithy.api#documentation": "

Use this property to provide commands or a command script to run when you launch \n\t\t\tyour build instance.

\n\t\t \n\t\t\t

The userDataOverride property replaces any commands that Image Builder might have added to ensure\n\t\t\t\tthat Systems Manager is installed on your Linux build instance. If you override the user data,\n\t\t\t\tmake sure that you add commands to install Systems Manager, if it is not pre-installed on your\n\t\t\t\tsource image.

\n\t\t
" + "smithy.api#documentation": "

Use this property to provide commands or a command script to run when you launch \n\t\t\tyour build instance.

\n\t\t \n\t\t\t

The userDataOverride property replaces any commands that Image Builder might have added to ensure\n\t\t\t\tthat Systems Manager is installed on your Linux build instance. If you override the user data,\n\t\t\t\tmake sure that you add commands to install Systems Manager, if it is not pre-installed on your\n\t\t\t\tbase image.

\n\t\t
" } } }, @@ -114,7 +114,7 @@ "name": { "target": "com.amazonaws.imagebuilder#AmiNameString", "traits": { - "smithy.api#documentation": "

The name of the distribution configuration.

" + "smithy.api#documentation": "

The name of the output AMI.

" } }, "description": { @@ -343,7 +343,7 @@ "supportedOsVersions": { "target": "com.amazonaws.imagebuilder#OsVersionList", "traits": { - "smithy.api#documentation": "

The operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the parent image OS version during image recipe\n\t\t\tcreation.

" + "smithy.api#documentation": "

The operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the base image OS version during image recipe\n\t\t\tcreation.

" } }, "state": { @@ -630,7 +630,7 @@ "supportedOsVersions": { "target": "com.amazonaws.imagebuilder#OsVersionList", "traits": { - "smithy.api#documentation": "

The operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the parent image OS version during image recipe\n\t\t\tcreation.

" + "smithy.api#documentation": "

The operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the base image OS version during image recipe\n\t\t\tcreation.

" } }, "state": { @@ -719,7 +719,7 @@ "version": { "target": "com.amazonaws.imagebuilder#VersionNumber", "traits": { - "smithy.api#documentation": "

The semantic version of the component.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" + "smithy.api#documentation": "

The semantic version of the component.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" } }, "description": { @@ -737,7 +737,7 @@ "supportedOsVersions": { "target": "com.amazonaws.imagebuilder#OsVersionList", "traits": { - "smithy.api#documentation": "

he operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the parent image OS version during image recipe\n\t\t\tcreation.

" + "smithy.api#documentation": "

he operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the base image OS version during image recipe\n\t\t\tcreation.

" } }, "type": { @@ -876,7 +876,7 @@ "version": { "target": "com.amazonaws.imagebuilder#VersionNumber", "traits": { - "smithy.api#documentation": "

The semantic version of the container recipe.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" + "smithy.api#documentation": "

The semantic version of the container recipe.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" } }, "components": { @@ -912,7 +912,7 @@ "parentImage": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The source image for the container recipe.

" + "smithy.api#documentation": "

The base image for the container recipe.

" } }, "dateCreated": { @@ -986,7 +986,7 @@ "parentImage": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The source image for the container recipe.

" + "smithy.api#documentation": "

The base image for the container recipe.

" } }, "dateCreated": { @@ -1125,7 +1125,7 @@ "supportedOsVersions": { "target": "com.amazonaws.imagebuilder#OsVersionList", "traits": { - "smithy.api#documentation": "

The operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the parent image OS version during image recipe\n\t\t\tcreation.

" + "smithy.api#documentation": "

The operating system (OS) version supported by the component. If the OS information is\n\t\t\tavailable, a prefix match is performed against the base image OS version during image recipe\n\t\t\tcreation.

" } }, "data": { @@ -1295,19 +1295,19 @@ "platformOverride": { "target": "com.amazonaws.imagebuilder#Platform", "traits": { - "smithy.api#documentation": "

Specifies the operating system platform when you use a custom source image.

" + "smithy.api#documentation": "

Specifies the operating system platform when you use a custom base image.

" } }, "imageOsVersionOverride": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

Specifies the operating system version for the source image.

" + "smithy.api#documentation": "

Specifies the operating system version for the base image.

" } }, "parentImage": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The source image for the container recipe.

", + "smithy.api#documentation": "

The base image for the container recipe.

", "smithy.api#required": {} } }, @@ -1767,7 +1767,7 @@ "parentImage": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The parent image of the image recipe. The value of the string can be the ARN of the parent \n\t\t\timage or an AMI ID. The format for the ARN follows this example: \n\t\t\tarn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x. \n\t\t\tYou can provide the specific version that you want to use, or you can use a wildcard in \n\t\t\tall of the fields. If you enter an AMI ID for the string value, you must have access to the AMI, \n\t\t\tand the AMI must be in the same Region in which you are using Image Builder.

", + "smithy.api#documentation": "

The base image of the image recipe. The value of the string can be the ARN of the base \n\t\t\timage or an AMI ID. The format for the ARN follows this example: \n\t\t\tarn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x. \n\t\t\tYou can provide the specific version that you want to use, or you can use a wildcard in \n\t\t\tall of the fields. If you enter an AMI ID for the string value, you must have access to the AMI, \n\t\t\tand the AMI must be in the same Region in which you are using Image Builder.

", "smithy.api#required": {} } }, @@ -1975,7 +1975,7 @@ "instanceTypes": { "target": "com.amazonaws.imagebuilder#InstanceTypeList", "traits": { - "smithy.api#documentation": "

The instance metadata options that you can set for the HTTP requests that pipeline builds\n\t\t\tuse to launch EC2 build and test instances. For more information about instance metadata\n\t\t\toptions, see one of the following links:

\n\t\t " + "smithy.api#documentation": "

The instance types of the infrastructure configuration. You can specify one or more\n\t\t\tinstance types to use for this build. The service will pick one of these instance types based\n\t\t\ton availability.

" } }, "instanceProfileName": { @@ -3740,7 +3740,7 @@ "version": { "target": "com.amazonaws.imagebuilder#VersionNumber", "traits": { - "smithy.api#documentation": "

The semantic version of the image.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" + "smithy.api#documentation": "

The semantic version of the image.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" } }, "platform": { @@ -4046,7 +4046,7 @@ "parentImage": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The parent image of the image recipe.

" + "smithy.api#documentation": "

The base image of the image recipe.

" } }, "blockDeviceMappings": { @@ -4120,7 +4120,7 @@ "parentImage": { "target": "com.amazonaws.imagebuilder#NonEmptyString", "traits": { - "smithy.api#documentation": "

The parent image of the image recipe.

" + "smithy.api#documentation": "

The base image of the image recipe.

" } }, "dateCreated": { @@ -4366,7 +4366,7 @@ "version": { "target": "com.amazonaws.imagebuilder#VersionNumber", "traits": { - "smithy.api#documentation": "

Details for a specific version of an Image Builder image. This version follows the semantic version syntax.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" + "smithy.api#documentation": "

Details for a specific version of an Image Builder image. This version follows the semantic version syntax.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Assignment: For the first three nodes you can assign any positive integer value, including \n\tzero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the \n\tbuild number to the fourth node.

\n\t\t\t

\n Patterns: You can use any numeric pattern that adheres to the assignment requirements for \n\tthe nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or \n\ta date, such as 2021.01.01.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" } }, "platform": { @@ -4478,7 +4478,7 @@ "semanticVersion": { "target": "com.amazonaws.imagebuilder#VersionNumber", "traits": { - "smithy.api#documentation": "

The semantic version of the component. This version follows the semantic version syntax.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
", + "smithy.api#documentation": "

The semantic version of the component. This version follows the semantic version syntax.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
", "smithy.api#required": {} } }, @@ -4794,7 +4794,7 @@ "noDevice": { "target": "com.amazonaws.imagebuilder#EmptyString", "traits": { - "smithy.api#documentation": "

Use to remove a mapping from the parent image.

" + "smithy.api#documentation": "

Use to remove a mapping from the base image.

" } } }, @@ -4825,7 +4825,7 @@ } }, "traits": { - "smithy.api#documentation": "

Defines a custom source AMI and block device mapping configurations of an instance \n\t\t\tused for building and testing container images.

" + "smithy.api#documentation": "

Defines a custom base AMI and block device mapping configurations of an instance \n\t\t\tused for building and testing container images.

" } }, "com.amazonaws.imagebuilder#InstanceMetadataOptions": { @@ -5060,7 +5060,7 @@ } ], "traits": { - "smithy.api#documentation": "

Returns the list of component build versions for the specified semantic version.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
", + "smithy.api#documentation": "

Returns the list of component build versions for the specified semantic version.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
", "smithy.api#http": { "method": "POST", "uri": "/ListComponentBuildVersions", @@ -5153,7 +5153,7 @@ } ], "traits": { - "smithy.api#documentation": "

Returns the list of component build versions for the specified semantic version.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
", + "smithy.api#documentation": "

Returns the list of component build versions for the specified semantic version.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
", "smithy.api#http": { "method": "POST", "uri": "/ListComponents", @@ -6001,7 +6001,7 @@ "imageVersionList": { "target": "com.amazonaws.imagebuilder#ImageVersionList", "traits": { - "smithy.api#documentation": "

The list of image semantic versions.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the source image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" + "smithy.api#documentation": "

The list of image semantic versions.

\n\t\t \n\t\t\t

The semantic version has four nodes: ../. \n\tYou can assign values for the first three, and can filter on all of them.

\n\t\t\t

\n Filtering: With semantic versioning, you have the flexibility to use wildcards (x) \n\tto specify the most recent versions or nodes when selecting the base image or components for your \n\trecipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be \n\twildcards.

\n\t\t
" } }, "nextToken": { @@ -6749,7 +6749,7 @@ "pipelineExecutionStartCondition": { "target": "com.amazonaws.imagebuilder#PipelineExecutionStartCondition", "traits": { - "smithy.api#documentation": "

The condition configures when the pipeline should trigger a new image build. When the\n\t\t\tpipelineExecutionStartCondition is set to\n\t\t\tEXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE, and you use semantic version\n\t\t\tfilters on the source image or components in your image recipe, EC2 Image Builder will build a\n\t\t\tnew image only when there are new versions of the image or components in your recipe that\n\t\t\tmatch the semantic version filter. When it is set to EXPRESSION_MATCH_ONLY, it\n\t\t\twill build a new image every time the CRON expression matches the current time. For semantic\n\t\t\tversion syntax, see CreateComponent in the EC2 Image Builder API\n\t\t\t\t\tReference.

" + "smithy.api#documentation": "

The condition configures when the pipeline should trigger a new image build. When the\n\t\t\tpipelineExecutionStartCondition is set to\n\t\t\tEXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE, and you use semantic version\n\t\t\tfilters on the base image or components in your image recipe, EC2 Image Builder will build a\n\t\t\tnew image only when there are new versions of the image or components in your recipe that\n\t\t\tmatch the semantic version filter. When it is set to EXPRESSION_MATCH_ONLY, it\n\t\t\twill build a new image every time the CRON expression matches the current time. For semantic\n\t\t\tversion syntax, see CreateComponent in the EC2 Image Builder API\n\t\t\t\t\tReference.

" } } }, diff --git a/codegen/sdk-codegen/aws-models/lambda.2015-03-31.json b/codegen/sdk-codegen/aws-models/lambda.2015-03-31.json index 0caa022c596..598049c9048 100644 --- a/codegen/sdk-codegen/aws-models/lambda.2015-03-31.json +++ b/codegen/sdk-codegen/aws-models/lambda.2015-03-31.json @@ -432,7 +432,7 @@ } ], "traits": { - "smithy.api#documentation": "

Grants an Amazon Web Services service or another account permission to use a function. You can apply the policy at the\n function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier,\n the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function.

\n \n

To grant permission to another account, specify the account ID as the Principal. For Amazon Web Services\n services, the principal is a domain-style identifier defined by the service, like s3.amazonaws.com or\n sns.amazonaws.com. For Amazon Web Services services, you can also specify the ARN of the associated resource as the\n SourceArn. If you grant permission to a service principal without specifying the source, other\n accounts could potentially configure resources in their account to invoke your Lambda function.

\n \n

This action adds a statement to a resource-based permissions policy for the function. For more information\n about function policies, see Lambda Function Policies.

", + "smithy.api#documentation": "

Grants an Amazon Web Services service or another account permission to use a function. You can apply the policy at the\n function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier,\n the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function.\n Note: Lambda does not support adding policies to version $LATEST.

\n \n

To grant permission to another account, specify the account ID as the Principal. For Amazon Web Services\n services, the principal is a domain-style identifier defined by the service, like s3.amazonaws.com or\n sns.amazonaws.com. For Amazon Web Services services, you can also specify the ARN of the associated resource as the\n SourceArn. If you grant permission to a service principal without specifying the source, other\n accounts could potentially configure resources in their account to invoke your Lambda function.

\n \n

This action adds a statement to a resource-based permissions policy for the function. For more information\n about function policies, see Lambda Function Policies.

", "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/functions/{FunctionName}/policy", @@ -475,7 +475,7 @@ "SourceArn": { "target": "com.amazonaws.lambda#Arn", "traits": { - "smithy.api#documentation": "

For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or\n Amazon SNS topic.

" + "smithy.api#documentation": "

For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or\n Amazon SNS topic.

\n

Note that Lambda configures the comparison using the StringLike operator.

" } }, "SourceAccount": { @@ -624,6 +624,33 @@ "smithy.api#documentation": "

List of signing profiles that can sign a code package.

" } }, + "com.amazonaws.lambda#Architecture": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "x86_64", + "name": "x86_64" + }, + { + "value": "arm64", + "name": "arm64" + } + ] + } + }, + "com.amazonaws.lambda#ArchitecturesList": { + "type": "list", + "member": { + "target": "com.amazonaws.lambda#Architecture" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, "com.amazonaws.lambda#Arn": { "type": "string", "traits": { @@ -807,11 +834,23 @@ } }, "traits": { - "smithy.api#documentation": "

The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy \n is set to ENFORCE. Lambda blocks the deployment.

", + "smithy.api#documentation": "

The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy\n is set to ENFORCE. Lambda blocks the deployment.

", "smithy.api#error": "client", "smithy.api#httpError": 400 } }, + "com.amazonaws.lambda#CompatibleArchitectures": { + "type": "list", + "member": { + "target": "com.amazonaws.lambda#Architecture" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2 + } + } + }, "com.amazonaws.lambda#CompatibleRuntimes": { "type": "list", "member": { @@ -830,7 +869,7 @@ "ReservedConcurrentExecutions": { "target": "com.amazonaws.lambda#ReservedConcurrentExecutions", "traits": { - "smithy.api#documentation": "

The number of concurrent executions that are reserved for this function. For more information, see Managing Concurrency.

" + "smithy.api#documentation": "

The number of concurrent executions that are reserved for this function. For more information, see Managing Concurrency.

" } } } @@ -995,7 +1034,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a mapping between an event source and an Lambda function. Lambda reads items from the event source\n and triggers the function.

\n

For details about each event source type, see the following topics. In particular, each of the topics\n describes the required and optional parameters for the specific event source.

\n \n

The following error handling options are only available for stream sources (DynamoDB and Kinesis):

\n ", + "smithy.api#documentation": "

Creates a mapping between an event source and an Lambda function. Lambda reads items from the\n event source and triggers the function.

\n

For details about each event source type, see the following topics.

\n \n \n

The following error handling options are only available for stream sources (DynamoDB and Kinesis):

\n ", "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/event-source-mappings", @@ -1022,19 +1061,19 @@ "Enabled": { "target": "com.amazonaws.lambda#Enabled", "traits": { - "smithy.api#documentation": "

If true, the event source mapping is active. Set to false to pause polling and invocation.

" + "smithy.api#documentation": "

When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

\n

Default: True

" } }, "BatchSize": { "target": "com.amazonaws.lambda#BatchSize", "traits": { - "smithy.api#documentation": "

The maximum number of items to retrieve in a single batch.

\n " + "smithy.api#documentation": "

The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation\n (6 MB).

\n " } }, "MaximumBatchingWindowInSeconds": { "target": "com.amazonaws.lambda#MaximumBatchingWindowInSeconds", "traits": { - "smithy.api#documentation": "

(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds.

" + "smithy.api#documentation": "

(Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.

\n

Default: 0

\n

Related setting: When you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" } }, "ParallelizationFactor": { @@ -1046,7 +1085,7 @@ "StartingPosition": { "target": "com.amazonaws.lambda#EventSourcePosition", "traits": { - "smithy.api#documentation": "

The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams\n sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.

" + "smithy.api#documentation": "

The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon\n MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.

" } }, "StartingPositionTimestamp": { @@ -1094,7 +1133,7 @@ "Queues": { "target": "com.amazonaws.lambda#Queues", "traits": { - "smithy.api#documentation": "

\n (MQ) The name of the Amazon MQ broker destination queue to consume.\n

" + "smithy.api#documentation": "

(MQ) The name of the Amazon MQ broker destination queue to consume.

" } }, "SourceAccessConfigurations": { @@ -1155,7 +1194,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a Lambda function. To create a function, you need a deployment package and an execution role. The\n deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use Amazon Web Services\n services, such as Amazon CloudWatch Logs for log streaming and X-Ray for request tracing.

\n \n

You set the package type to Image if the deployment package is a\n container image. For a container image,\n the code property must include the URI of a container image in the Amazon ECR registry.\n You do not need to specify the handler and runtime properties.

\n \n

You set the package type to Zip if the deployment package is a\n .zip file archive.\n For a .zip file archive, the code property specifies the location of the .zip file. You must also specify the handler and\n runtime properties.

\n \n

When you create a function, Lambda provisions an instance of the function and its supporting resources. If\n your function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or\n modify the function. The State, StateReason, and StateReasonCode fields in\n the response from GetFunctionConfiguration indicate when the function is ready to invoke. For\n more information, see Function\n States.

\n \n

A function has an unpublished version, and can have published versions and aliases. The unpublished version\n changes when you update your function's code and configuration. A published version is a snapshot of your function\n code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be\n changed to map to a different version. Use the Publish parameter to create version 1 of\n your function from its initial configuration.

\n \n

The other parameters let you configure version-specific and function-level settings. You can modify\n version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply\n to both the unpublished and published versions of the function, and include tags (TagResource)\n and per-function concurrency limits (PutFunctionConcurrency).

\n \n

You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function,\n specify the ARN of a code-signing configuration. When a user\n attempts to deploy a code package with UpdateFunctionCode, Lambda checks that the code\n package has a valid signature from a trusted publisher. The code-signing configuration\n includes set set of signing profiles, which define the trusted publishers for this function.

\n \n

If another account or an Amazon Web Services service invokes your function, use AddPermission to grant\n permission by creating a resource-based IAM policy. You can grant permissions at the function level, on a version,\n or on an alias.

\n \n

To invoke your function directly, use Invoke. To invoke your function in response to events\n in other Amazon Web Services services, create an event source mapping (CreateEventSourceMapping), or configure a\n function trigger in the other service. For more information, see Invoking Functions.

", + "smithy.api#documentation": "

Creates a Lambda function. To create a function, you need a deployment package and an execution role. The\n deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use Amazon Web Services\n services, such as Amazon CloudWatch Logs for log streaming and X-Ray for request tracing.

\n \n

You set the package type to Image if the deployment package is a\n container image. For a container image,\n the code property must include the URI of a container image in the Amazon ECR registry.\n You do not need to specify the handler and runtime properties.

\n \n

You set the package type to Zip if the deployment package is a .zip file\n archive. For a .zip file archive, the code property specifies the location of the\n .zip file. You must also specify the handler and runtime properties. The code in the\n deployment package must be compatible with the target instruction set architecture of the\n function (x86-64 or arm64). If you do not specify the architecture, the default value is\n x86-64.

\n \n

When you create a function, Lambda provisions an instance of the function and its supporting resources. If\n your function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or\n modify the function. The State, StateReason, and StateReasonCode fields in\n the response from GetFunctionConfiguration indicate when the function is ready to invoke. For\n more information, see Function\n States.

\n \n

A function has an unpublished version, and can have published versions and aliases. The unpublished version\n changes when you update your function's code and configuration. A published version is a snapshot of your function\n code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be\n changed to map to a different version. Use the Publish parameter to create version 1 of\n your function from its initial configuration.

\n \n

The other parameters let you configure version-specific and function-level settings. You can modify\n version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply\n to both the unpublished and published versions of the function, and include tags (TagResource)\n and per-function concurrency limits (PutFunctionConcurrency).

\n \n

You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function,\n specify the ARN of a code-signing configuration. When a user\n attempts to deploy a code package with UpdateFunctionCode, Lambda checks that the code\n package has a valid signature from a trusted publisher. The code-signing configuration\n includes set set of signing profiles, which define the trusted publishers for this function.

\n \n

If another account or an Amazon Web Services service invokes your function, use AddPermission to grant\n permission by creating a resource-based IAM policy. You can grant permissions at the function level, on a version,\n or on an alias.

\n \n

To invoke your function directly, use Invoke. To invoke your function in response to events\n in other Amazon Web Services services, create an event source mapping (CreateEventSourceMapping), or configure a\n function trigger in the other service. For more information, see Invoking Functions.

", "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/functions", @@ -1288,6 +1327,12 @@ "traits": { "smithy.api#documentation": "

To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration\nincludes a set of signing profiles, which define the trusted publishers for this function.

" } + }, + "Architectures": { + "target": "com.amazonaws.lambda#ArchitecturesList", + "traits": { + "smithy.api#documentation": "

The instruction set architecture that the function supports. Enter a string array with one of the valid values. \n The default value is x86_64.

" + } } } }, @@ -1431,7 +1476,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes an event source\n mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

\n

When you delete an event source mapping, it enters a Deleting state and might not be completely deleted for several seconds.

", + "smithy.api#documentation": "

Deletes an event source\n mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

\n

When you delete an event source mapping, it enters a Deleting state and might not be completely\n deleted for several seconds.

", "smithy.api#http": { "method": "DELETE", "uri": "/2015-03-31/event-source-mappings/{UUID}", @@ -1841,7 +1886,7 @@ } }, "traits": { - "smithy.api#documentation": "

An error occured when reading from or writing to a connected file system.

", + "smithy.api#documentation": "

An error occurred when reading from or writing to a connected file system.

", "smithy.api#error": "client", "smithy.api#httpError": 410 } @@ -2067,13 +2112,13 @@ "BatchSize": { "target": "com.amazonaws.lambda#BatchSize", "traits": { - "smithy.api#documentation": "

The maximum number of items to retrieve in a single batch.

" + "smithy.api#documentation": "

The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).

\n

Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100.

\n

Related setting: When you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" } }, "MaximumBatchingWindowInSeconds": { "target": "com.amazonaws.lambda#MaximumBatchingWindowInSeconds", "traits": { - "smithy.api#documentation": "

(Streams and Amazon SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.

" + "smithy.api#documentation": "

(Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.

\n

Default: 0

\n

Related setting: When you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" } }, "ParallelizationFactor": { @@ -2532,6 +2577,12 @@ "traits": { "smithy.api#documentation": "

The ARN of the signing job.

" } + }, + "Architectures": { + "target": "com.amazonaws.lambda#ArchitecturesList", + "traits": { + "smithy.api#documentation": "

The instruction set architecture that the function supports. Architecture is a string array with one of the \n valid values. The default architecture value is x86_64.

" + } } }, "traits": { @@ -2803,7 +2854,7 @@ } ], "traits": { - "smithy.api#documentation": "

Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

", + "smithy.api#documentation": "

Returns details about an event source mapping. You can get the identifier of a mapping from the output of\n ListEventSourceMappings.

", "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/event-source-mappings/{UUID}", @@ -3432,6 +3483,12 @@ "traits": { "smithy.api#documentation": "

The layer's software license.

" } + }, + "CompatibleArchitectures": { + "target": "com.amazonaws.lambda#CompatibleArchitectures", + "traits": { + "smithy.api#documentation": "

A list of compatible \ninstruction set architectures.

" + } } } }, @@ -3826,7 +3883,7 @@ "LogType": { "target": "com.amazonaws.lambda#LogType", "traits": { - "smithy.api#documentation": "

Set to Tail to include the execution log in the response.

", + "smithy.api#documentation": "

Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only.

", "smithy.api#httpHeader": "X-Amz-Log-Type" } }, @@ -4424,6 +4481,12 @@ "traits": { "smithy.api#documentation": "

The layer's open-source license.

" } + }, + "CompatibleArchitectures": { + "target": "com.amazonaws.lambda#CompatibleArchitectures", + "traits": { + "smithy.api#documentation": "

A list of compatible \n instruction set architectures.

" + } } }, "traits": { @@ -4696,7 +4759,7 @@ "MaxItems": { "target": "com.amazonaws.lambda#MaxListItems", "traits": { - "smithy.api#documentation": "

The maximum number of event source mappings to return. Note that ListEventSourceMappings returns\n a maximum of 100 items in each response, even if you set the number higher.

", + "smithy.api#documentation": "

The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of\n 100 items in each response, even if you set the number higher.

", "smithy.api#httpQuery": "MaxItems" } } @@ -4988,7 +5051,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists the versions of an Lambda\n layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only\n versions that indicate that they're compatible with that runtime.

", + "smithy.api#documentation": "

Lists the versions of an Lambda\n layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only\n versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only \n layer versions that are compatible with that architecture.

", "smithy.api#http": { "method": "GET", "uri": "/2018-10-31/layers/{LayerName}/versions", @@ -5033,6 +5096,13 @@ "smithy.api#documentation": "

The maximum number of versions to return.

", "smithy.api#httpQuery": "MaxItems" } + }, + "CompatibleArchitecture": { + "target": "com.amazonaws.lambda#Architecture", + "traits": { + "smithy.api#documentation": "

The compatible \ninstruction set architecture.

", + "smithy.api#httpQuery": "CompatibleArchitecture" + } } } }, @@ -5073,7 +5143,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists Lambda\n layers and shows information about the latest version of each. Specify a runtime identifier to list only layers\n that indicate that they're compatible with that runtime.

", + "smithy.api#documentation": "

Lists Lambda\n layers and shows information about the latest version of each. Specify a\n runtime\n identifier to list only layers that indicate that they're compatible with that\n runtime. Specify a compatible architecture to include only layers that are compatible with\n that instruction set architecture.

", "smithy.api#http": { "method": "GET", "uri": "/2018-10-31/layers", @@ -5110,6 +5180,13 @@ "smithy.api#documentation": "

The maximum number of layers to return.

", "smithy.api#httpQuery": "MaxItems" } + }, + "CompatibleArchitecture": { + "target": "com.amazonaws.lambda#Architecture", + "traits": { + "smithy.api#documentation": "

The compatible \ninstruction set architecture.

", + "smithy.api#httpQuery": "CompatibleArchitecture" + } } } }, @@ -5248,7 +5325,7 @@ "Resource": { "target": "com.amazonaws.lambda#FunctionArn", "traits": { - "smithy.api#documentation": "

The function's Amazon Resource Name (ARN).

", + "smithy.api#documentation": "

The function's Amazon Resource Name (ARN). \n Note: Lambda does not support adding tags to aliases or versions.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -5792,6 +5869,12 @@ "traits": { "smithy.api#documentation": "

The layer's software license. It can be any of the following:

\n " } + }, + "CompatibleArchitectures": { + "target": "com.amazonaws.lambda#CompatibleArchitectures", + "traits": { + "smithy.api#documentation": "

A list of compatible \ninstruction set architectures.

" + } } } }, @@ -5845,6 +5928,12 @@ "traits": { "smithy.api#documentation": "

The layer's software license.

" } + }, + "CompatibleArchitectures": { + "target": "com.amazonaws.lambda#CompatibleArchitectures", + "traits": { + "smithy.api#documentation": "

A list of compatible \ninstruction set architectures.

" + } } } }, @@ -7395,7 +7484,7 @@ } ], "traits": { - "smithy.api#documentation": "

Updates an event source mapping. You can change the function that Lambda invokes, or pause invocation and resume later from the same location.

\n

The following error handling options are only available for stream sources (DynamoDB and Kinesis):

\n ", + "smithy.api#documentation": "

Updates an event source mapping. You can change the function that Lambda invokes, or pause\n invocation and resume later from the same location.

\n \n

The following error handling options are only available for stream sources (DynamoDB and Kinesis):

\n ", "smithy.api#http": { "method": "PUT", "uri": "/2015-03-31/event-source-mappings/{UUID}", @@ -7423,19 +7512,19 @@ "Enabled": { "target": "com.amazonaws.lambda#Enabled", "traits": { - "smithy.api#documentation": "

If true, the event source mapping is active. Set to false to pause polling and invocation.

" + "smithy.api#documentation": "

When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

\n

Default: True

" } }, "BatchSize": { "target": "com.amazonaws.lambda#BatchSize", "traits": { - "smithy.api#documentation": "

The maximum number of items to retrieve in a single batch.

\n " + "smithy.api#documentation": "

The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation\n (6 MB).

\n " } }, "MaximumBatchingWindowInSeconds": { "target": "com.amazonaws.lambda#MaximumBatchingWindowInSeconds", "traits": { - "smithy.api#documentation": "

(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds.

" + "smithy.api#documentation": "

(Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.

\n

Default: 0

\n

Related setting: When you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" } }, "DestinationConfig": { @@ -7595,6 +7684,12 @@ "traits": { "smithy.api#documentation": "

Only update the function if the revision ID matches the ID that's specified. Use this option to avoid modifying a\n function that has changed since you last read it.

" } + }, + "Architectures": { + "target": "com.amazonaws.lambda#ArchitecturesList", + "traits": { + "smithy.api#documentation": "

The instruction set architecture that the function supports. Enter a string array with one of the valid values. \n The default value is x86_64.

" + } } } }, @@ -7742,7 +7837,7 @@ "ImageConfig": { "target": "com.amazonaws.lambda#ImageConfig", "traits": { - "smithy.api#documentation": "

\n Container image configuration\n values that override the values in the container image Dockerfile.

" + "smithy.api#documentation": "

\n Container image configuration\n values that override the values in the container image Docker file.

" } } } diff --git a/codegen/sdk-codegen/aws-models/macie2.2020-01-01.json b/codegen/sdk-codegen/aws-models/macie2.2020-01-01.json index 75e9bda29ec..308a25b2926 100644 --- a/codegen/sdk-codegen/aws-models/macie2.2020-01-01.json +++ b/codegen/sdk-codegen/aws-models/macie2.2020-01-01.json @@ -550,7 +550,7 @@ "kmsManaged": { "target": "com.amazonaws.macie2#__long", "traits": { - "smithy.api#documentation": "

The total number of buckets that use an Key Management Service (KMS) customer master key (CMK) to encrypt new objects by default. These buckets use Amazon Web Services managed KMS encryption (AWS-KMS) or customer managed KMS encryption (SSE-KMS) by default.

", + "smithy.api#documentation": "

The total number of buckets that use an KMS key to encrypt new objects by default, either an Amazon Web Services managed key or a customer managed key. These buckets use KMS encryption (SSE-KMS) by default.

", "smithy.api#jsonName": "kmsManaged" } }, @@ -663,7 +663,7 @@ "eq": { "target": "com.amazonaws.macie2#__listOf__string", "traits": { - "smithy.api#documentation": "

The value for the property matches (equals) the specified value. If you specify multiple values, Macie uses OR logic to join the values.

", + "smithy.api#documentation": "

The value for the property matches (equals) the specified value. If you specify multiple values, Amazon Macie uses OR logic to join the values.

", "smithy.api#jsonName": "eq" } }, @@ -795,6 +795,20 @@ "smithy.api#jsonName": "classifiableSizeInBytes" } }, + "errorCode": { + "target": "com.amazonaws.macie2#BucketMetadataErrorCode", + "traits": { + "smithy.api#documentation": "

Specifies the error code for an error that prevented Amazon Macie from retrieving and processing information about the bucket and the bucket's objects. If this value is ACCESS_DENIED, Macie doesn't have permission to retrieve the information. For example, the bucket has a restrictive bucket policy and Amazon S3 denied the request. If this value is null, Macie was able to retrieve and process the information.

", + "smithy.api#jsonName": "errorCode" + } + }, + "errorMessage": { + "target": "com.amazonaws.macie2#__string", + "traits": { + "smithy.api#documentation": "

A brief description of the error (errorCode) that prevented Amazon Macie from retrieving and processing information about the bucket and the bucket's objects. This value is null if Macie was able to retrieve and process the information.

", + "smithy.api#jsonName": "errorMessage" + } + }, "jobDetails": { "target": "com.amazonaws.macie2#JobDetails", "traits": { @@ -868,7 +882,7 @@ "sizeInBytesCompressed": { "target": "com.amazonaws.macie2#__long", "traits": { - "smithy.api#documentation": "

The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the bucket.

If versioning is enabled for the bucket, Macie calculates this value based on the size of the latest version of each applicable object in the bucket. This value doesn't reflect the storage size of all versions of each applicable object in the bucket.

", + "smithy.api#documentation": "

The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the bucket.

If versioning is enabled for the bucket, Amazon Macie calculates this value based on the size of the latest version of each applicable object in the bucket. This value doesn't reflect the storage size of all versions of each applicable object in the bucket.

", "smithy.api#jsonName": "sizeInBytesCompressed" } }, @@ -902,7 +916,19 @@ } }, "traits": { - "smithy.api#documentation": "

Provides information about an S3 bucket that Amazon Macie monitors and analyzes.

" + "smithy.api#documentation": "

Provides statistical data and other information about an S3 bucket that Amazon Macie monitors and analyzes for your account. If an error occurs when Macie attempts to retrieve and process information about the bucket or the bucket's objects, the value for most of these properties is null. Exceptions are accountId, bucketArn, bucketCreatedAt, bucketName, lastUpdated, and region. To identify the cause of the error, refer to the errorCode and errorMessage values.

" + } + }, + "com.amazonaws.macie2#BucketMetadataErrorCode": { + "type": "string", + "traits": { + "smithy.api#documentation": "

The error code for an error that prevented Amazon Macie from retrieving and processing information about an S3 bucket and the bucket's objects.

", + "smithy.api#enum": [ + { + "value": "ACCESS_DENIED", + "name": "ACCESS_DENIED" + } + ] } }, "com.amazonaws.macie2#BucketPermissionConfiguration": { @@ -977,14 +1003,14 @@ "kmsMasterKeyId": { "target": "com.amazonaws.macie2#__string", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) or unique identifier (key ID) for the Key Management Service (KMS) customer master key (CMK) that's used by default to encrypt objects that are added to the bucket. This value is null if the bucket uses an Amazon S3 managed key to encrypt new objects or the bucket doesn't encrypt new objects by default.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) or unique identifier (key ID) for the KMS key that's used by default to encrypt objects that are added to the bucket. This value is null if the bucket uses an Amazon S3 managed key to encrypt new objects or the bucket doesn't encrypt new objects by default.

", "smithy.api#jsonName": "kmsMasterKeyId" } }, "type": { "target": "com.amazonaws.macie2#Type", "traits": { - "smithy.api#documentation": "

The type of server-side encryption that's used by default when storing new objects in the bucket. Possible values are:

", + "smithy.api#documentation": "

The type of server-side encryption that's used by default when storing new objects in the bucket. Possible values are:

", "smithy.api#jsonName": "type" } } @@ -3841,14 +3867,14 @@ "sizeInBytes": { "target": "com.amazonaws.macie2#__long", "traits": { - "smithy.api#documentation": "

The total storage size, in bytes, of the buckets.

If versioning is enabled for any of the buckets, Macie calculates this value based on the size of the latest version of each object in those buckets. This value doesn't reflect the storage size of all versions of the objects in the buckets.

", + "smithy.api#documentation": "

The total storage size, in bytes, of the buckets.

If versioning is enabled for any of the buckets, Amazon Macie calculates this value based on the size of the latest version of each object in those buckets. This value doesn't reflect the storage size of all versions of the objects in the buckets.

", "smithy.api#jsonName": "sizeInBytes" } }, "sizeInBytesCompressed": { "target": "com.amazonaws.macie2#__long", "traits": { - "smithy.api#documentation": "

The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the buckets.

If versioning is enabled for any of the buckets, Macie calculates this value based on the size of the latest version of each applicable object in those buckets. This value doesn't reflect the storage size of all versions of the applicable objects in the buckets.

", + "smithy.api#documentation": "

The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the buckets.

If versioning is enabled for any of the buckets, Amazon Macie calculates this value based on the size of the latest version of each applicable object in those buckets. This value doesn't reflect the storage size of all versions of the applicable objects in the buckets.

", "smithy.api#jsonName": "sizeInBytesCompressed" } }, @@ -6639,6 +6665,20 @@ "smithy.api#jsonName": "classifiableSizeInBytes" } }, + "errorCode": { + "target": "com.amazonaws.macie2#BucketMetadataErrorCode", + "traits": { + "smithy.api#documentation": "

Specifies the error code for an error that prevented Amazon Macie from retrieving and processing information about the bucket and the bucket's objects. If this value is ACCESS_DENIED, Macie doesn't have permission to retrieve the information. For example, the bucket has a restrictive bucket policy and Amazon S3 denied the request. If this value is null, Macie was able to retrieve and process the information.

", + "smithy.api#jsonName": "errorCode" + } + }, + "errorMessage": { + "target": "com.amazonaws.macie2#__string", + "traits": { + "smithy.api#documentation": "

A brief description of the error (errorCode) that prevented Amazon Macie from retrieving and processing information about the bucket and the bucket's objects. This value is null if Macie was able to retrieve and process the information.

", + "smithy.api#jsonName": "errorMessage" + } + }, "jobDetails": { "target": "com.amazonaws.macie2#JobDetails", "traits": { @@ -6670,7 +6710,7 @@ "sizeInBytesCompressed": { "target": "com.amazonaws.macie2#__long", "traits": { - "smithy.api#documentation": "

The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the bucket.

If versioning is enabled for the bucket, Macie calculates this value based on the size of the latest version of each applicable object in the bucket. This value doesn't reflect the storage size of all versions of each applicable object in the bucket.

", + "smithy.api#documentation": "

The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the bucket.

If versioning is enabled for the bucket, Amazon Macie calculates this value based on the size of the latest version of each applicable object in the bucket. This value doesn't reflect the storage size of all versions of each applicable object in the bucket.

", "smithy.api#jsonName": "sizeInBytesCompressed" } }, @@ -6690,7 +6730,7 @@ } }, "traits": { - "smithy.api#documentation": "

Provides statistical data and other information about an S3 bucket that Amazon Macie monitors and analyzes.

" + "smithy.api#documentation": "

Provides statistical data and other information about an S3 bucket that Amazon Macie monitors and analyzes for your account. If an error occurs when Macie attempts to retrieve and process information about the bucket or the bucket's objects, the value for most of these properties is null. Exceptions are accountId and bucketName. To identify the cause of the error, refer to the errorCode and errorMessage values.

" } }, "com.amazonaws.macie2#MatchingResource": { @@ -6705,7 +6745,7 @@ } }, "traits": { - "smithy.api#documentation": "

Provides statistical data and other information about an Amazon Web Services resource that Amazon Macie monitors and analyzes.

" + "smithy.api#documentation": "

Provides statistical data and other information about an Amazon Web Services resource that Amazon Macie monitors and analyzes for your account.

" } }, "com.amazonaws.macie2#MaxResults": { @@ -6809,14 +6849,14 @@ "customerManaged": { "target": "com.amazonaws.macie2#__long", "traits": { - "smithy.api#documentation": "

The total number of objects that are encrypted with a customer-managed key. The objects use customer-provided server-side encryption (SSE-C).

", + "smithy.api#documentation": "

The total number of objects that are encrypted with a customer-provided key. The objects use customer-provided server-side encryption (SSE-C).

", "smithy.api#jsonName": "customerManaged" } }, "kmsManaged": { "target": "com.amazonaws.macie2#__long", "traits": { - "smithy.api#documentation": "

The total number of objects that are encrypted with an Key Management Service (KMS) customer master key (CMK). The objects use Amazon Web Services managed KMS encryption (AWS-KMS) or customer managed KMS encryption (SSE-KMS).

", + "smithy.api#documentation": "

The total number of objects that are encrypted with an KMS key, either an Amazon Web Services managed key or a customer managed key. The objects use KMS encryption (SSE-KMS).

", "smithy.api#jsonName": "kmsManaged" } }, @@ -6872,7 +6912,7 @@ } }, "traits": { - "smithy.api#documentation": "

Provides information about the total storage size (in bytes) or number of objects that Amazon Macie can't analyze in one or more S3 buckets. In a BucketMetadata or MatchingBucket object, this data is for a specific bucket. In a GetBucketStatisticsResponse object, this data is aggregated for all the buckets in the query results. If versioning is enabled for a bucket, total storage size values are based on the size of the latest version of each applicable object in the bucket.

" + "smithy.api#documentation": "

Provides information about the total storage size (in bytes) or number of objects that Amazon Macie can't analyze in one or more S3 buckets. In a BucketMetadata or MatchingBucket object, this data is for a specific bucket. In a GetBucketStatisticsResponse object, this data is aggregated for the buckets in the query results. If versioning is enabled for a bucket, total storage size values are based on the size of the latest version of each applicable object in the bucket.

" } }, "com.amazonaws.macie2#Occurrences": { @@ -7454,7 +7494,7 @@ "kmsKeyArn": { "target": "com.amazonaws.macie2#__string", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Key Management Service (KMS) customer master key (CMK) to use for encryption of the results. This must be the ARN of an existing CMK that's in the same Amazon Web Services Region as the bucket.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the KMS key to use for encryption of the results. This must be the ARN of an existing, symmetric, customer managed KMS key that's in the same Amazon Web Services Region as the bucket.

", "smithy.api#jsonName": "kmsKeyArn", "smithy.api#required": {} } @@ -8046,7 +8086,7 @@ "kmsMasterKeyId": { "target": "com.amazonaws.macie2#__string", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) or unique identifier (key ID) for the Key Management Service (KMS) customer master key (CMK) that's used to encrypt data in the bucket or the object. If an KMS CMK isn't used, this value is null.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) or unique identifier (key ID) for the KMS key that's used to encrypt data in the bucket or the object. This value is null if an KMS key isn't used to encrypt the data.

", "smithy.api#jsonName": "kmsMasterKeyId" } } diff --git a/codegen/sdk-codegen/aws-models/networkfirewall.2020-11-12.json b/codegen/sdk-codegen/aws-models/networkfirewall.2020-11-12.json index b26d28e4ebb..ce6800cf36e 100644 --- a/codegen/sdk-codegen/aws-models/networkfirewall.2020-11-12.json +++ b/codegen/sdk-codegen/aws-models/networkfirewall.2020-11-12.json @@ -75,7 +75,7 @@ "min": 1, "max": 255 }, - "smithy.api#pattern": "^([a-fA-F\\d:\\.]+/\\d{1,3})$" + "smithy.api#pattern": "^([a-fA-F\\d:\\.]+($|/\\d{1,3}))$" } }, "com.amazonaws.networkfirewall#Addresses": { @@ -128,13 +128,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallPolicyArn": { @@ -222,13 +222,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "SubnetMappings": { @@ -716,7 +716,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes the specified Firewall and its FirewallStatus. This operation requires the firewall's DeleteProtection flag to be\n FALSE. You can't revert this operation.

\n

You can check whether a firewall is\n in use by reviewing the route tables for the Availability Zones where you have \n firewall subnet mappings. Retrieve the subnet mappings by calling DescribeFirewall.\n You define and update the route tables through Amazon VPC. As needed, update the route tables for the \n zones to remove the firewall endpoints. When the route tables no longer use the firewall endpoints, \n you can remove the firewall safely.

\n

To delete a firewall, remove the delete protection if you need to using UpdateFirewallDeleteProtection,\n then delete the firewall by calling DeleteFirewall.

" + "smithy.api#documentation": "

Deletes the specified Firewall and its FirewallStatus. \n This operation requires the firewall's DeleteProtection flag to be\n FALSE. You can't revert this operation.

\n

You can check whether a firewall is\n in use by reviewing the route tables for the Availability Zones where you have \n firewall subnet mappings. Retrieve the subnet mappings by calling DescribeFirewall.\n You define and update the route tables through Amazon VPC. As needed, update the route tables for the \n zones to remove the firewall endpoints. When the route tables no longer use the firewall endpoints, \n you can remove the firewall safely.

\n

To delete a firewall, remove the delete protection if you need to using UpdateFirewallDeleteProtection,\n then delete the firewall by calling DeleteFirewall.

" } }, "com.amazonaws.networkfirewall#DeleteFirewallPolicy": { @@ -786,13 +786,13 @@ "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } } } @@ -823,6 +823,9 @@ { "target": "com.amazonaws.networkfirewall#InvalidRequestException" }, + { + "target": "com.amazonaws.networkfirewall#InvalidResourcePolicyException" + }, { "target": "com.amazonaws.networkfirewall#ResourceNotFoundException" }, @@ -975,13 +978,13 @@ "FirewallPolicyName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallPolicyArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall policy.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall policy.

\n

You must specify the ARN or the name, and you can specify both.

" } } } @@ -1017,13 +1020,13 @@ "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } } } @@ -1083,13 +1086,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } } } @@ -1189,19 +1192,19 @@ "RuleGroupName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the rule group. You can't change the name of a rule group after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the rule group. You can't change the name of a rule group after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "RuleGroupArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the rule group.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the rule group.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "Type": { "target": "com.amazonaws.networkfirewall#RuleGroupType", "traits": { - "smithy.api#documentation": "

Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains \nstateless rules. If it is stateful, it contains stateful rules.

\n \n

This setting is required for requests that do not include the RuleGroupARN.

\n
" + "smithy.api#documentation": "

Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains \nstateless rules. If it is stateful, it contains stateful rules.

\n \n

This setting is required for requests that do not include the RuleGroupARN.

\n
" } } } @@ -1332,13 +1335,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "SubnetIds": { @@ -1521,7 +1524,19 @@ "StatefulRuleGroupReferences": { "target": "com.amazonaws.networkfirewall#StatefulRuleGroupReferences", "traits": { - "smithy.api#documentation": "

References to the stateless rule groups that are used in the policy. These define the\n inspection criteria in stateful rules.

" + "smithy.api#documentation": "

References to the stateful rule groups that are used in the policy. These define the\n inspection criteria in stateful rules.

" + } + }, + "StatefulDefaultActions": { + "target": "com.amazonaws.networkfirewall#StatefulActions", + "traits": { + "smithy.api#documentation": "

The default actions to take on a packet that doesn't match any stateful rules.

" + } + }, + "StatefulEngineOptions": { + "target": "com.amazonaws.networkfirewall#StatefulEngineOptions", + "traits": { + "smithy.api#documentation": "

Additional options governing how Network Firewall handles stateful rules. The stateful \n rule groups that you use in your policy must have stateful rule options settings that are compatible with these settings.

" } } }, @@ -1590,6 +1605,24 @@ "traits": { "smithy.api#documentation": "

The key:value pairs to associate with the resource.

" } + }, + "ConsumedStatelessRuleCapacity": { + "target": "com.amazonaws.networkfirewall#RuleCapacity", + "traits": { + "smithy.api#documentation": "

The number of capacity units currently consumed by the policy's stateless rules.

" + } + }, + "ConsumedStatefulRuleCapacity": { + "target": "com.amazonaws.networkfirewall#RuleCapacity", + "traits": { + "smithy.api#documentation": "

The number of capacity units currently consumed by the policy's stateful rules.

" + } + }, + "NumberOfAssociations": { + "target": "com.amazonaws.networkfirewall#NumberOfAssociations", + "traits": { + "smithy.api#documentation": "

The number of firewalls that are associated with this firewall policy.

" + } } }, "traits": { @@ -1687,7 +1720,7 @@ "min": 1, "max": 1024 }, - "smithy.api#pattern": "[\\s\\S]*$" + "smithy.api#pattern": "^[\\s\\S]*$" } }, "com.amazonaws.networkfirewall#Header": { @@ -1710,7 +1743,7 @@ "SourcePort": { "target": "com.amazonaws.networkfirewall#Port", "traits": { - "smithy.api#documentation": "

The source port to inspect for. You can specify an individual port, for \n example 1994 and you can specify a port\n range, for example 1990-1994.\n To match with any port, specify ANY.

", + "smithy.api#documentation": "

The source port to inspect for. You can specify an individual port, for \n example 1994 and you can specify a port\n range, for example 1990:1994.\n To match with any port, specify ANY.

", "smithy.api#required": {} } }, @@ -1731,13 +1764,13 @@ "DestinationPort": { "target": "com.amazonaws.networkfirewall#Port", "traits": { - "smithy.api#documentation": "

The destination port to inspect for. You can specify an individual port, for \n example 1994 and you can specify\n a port range, for example 1990-1994.\n To match with any port, specify ANY.

", + "smithy.api#documentation": "

The destination port to inspect for. You can specify an individual port, for \n example 1994 and you can specify\n a port range, for example 1990:1994.\n To match with any port, specify ANY.

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

The 5-tuple criteria for AWS Network Firewall to use to inspect packet headers in stateful\n traffic flow inspection. Traffic flows that match the criteria are a match for the\n corresponding StatefulRule.

" + "smithy.api#documentation": "

The basic rule criteria for AWS Network Firewall to use to inspect packet headers in stateful\n traffic flow inspection. Traffic flows that match the criteria are a match for the\n corresponding StatefulRule.

" } }, "com.amazonaws.networkfirewall#IPSet": { @@ -1820,7 +1853,7 @@ } }, "traits": { - "smithy.api#documentation": "

", + "smithy.api#documentation": "

The policy statement failed validation.

", "smithy.api#error": "client" } }, @@ -2193,7 +2226,7 @@ "min": 2, "max": 30 }, - "smithy.api#pattern": "[0-9A-Za-z]+" + "smithy.api#pattern": "^[0-9A-Za-z]+$" } }, "com.amazonaws.networkfirewall#LogType": { @@ -2244,13 +2277,13 @@ "SourcePorts": { "target": "com.amazonaws.networkfirewall#PortRanges", "traits": { - "smithy.api#documentation": "

The source ports to inspect for. If not specified, this matches with any source port.\n This setting is only used for protocols 6 (TCP) and 17 (UDP).

\n

You can specify individual ports, for example 1994 and you can specify port\n ranges, for example 1990-1994.

" + "smithy.api#documentation": "

The source ports to inspect for. If not specified, this matches with any source port.\n This setting is only used for protocols 6 (TCP) and 17 (UDP).

\n

You can specify individual ports, for example 1994 and you can specify port\n ranges, for example 1990:1994.

" } }, "DestinationPorts": { "target": "com.amazonaws.networkfirewall#PortRanges", "traits": { - "smithy.api#documentation": "

The destination ports to inspect for. If not specified, this matches with any\n destination port. This setting is only used for protocols 6 (TCP) and 17 (UDP).

\n

You can specify individual ports, for example 1994 and you can specify port\n ranges, for example 1990-1994.

" + "smithy.api#documentation": "

The destination ports to inspect for. If not specified, this matches with any\n destination port. This setting is only used for protocols 6 (TCP) and 17 (UDP).

\n

You can specify individual ports, for example 1994 and you can specify port\n ranges, for example 1990:1994.

" } }, "Protocols": { @@ -2374,10 +2407,16 @@ "name": "network-firewall" }, "aws.protocols#awsJson1_0": {}, - "smithy.api#documentation": "

This is the API Reference for AWS Network Firewall. This guide is for developers who need\n detailed information about the Network Firewall API actions, data types, and errors.

\n \n

Network Firewall is a stateful, managed, network firewall and intrusion detection and\n prevention service for Amazon Virtual Private Cloud (Amazon VPC). With Network Firewall, you can filter traffic at the\n perimeter of your VPC. This includes filtering traffic going to and coming from an internet\n gateway, NAT gateway, or over VPN or AWS Direct Connect. Network Firewall uses rules that are compatible\n with Suricata, a free, open source intrusion detection system (IDS) engine. For information about Suricata, \n see the Suricata website.

\n

You can use Network Firewall to monitor and protect your VPC traffic in a number of ways.\n The following are just a few examples:

\n \n

To enable Network Firewall for your VPCs, you perform steps in both Amazon VPC and in\n Network Firewall. For information about using Amazon VPC, see Amazon VPC User Guide.

\n

To start using Network Firewall, do the following:

\n
    \n
  1. \n

    (Optional) If you don't already have a VPC that you want to protect, create it in\n Amazon VPC.

    \n
  2. \n
  3. \n

    In Amazon VPC, in each Availability Zone where you want to have a firewall endpoint, create a\n subnet for the sole use of Network Firewall.

    \n
  4. \n
  5. \n

    In Network Firewall, create stateless and stateful rule groups, \n to define the components of the network traffic filtering behavior that you want your firewall to have.

    \n
  6. \n
  7. \n

    In Network Firewall, create a firewall policy that uses your rule groups and\n specifies additional default traffic filtering behavior.

    \n
  8. \n
  9. \n

    In Network Firewall, create a firewall and specify your new firewall policy and \n VPC subnets. Network Firewall creates a firewall endpoint in each subnet that you\n specify, with the behavior that's defined in the firewall policy.

    \n
  10. \n
  11. \n

    In Amazon VPC, use ingress routing enhancements to route traffic through the new firewall\n endpoints.

    \n
  12. \n
", + "smithy.api#documentation": "

This is the API Reference for AWS Network Firewall. This guide is for developers who need\n detailed information about the Network Firewall API actions, data types, and errors.

\n \n

Network Firewall is a stateful, managed, network firewall and intrusion detection and\n prevention service for Amazon Virtual Private Cloud (Amazon VPC). With Network Firewall, you can filter traffic at the\n perimeter of your VPC. This includes filtering traffic going to and coming from an internet\n gateway, NAT gateway, or over VPN or AWS Direct Connect. Network Firewall uses rules that are compatible\n with Suricata, a free, open source intrusion detection system (IDS) engine. \n AWS Network Firewall supports Suricata version 5.0.2. For information about Suricata, \n see the Suricata website.

\n

You can use Network Firewall to monitor and protect your VPC traffic in a number of ways.\n The following are just a few examples:

\n \n

To enable Network Firewall for your VPCs, you perform steps in both Amazon VPC and in\n Network Firewall. For information about using Amazon VPC, see Amazon VPC User Guide.

\n

To start using Network Firewall, do the following:

\n
    \n
  1. \n

    (Optional) If you don't already have a VPC that you want to protect, create it in\n Amazon VPC.

    \n
  2. \n
  3. \n

    In Amazon VPC, in each Availability Zone where you want to have a firewall endpoint, create a\n subnet for the sole use of Network Firewall.

    \n
  4. \n
  5. \n

    In Network Firewall, create stateless and stateful rule groups, \n to define the components of the network traffic filtering behavior that you want your firewall to have.

    \n
  6. \n
  7. \n

    In Network Firewall, create a firewall policy that uses your rule groups and\n specifies additional default traffic filtering behavior.

    \n
  8. \n
  9. \n

    In Network Firewall, create a firewall and specify your new firewall policy and \n VPC subnets. Network Firewall creates a firewall endpoint in each subnet that you\n specify, with the behavior that's defined in the firewall policy.

    \n
  10. \n
  11. \n

    In Amazon VPC, use ingress routing enhancements to route traffic through the new firewall\n endpoints.

    \n
  12. \n
", "smithy.api#title": "AWS Network Firewall" } }, + "com.amazonaws.networkfirewall#NumberOfAssociations": { + "type": "integer", + "traits": { + "smithy.api#box": {} + } + }, "com.amazonaws.networkfirewall#PaginationMaxResults": { "type": "integer", "traits": { @@ -2395,7 +2434,7 @@ "min": 1, "max": 2048 }, - "smithy.api#pattern": "[0-9A-Za-z:\\/+=]+$" + "smithy.api#pattern": "^[0-9A-Za-z:\\/+=]+$" } }, "com.amazonaws.networkfirewall#PerObjectStatus": { @@ -2440,7 +2479,7 @@ "min": 1, "max": 395000 }, - "smithy.api#pattern": ".*\\S.*" + "smithy.api#pattern": "\\S" } }, "com.amazonaws.networkfirewall#Port": { @@ -2611,7 +2650,7 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "^arn:aws.*" + "smithy.api#pattern": "^arn:aws" } }, "com.amazonaws.networkfirewall#ResourceId": { @@ -2654,7 +2693,7 @@ } }, "traits": { - "smithy.api#documentation": "

", + "smithy.api#documentation": "

Unable to change the resource because your account doesn't own it.

", "smithy.api#error": "client" } }, @@ -2716,6 +2755,12 @@ "smithy.api#documentation": "

The stateful rules or stateless rules for the rule group.

", "smithy.api#required": {} } + }, + "StatefulRuleOptions": { + "target": "com.amazonaws.networkfirewall#StatefulRuleOptions", + "traits": { + "smithy.api#documentation": "

Additional options governing how Network Firewall handles stateful rules. The policies where you use your stateful \n rule group must have stateful rule options settings that are compatible with these settings.

" + } } }, "traits": { @@ -2795,6 +2840,18 @@ "traits": { "smithy.api#documentation": "

The key:value pairs to associate with the resource.

" } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.networkfirewall#RuleCapacity", + "traits": { + "smithy.api#documentation": "

The number of capacity units currently consumed by the rule group rules.

" + } + }, + "NumberOfAssociations": { + "target": "com.amazonaws.networkfirewall#NumberOfAssociations", + "traits": { + "smithy.api#documentation": "

The number of firewall policies that use this rule group.

" + } } }, "traits": { @@ -2849,6 +2906,21 @@ "target": "com.amazonaws.networkfirewall#RuleOption" } }, + "com.amazonaws.networkfirewall#RuleOrder": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "DEFAULT_ACTION_ORDER", + "name": "DEFAULT_ACTION_ORDER" + }, + { + "value": "STRICT_ORDER", + "name": "STRICT_ORDER" + } + ] + } + }, "com.amazonaws.networkfirewall#RuleTargets": { "type": "list", "member": { @@ -2903,7 +2975,7 @@ "StatefulRules": { "target": "com.amazonaws.networkfirewall#StatefulRules", "traits": { - "smithy.api#documentation": "

The 5-tuple stateful inspection criteria. This contains an array of individual 5-tuple\n stateful rules to be used together in a stateful rule group.

" + "smithy.api#documentation": "

An array of individual stateful rules inspection criteria to be used together in a stateful rule group. \n Use this option to specify simple Suricata rules with protocol, source and destination, ports, direction, and rule options. \n For information about the Suricata Rules format, see\n Rules Format.

" } }, "StatelessRulesAndCustomActions": { @@ -2930,7 +3002,7 @@ "TargetTypes": { "target": "com.amazonaws.networkfirewall#TargetTypes", "traits": { - "smithy.api#documentation": "

The protocols you want to inspect. Specify TLS_SNI for HTTPS. Specity HTTP_HOST for HTTP. You can specify either or both.

", + "smithy.api#documentation": "

The protocols you want to inspect. Specify TLS_SNI for HTTPS. Specify HTTP_HOST for HTTP. You can specify either or both.

", "smithy.api#required": {} } }, @@ -2943,7 +3015,7 @@ } }, "traits": { - "smithy.api#documentation": "

Stateful inspection criteria for a domain list rule group.

\n

For HTTPS traffic, domain filtering is SNI-based. It uses the server name indicator extension of the TLS handshake.

\n

By default, Network Firewall domain list inspection only includes traffic coming from the VPC where you deploy the firewall. To inspect traffic from IP addresses outside of the deployment VPC, you set the HOME_NET rule variable to include the CIDR range of the deployment VPC plus the other CIDR ranges. For more information, see RuleVariables in this guide and Stateful domain list rule groups in AWS Network Firewall in the Network Firewall Developer Guide\n

" + "smithy.api#documentation": "

Stateful inspection criteria for a domain list rule group.

\n

For HTTPS traffic, domain filtering is SNI-based. It uses the server name indicator extension of the TLS handshake.

\n

By default, Network Firewall domain list inspection only includes traffic coming from the VPC where you deploy the firewall. To inspect traffic from IP addresses outside of the deployment VPC, you set the HOME_NET rule variable to include the CIDR range of the deployment VPC plus the other CIDR ranges. For more information, see RuleVariables in this guide and Stateful domain list rule groups in AWS Network Firewall in the Network Firewall Developer Guide.

" } }, "com.amazonaws.networkfirewall#RulesString": { @@ -2951,7 +3023,7 @@ "traits": { "smithy.api#length": { "min": 0, - "max": 1000000 + "max": 2000000 } } }, @@ -3000,6 +3072,26 @@ ] } }, + "com.amazonaws.networkfirewall#StatefulActions": { + "type": "list", + "member": { + "target": "com.amazonaws.networkfirewall#CollectionMember_String" + } + }, + "com.amazonaws.networkfirewall#StatefulEngineOptions": { + "type": "structure", + "members": { + "RuleOrder": { + "target": "com.amazonaws.networkfirewall#RuleOrder", + "traits": { + "smithy.api#documentation": "

Indicates how to manage the order of stateful rule evaluation for the policy. By default, Network Firewall\n leaves the rule evaluation order up to the Suricata rule processing engine. If you set \n this to STRICT_ORDER, your rules are evaluated in the exact order that you provide them\n in the policy. With strict ordering, the rule groups are evaluated by order of priority, starting from the lowest number, and \n the rules in each rule group are processed in the order that they're defined.

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

Configuration settings for the handling of the stateful rule groups in a firewall policy.

" + } + }, "com.amazonaws.networkfirewall#StatefulRule": { "type": "structure", "members": { @@ -3013,20 +3105,20 @@ "Header": { "target": "com.amazonaws.networkfirewall#Header", "traits": { - "smithy.api#documentation": "

The stateful 5-tuple inspection criteria for this rule, used to inspect traffic flows.\n

", + "smithy.api#documentation": "

The stateful inspection criteria for this rule, used to inspect traffic flows.\n

", "smithy.api#required": {} } }, "RuleOptions": { "target": "com.amazonaws.networkfirewall#RuleOptions", "traits": { - "smithy.api#documentation": "

", + "smithy.api#documentation": "

Additional options for the rule. These are the Suricata RuleOptions settings.

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

A single 5-tuple stateful rule, for use in a stateful rule group.

" + "smithy.api#documentation": "

A single Suricata rules specification, for use in a stateful rule group. \n Use this option to specify a simple Suricata rule with protocol, source and destination, ports, direction, and rule options. \n For information about the Suricata Rules format, see\n Rules Format.

" } }, "com.amazonaws.networkfirewall#StatefulRuleDirection": { @@ -3053,6 +3145,13 @@ "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the stateful rule group.

", "smithy.api#required": {} } + }, + "Priority": { + "target": "com.amazonaws.networkfirewall#Priority", + "traits": { + "smithy.api#box": {}, + "smithy.api#documentation": "

An integer setting that indicates the order in which to run the stateful rule groups in\n a single FirewallPolicy. This setting only applies to firewall policies\n that specify the STRICT_ORDER rule order in the stateful engine options settings.

\n

Network Firewall evalutes each stateful rule group\n against a packet starting with the group that has the lowest priority setting. You must ensure\n that the priority settings are unique within each policy.

\n

You can change the priority settings of your rule groups at any time. To make it easier to\n insert rule groups later, number them so there's a wide range in between, for example use 100,\n 200, and so on.

" + } } }, "traits": { @@ -3065,6 +3164,20 @@ "target": "com.amazonaws.networkfirewall#StatefulRuleGroupReference" } }, + "com.amazonaws.networkfirewall#StatefulRuleOptions": { + "type": "structure", + "members": { + "RuleOrder": { + "target": "com.amazonaws.networkfirewall#RuleOrder", + "traits": { + "smithy.api#documentation": "

Indicates how to manage the order of the rule evaluation for the rule group. By default, Network Firewall\n leaves the rule evaluation order up to the Suricata rule processing engine. If you set \n this to STRICT_ORDER, your rules are evaluated in the exact order that they're listed \n in your Suricata rules string.

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

Additional options governing how Network Firewall handles the rule group. You can only use these for stateful rule groups.

" + } + }, "com.amazonaws.networkfirewall#StatefulRuleProtocol": { "type": "string", "traits": { @@ -3173,7 +3286,7 @@ "Priority": { "target": "com.amazonaws.networkfirewall#Priority", "traits": { - "smithy.api#documentation": "

A setting that indicates the order in which to run this rule relative to all of the\n rules that are defined for a stateless rule group. Network Firewall evaluates the rules in a\n rule group starting with the lowest priority setting. You must ensure that the priority\n settings are unique for the rule group.

\n

Each stateless rule group uses exactly one StatelessRulesAndCustomActions\n object, and each StatelessRulesAndCustomActions contains exactly one\n StatelessRules object. To ensure unique priority settings for your rule\n groups, set unique priorities for the stateless rules that you define inside any single\n StatelessRules object.

\n

You can change the priority settings of your rules at any time. To make it easier to\n insert rules later, number them so there's a wide range in between, for example use 100,\n 200, and so on.

", + "smithy.api#documentation": "

Indicates the order in which to run this rule relative to all of the\n rules that are defined for a stateless rule group. Network Firewall evaluates the rules in a\n rule group starting with the lowest priority setting. You must ensure that the priority\n settings are unique for the rule group.

\n

Each stateless rule group uses exactly one StatelessRulesAndCustomActions\n object, and each StatelessRulesAndCustomActions contains exactly one\n StatelessRules object. To ensure unique priority settings for your rule\n groups, set unique priorities for the stateless rules that you define inside any single\n StatelessRules object.

\n

You can change the priority settings of your rules at any time. To make it easier to\n insert rules later, number them so there's a wide range in between, for example use 100,\n 200, and so on.

", "smithy.api#required": {} } } @@ -3613,13 +3726,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "DeleteProtection": { @@ -3701,13 +3814,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "Description": { @@ -3820,13 +3933,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallPolicyChangeProtection": { @@ -3880,13 +3993,13 @@ "FirewallPolicyArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall policy.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall policy.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallPolicyName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallPolicy": { @@ -3967,13 +4080,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "LoggingConfiguration": { @@ -4046,13 +4159,13 @@ "RuleGroupArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the rule group.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the rule group.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "RuleGroupName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the rule group. You can't change the name of a rule group after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the rule group. You can't change the name of a rule group after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "RuleGroup": { @@ -4070,7 +4183,7 @@ "Type": { "target": "com.amazonaws.networkfirewall#RuleGroupType", "traits": { - "smithy.api#documentation": "

Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains \nstateless rules. If it is stateful, it contains stateful rules.

\n \n

This setting is required for requests that do not include the RuleGroupARN.

\n
" + "smithy.api#documentation": "

Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains \nstateless rules. If it is stateful, it contains stateful rules.

\n \n

This setting is required for requests that do not include the RuleGroupARN.

\n
" } }, "Description": { @@ -4150,13 +4263,13 @@ "FirewallArn": { "target": "com.amazonaws.networkfirewall#ResourceArn", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the firewall.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "FirewallName": { "target": "com.amazonaws.networkfirewall#ResourceName", "traits": { - "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" + "smithy.api#documentation": "

The descriptive name of the firewall. You can't change the name of a firewall after you create it.

\n

You must specify the ARN or the name, and you can specify both.

" } }, "SubnetChangeProtection": { diff --git a/codegen/sdk-codegen/aws-models/pinpoint.2016-12-01.json b/codegen/sdk-codegen/aws-models/pinpoint.2016-12-01.json index 8a3de2b31db..9419a9f8d62 100644 --- a/codegen/sdk-codegen/aws-models/pinpoint.2016-12-01.json +++ b/codegen/sdk-codegen/aws-models/pinpoint.2016-12-01.json @@ -1046,6 +1046,12 @@ "traits": { "smithy.api#documentation": "

The settings for a wait activity. This type of activity waits for a certain amount of time or until a specific date and time before moving participants to the next activity in a journey.

" } + }, + "ContactCenter": { + "target": "com.amazonaws.pinpoint#ContactCenterActivity", + "traits": { + "smithy.api#documentation": "

The settings for a connect activity. This type of activity initiates a contact center call to participants.

" + } } }, "traits": { @@ -2456,6 +2462,17 @@ "smithy.api#httpError": 409 } }, + "com.amazonaws.pinpoint#ContactCenterActivity": { + "type": "structure", + "members": { + "NextActivity": { + "target": "com.amazonaws.pinpoint#__string", + "traits": { + "smithy.api#documentation": "

The unique identifier for the next activity to perform after the this activity.

" + } + } + } + }, "com.amazonaws.pinpoint#CreateApp": { "type": "operation", "input": { @@ -11172,6 +11189,26 @@ ] } }, + "com.amazonaws.pinpoint#JourneyChannelSettings": { + "type": "structure", + "members": { + "ConnectCampaignArn": { + "target": "com.amazonaws.pinpoint#__string", + "traits": { + "smithy.api#documentation": "

Amazon Resource Name (ARN) of the Connect Campaign.

" + } + }, + "ConnectCampaignExecutionRoleArn": { + "target": "com.amazonaws.pinpoint#__string", + "traits": { + "smithy.api#documentation": "

IAM role ARN to be assumed when invoking Connect campaign execution APIs for dialing.

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

The channel-specific configurations for the journey.

" + } + }, "com.amazonaws.pinpoint#JourneyCustomMessage": { "type": "structure", "members": { @@ -11496,6 +11533,12 @@ "traits": { "smithy.api#documentation": "

Specifies whether a journey should be refreshed on segment update.

" } + }, + "JourneyChannelSettings": { + "target": "com.amazonaws.pinpoint#JourneyChannelSettings", + "traits": { + "smithy.api#documentation": "

The channel-specific configurations for the journey.

" + } } }, "traits": { diff --git a/codegen/sdk-codegen/aws-models/sesv2.2019-09-27.json b/codegen/sdk-codegen/aws-models/sesv2.2019-09-27.json index ab8cc2875a3..632722fe4a7 100644 --- a/codegen/sdk-codegen/aws-models/sesv2.2019-09-27.json +++ b/codegen/sdk-codegen/aws-models/sesv2.2019-09-27.json @@ -145,7 +145,7 @@ "com.amazonaws.sesv2#BehaviorOnMxFailure": { "type": "string", "traits": { - "smithy.api#documentation": "

The action that you want to take if the required MX record can't be found when you\n send an email. When you set this value to UseDefaultValue, the mail is sent\n using amazonses.com as the MAIL FROM domain. When you set this\n value to RejectMessage, the Amazon SES API v2 returns a\n MailFromDomainNotVerified error, and doesn't attempt to deliver the\n email.

\n

These behaviors are taken when the custom MAIL FROM domain configuration is in the\n Pending, Failed, and TemporaryFailure\n states.

", + "smithy.api#documentation": "

The action to take if the required MX record can't be found when you send an email.\n When you set this value to UseDefaultValue, the mail is sent using\n amazonses.com as the MAIL FROM domain. When you set this value\n to RejectMessage, the Amazon SES API v2 returns a\n MailFromDomainNotVerified error, and doesn't attempt to deliver the\n email.

\n

These behaviors are taken when the custom MAIL FROM domain configuration is in the\n Pending, Failed, and TemporaryFailure\n states.

", "smithy.api#enum": [ { "value": "USE_DEFAULT_VALUE", @@ -419,7 +419,7 @@ "DimensionValueSource": { "target": "com.amazonaws.sesv2#DimensionValueSource", "traits": { - "smithy.api#documentation": "

The location where the Amazon SES API v2 finds the value of a dimension to publish to Amazon CloudWatch. If\n you want to use the message tags that you specify using an\n X-SES-MESSAGE-TAGS header or a parameter to the SendEmail\n or SendRawEmail API, choose messageTag. If you want to use\n your own email headers, choose emailHeader. If you want to use link tags,\n choose linkTags.

", + "smithy.api#documentation": "

The location where the Amazon SES API v2 finds the value of a dimension to publish to Amazon CloudWatch. To\n use the message tags that you specify using an X-SES-MESSAGE-TAGS header or\n a parameter to the SendEmail or SendRawEmail API, choose\n messageTag. To use your own email headers, choose\n emailHeader. To use link tags, choose linkTags.

", "smithy.api#required": {} } }, @@ -565,7 +565,7 @@ "ContactListImportAction": { "target": "com.amazonaws.sesv2#ContactListImportAction", "traits": { - "smithy.api#documentation": "

>The type of action that you want to perform on the addresses. Acceptable\n values:

\n ", + "smithy.api#documentation": "

>The type of action to perform on the addresses. The following are the \n possible values:

\n ", "smithy.api#required": {} } } @@ -690,7 +690,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to add an event destination to.

", + "smithy.api#documentation": "

The name of the configuration set .

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -727,7 +727,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set.

", + "smithy.api#documentation": "

The name of the configuration set. The name can contain up to 64 alphanumeric\n characters, including letters, numbers, hyphens (-) and underscores (_) only.

", "smithy.api#required": {} } }, @@ -758,7 +758,7 @@ "Tags": { "target": "com.amazonaws.sesv2#TagList", "traits": { - "smithy.api#documentation": "

An array of objects that define the tags (keys and values) that you want to associate\n with the configuration set.

" + "smithy.api#documentation": "

An array of objects that define the tags (keys and values) to associate with the\n configuration set.

" } }, "SuppressionOptions": { @@ -1031,7 +1031,7 @@ } ], "traits": { - "smithy.api#documentation": "

Create a new pool of dedicated IP addresses. A pool can include one or more dedicated\n IP addresses that are associated with your AWS account. You can associate a pool with\n a configuration set. When you send an email that uses that configuration set, the\n message is sent from one of the addresses in the associated pool.

", + "smithy.api#documentation": "

Create a new pool of dedicated IP addresses. A pool can include one or more dedicated\n IP addresses that are associated with your Amazon Web Services account. You can associate a pool with\n a configuration set. When you send an email that uses that configuration set, the\n message is sent from one of the addresses in the associated pool.

", "smithy.api#http": { "method": "POST", "uri": "/v2/email/dedicated-ip-pools", @@ -1198,7 +1198,7 @@ } ], "traits": { - "smithy.api#documentation": "

Starts the process of verifying an email identity. An identity is\n an email address or domain that you use when you send email. Before you can use an\n identity to send email, you first have to verify it. By verifying an identity, you\n demonstrate that you're the owner of the identity, and that you've given Amazon SES API v2\n permission to send email from the identity.

\n

When you verify an email address, Amazon SES sends an email to the address. Your email\n address is verified as soon as you follow the link in the verification email.\n \n

\n

When you verify a domain without specifying the DkimSigningAttributes\n object, this operation provides a set of DKIM tokens. You can convert these tokens into\n CNAME records, which you then add to the DNS configuration for your domain. Your domain\n is verified when Amazon SES detects these records in the DNS configuration for your domain.\n This verification method is known as Easy DKIM.

\n

Alternatively, you can perform the verification process by providing your own\n public-private key pair. This verification method is known as Bring Your Own DKIM\n (BYODKIM). To use BYODKIM, your call to the CreateEmailIdentity operation\n has to include the DkimSigningAttributes object. When you specify this\n object, you provide a selector (a component of the DNS record name that identifies the\n public key that you want to use for DKIM authentication) and a private key.

\n

When you verify a domain, this operation provides a set of DKIM tokens, which you can\n convert into CNAME tokens. You add these CNAME tokens to the DNS configuration for your\n domain. Your domain is verified when Amazon SES detects these records in the DNS\n configuration for your domain. For some DNS providers, it can take 72 hours or more to\n complete the domain verification process.

\n

Additionally, you can associate an existing configuration set with the email identity that you're verifying.

", + "smithy.api#documentation": "

Starts the process of verifying an email identity. An identity is\n an email address or domain that you use when you send email. Before you can use an\n identity to send email, you first have to verify it. By verifying an identity, you\n demonstrate that you're the owner of the identity, and that you've given Amazon SES API v2\n permission to send email from the identity.

\n

When you verify an email address, Amazon SES sends an email to the address. Your email\n address is verified as soon as you follow the link in the verification email.\n \n

\n

When you verify a domain without specifying the DkimSigningAttributes\n object, this operation provides a set of DKIM tokens. You can convert these tokens into\n CNAME records, which you then add to the DNS configuration for your domain. Your domain\n is verified when Amazon SES detects these records in the DNS configuration for your domain.\n This verification method is known as Easy DKIM.

\n

Alternatively, you can perform the verification process by providing your own\n public-private key pair. This verification method is known as Bring Your Own DKIM\n (BYODKIM). To use BYODKIM, your call to the CreateEmailIdentity operation\n has to include the DkimSigningAttributes object. When you specify this\n object, you provide a selector (a component of the DNS record name that identifies the\n public key to use for DKIM authentication) and a private key.

\n

When you verify a domain, this operation provides a set of DKIM tokens, which you can\n convert into CNAME tokens. You add these CNAME tokens to the DNS configuration for your\n domain. Your domain is verified when Amazon SES detects these records in the DNS\n configuration for your domain. For some DNS providers, it can take 72 hours or more to\n complete the domain verification process.

\n

Additionally, you can associate an existing configuration set with the email identity that you're verifying.

", "smithy.api#http": { "method": "POST", "uri": "/v2/email/identities", @@ -1246,7 +1246,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity for which you want to create a policy.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -1284,26 +1284,26 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email address or domain that you want to verify.

", + "smithy.api#documentation": "

The email address or domain to verify.

", "smithy.api#required": {} } }, "Tags": { "target": "com.amazonaws.sesv2#TagList", "traits": { - "smithy.api#documentation": "

An array of objects that define the tags (keys and values) that you want to associate\n with the email identity.

" + "smithy.api#documentation": "

An array of objects that define the tags (keys and values) to associate with the email\n identity.

" } }, "DkimSigningAttributes": { "target": "com.amazonaws.sesv2#DkimSigningAttributes", "traits": { - "smithy.api#documentation": "

If your request includes this object, Amazon SES configures the identity to use Bring Your\n Own DKIM (BYODKIM) for DKIM authentication purposes, as opposed to the default method,\n Easy\n DKIM.

\n

You can only specify this object if the email identity is a domain, as opposed to an\n address.

" + "smithy.api#documentation": "

If your request includes this object, Amazon SES configures the identity to use Bring Your\n Own DKIM (BYODKIM) for DKIM authentication purposes, or, configures the key length to be used for\n Easy DKIM.

\n

You can only specify this object if the email identity is a domain, as opposed to an\n address.

" } }, "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The configuration set to use by default when sending from this identity.\n Note that any configuration set defined in the email sending request takes precedence.\n

" + "smithy.api#documentation": "

The configuration set to use by default when sending from this identity. Note that any\n configuration set defined in the email sending request takes precedence.

" } } }, @@ -1317,7 +1317,7 @@ "IdentityType": { "target": "com.amazonaws.sesv2#IdentityType", "traits": { - "smithy.api#documentation": "

The email identity type.

" + "smithy.api#documentation": "

The email identity type. Note: the MANAGED_DOMAIN identity type is not\n supported.

" } }, "VerifiedForSendingStatus": { @@ -1360,7 +1360,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates an email template. Email templates enable you to send personalized email to\n one or more destinations in a single API operation. For more information, see the Amazon SES\n Developer Guide.

\n

You can execute this operation no more than once per second.

", + "smithy.api#documentation": "

Creates an email template. Email templates enable you to send personalized email to\n one or more destinations in a single API operation. For more information, see the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", "smithy.api#http": { "method": "POST", "uri": "/v2/email/templates", @@ -1374,7 +1374,7 @@ "TemplateName": { "target": "com.amazonaws.sesv2#EmailTemplateName", "traits": { - "smithy.api#documentation": "

The name of the template you want to create.

", + "smithy.api#documentation": "

The name of the template.

", "smithy.api#required": {} } }, @@ -1464,7 +1464,7 @@ "com.amazonaws.sesv2#CustomRedirectDomain": { "type": "string", "traits": { - "smithy.api#documentation": "

The domain that you want to use for tracking open and click events.

" + "smithy.api#documentation": "

The domain to use for tracking open and click events.

" } }, "com.amazonaws.sesv2#CustomVerificationEmailTemplateMetadata": { @@ -1603,7 +1603,7 @@ "target": "com.amazonaws.sesv2#DedicatedIp" }, "traits": { - "smithy.api#documentation": "

A list of dedicated IP addresses that are associated with your AWS account.

" + "smithy.api#documentation": "

A list of dedicated IP addresses that are associated with your Amazon Web Services account.

" } }, "com.amazonaws.sesv2#DefaultDimensionValue": { @@ -1677,7 +1677,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that contains the event destination that you want to\n delete.

", + "smithy.api#documentation": "

The name of the configuration set that contains the event destination to\n delete.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -1685,7 +1685,7 @@ "EventDestinationName": { "target": "com.amazonaws.sesv2#EventDestinationName", "traits": { - "smithy.api#documentation": "

The name of the event destination that you want to delete.

", + "smithy.api#documentation": "

The name of the event destination to delete.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -1708,7 +1708,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to delete.

", + "smithy.api#documentation": "

The name of the configuration set.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -1846,7 +1846,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes an existing custom verification email template.

\n

For more information about custom verification email templates, see Using Custom Verification Email Templates in the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", + "smithy.api#documentation": "

Deletes an existing custom verification email template.

\n

For more information about custom verification email templates, see Using Custom Verification Email Templates in the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", "smithy.api#http": { "method": "DELETE", "uri": "/v2/email/custom-verification-email-templates/{TemplateName}", @@ -1996,7 +1996,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity for which you want to delete a policy.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -2027,7 +2027,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The identity (that is, the email address or domain) that you want to delete.

", + "smithy.api#documentation": "

The identity (that is, the email address or domain) to delete.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -2250,7 +2250,7 @@ "SendingPoolName": { "target": "com.amazonaws.sesv2#PoolName", "traits": { - "smithy.api#documentation": "

The name of the dedicated IP pool that you want to associate with the configuration\n set.

" + "smithy.api#documentation": "

The name of the dedicated IP pool to associate with the configuration set.

" } } }, @@ -2284,7 +2284,7 @@ } }, "traits": { - "smithy.api#documentation": "

An object that describes the recipients for an email.

" + "smithy.api#documentation": "

An object that describes the recipients for an email.

\n \n

Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the\n local part of a destination email address (the part of the\n email address that precedes the @ sign) may only contain 7-bit ASCII\n characters. If the domain part of an address (the\n part after the @ sign) contains non-ASCII characters, they must be encoded using\n Punycode, as described in RFC3492.

\n
" } }, "com.amazonaws.sesv2#DimensionName": { @@ -2296,7 +2296,7 @@ "com.amazonaws.sesv2#DimensionValueSource": { "type": "string", "traits": { - "smithy.api#documentation": "

The location where the Amazon SES API v2 finds the value of a dimension to publish to Amazon CloudWatch. If\n you want to use the message tags that you specify using an\n X-SES-MESSAGE-TAGS header or a parameter to the SendEmail\n or SendRawEmail API, choose messageTag. If you want to use\n your own email headers, choose emailHeader. If you want to use link tags,\n choose linkTags.

", + "smithy.api#documentation": "

The location where the Amazon SES API v2 finds the value of a dimension to publish to Amazon CloudWatch. To\n use the message tags that you specify using an X-SES-MESSAGE-TAGS header or\n a parameter to the SendEmail or SendRawEmail API, choose\n messageTag. To use your own email headers, choose\n emailHeader. To use link tags, choose linkTags.

", "smithy.api#enum": [ { "value": "MESSAGE_TAG", @@ -2340,7 +2340,25 @@ "SigningAttributesOrigin": { "target": "com.amazonaws.sesv2#DkimSigningAttributesOrigin", "traits": { - "smithy.api#documentation": "

A string that indicates how DKIM was configured for the identity. There are two\n possible values:

\n " + "smithy.api#documentation": "

A string that indicates how DKIM was configured for the identity. These are the\n possible values:

\n " + } + }, + "NextSigningKeyLength": { + "target": "com.amazonaws.sesv2#DkimSigningKeyLength", + "traits": { + "smithy.api#documentation": "

[Easy DKIM] The key length of the future DKIM key pair to be generated. This can be changed at most once per day.

" + } + }, + "CurrentSigningKeyLength": { + "target": "com.amazonaws.sesv2#DkimSigningKeyLength", + "traits": { + "smithy.api#documentation": "

[Easy DKIM] The key length of the DKIM key pair in use.

" + } + }, + "LastKeyGenerationTimestamp": { + "target": "com.amazonaws.sesv2#Timestamp", + "traits": { + "smithy.api#documentation": "

[Easy DKIM] The last time a key pair was generated for this identity.

" } } }, @@ -2354,20 +2372,24 @@ "DomainSigningSelector": { "target": "com.amazonaws.sesv2#Selector", "traits": { - "smithy.api#documentation": "

A string that's used to identify a public key in the DNS configuration for a\n domain.

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

[Bring Your Own DKIM] A string that's used to identify a public key in the DNS configuration for a\n domain.

" } }, "DomainSigningPrivateKey": { "target": "com.amazonaws.sesv2#PrivateKey", "traits": { - "smithy.api#documentation": "

A private key that's used to generate a DKIM signature.

\n

The private key must use 1024-bit RSA encryption, and must be encoded using base64\n encoding.

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

[Bring Your Own DKIM] A private key that's used to generate a DKIM signature.

\n

The private key must use 1024 or 2048-bit RSA encryption, and must be encoded using\n base64 encoding.

" + } + }, + "NextSigningKeyLength": { + "target": "com.amazonaws.sesv2#DkimSigningKeyLength", + "traits": { + "smithy.api#documentation": "

[Easy DKIM] The key length of the future DKIM key pair to be generated. This can be changed at most once per day.

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

An object that contains information about the tokens used for setting up Bring Your\n Own DKIM (BYODKIM).

" + "smithy.api#documentation": "

An object that contains configuration for Bring Your Own DKIM (BYODKIM), or, for Easy DKIM

" } }, "com.amazonaws.sesv2#DkimSigningAttributesOrigin": { @@ -2385,6 +2407,21 @@ ] } }, + "com.amazonaws.sesv2#DkimSigningKeyLength": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "RSA_1024_BIT", + "name": "RSA_1024_BIT" + }, + { + "value": "RSA_2048_BIT", + "name": "RSA_2048_BIT" + } + ] + } + }, "com.amazonaws.sesv2#DkimStatus": { "type": "string", "traits": { @@ -2532,7 +2569,7 @@ "Domain": { "target": "com.amazonaws.sesv2#Domain", "traits": { - "smithy.api#documentation": "

A verified domain that’s associated with your AWS account and currently has an\n active Deliverability dashboard subscription.

" + "smithy.api#documentation": "

A verified domain that’s associated with your Amazon Web Services account and currently has an\n active Deliverability dashboard subscription.

" } }, "SubscriptionStartDate": { @@ -2802,7 +2839,7 @@ } }, "traits": { - "smithy.api#documentation": "

In the Amazon SES API v2, events include message sends, deliveries, opens,\n clicks, bounces, complaints and delivery delays. Event destinations are places that\n you can send information about these events to. For example, you can send event data to\n Amazon SNS to receive notifications when you receive bounces or complaints, or you can use\n Amazon Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.

" + "smithy.api#documentation": "

In the Amazon SES API v2, events include message sends, deliveries, opens,\n clicks, bounces, complaints and delivery delays. Event destinations\n are places that you can send information about these events to. For example, you can\n send event data to Amazon SNS to receive notifications when you receive bounces or\n complaints, or you can use Amazon Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.

" } }, "com.amazonaws.sesv2#EventDestinationDefinition": { @@ -2973,7 +3010,7 @@ } ], "traits": { - "smithy.api#documentation": "

Obtain information about the email-sending status and capabilities of your Amazon SES\n account in the current AWS Region.

", + "smithy.api#documentation": "

Obtain information about the email-sending status and capabilities of your Amazon SES\n account in the current Amazon Web Services Region.

", "smithy.api#http": { "method": "GET", "uri": "/v2/email/account", @@ -3006,25 +3043,25 @@ "ProductionAccessEnabled": { "target": "com.amazonaws.sesv2#Enabled", "traits": { - "smithy.api#documentation": "

Indicates whether or not your account has production access in the current AWS\n Region.

\n

If the value is false, then your account is in the\n sandbox. When your account is in the sandbox, you can only send\n email to verified identities. Additionally, the maximum number of emails you can send in\n a 24-hour period (your sending quota) is 200, and the maximum number of emails you can\n send per second (your maximum sending rate) is 1.

\n

If the value is true, then your account has production access. When your\n account has production access, you can send email to any address. The sending quota and\n maximum sending rate for your account vary based on your specific use case.

" + "smithy.api#documentation": "

Indicates whether or not your account has production access in the current Amazon Web Services\n Region.

\n

If the value is false, then your account is in the\n sandbox. When your account is in the sandbox, you can only send\n email to verified identities. Additionally, the maximum number of emails you can send in\n a 24-hour period (your sending quota) is 200, and the maximum number of emails you can\n send per second (your maximum sending rate) is 1.

\n

If the value is true, then your account has production access. When your\n account has production access, you can send email to any address. The sending quota and\n maximum sending rate for your account vary based on your specific use case.

" } }, "SendQuota": { "target": "com.amazonaws.sesv2#SendQuota", "traits": { - "smithy.api#documentation": "

An object that contains information about the per-day and per-second sending limits\n for your Amazon SES account in the current AWS Region.

" + "smithy.api#documentation": "

An object that contains information about the per-day and per-second sending limits\n for your Amazon SES account in the current Amazon Web Services Region.

" } }, "SendingEnabled": { "target": "com.amazonaws.sesv2#Enabled", "traits": { - "smithy.api#documentation": "

Indicates whether or not email sending is enabled for your Amazon SES account in the\n current AWS Region.

" + "smithy.api#documentation": "

Indicates whether or not email sending is enabled for your Amazon SES account in the\n current Amazon Web Services Region.

" } }, "SuppressionAttributes": { "target": "com.amazonaws.sesv2#SuppressionAttributes", "traits": { - "smithy.api#documentation": "

An object that contains information about the email address suppression preferences\n for your account in the current AWS Region.

" + "smithy.api#documentation": "

An object that contains information about the email address suppression preferences\n for your account in the current Amazon Web Services Region.

" } }, "Details": { @@ -3035,7 +3072,7 @@ } }, "traits": { - "smithy.api#documentation": "

A list of details about the email-sending capabilities of your Amazon SES account in the\n current AWS Region.

" + "smithy.api#documentation": "

A list of details about the email-sending capabilities of your Amazon SES account in the\n current Amazon Web Services Region.

" } }, "com.amazonaws.sesv2#GetBlacklistReports": { @@ -3189,7 +3226,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to obtain more information\n about.

", + "smithy.api#documentation": "

The name of the configuration set.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -3555,7 +3592,7 @@ "Ip": { "target": "com.amazonaws.sesv2#Ip", "traits": { - "smithy.api#documentation": "

The IP address that you want to obtain more information about. The value you specify\n has to be a dedicated IP address that's assocaited with your AWS account.

", + "smithy.api#documentation": "

The IP address that you want to obtain more information about. The value you specify\n has to be a dedicated IP address that's assocaited with your Amazon Web Services account.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -3599,7 +3636,7 @@ } ], "traits": { - "smithy.api#documentation": "

List the dedicated IP addresses that are associated with your AWS\n account.

", + "smithy.api#documentation": "

List the dedicated IP addresses that are associated with your Amazon Web Services\n account.

", "smithy.api#http": { "method": "GET", "uri": "/v2/email/dedicated-ips", @@ -3647,7 +3684,7 @@ "DedicatedIps": { "target": "com.amazonaws.sesv2#DedicatedIpList", "traits": { - "smithy.api#documentation": "

A list of dedicated IP addresses that are associated with your AWS account.

" + "smithy.api#documentation": "

A list of dedicated IP addresses that are associated with your Amazon Web Services account.

" } }, "NextToken": { @@ -3658,7 +3695,7 @@ } }, "traits": { - "smithy.api#documentation": "

Information about the dedicated IP addresses that are associated with your AWS\n account.

" + "smithy.api#documentation": "

Information about the dedicated IP addresses that are associated with your Amazon Web Services\n account.

" } }, "com.amazonaws.sesv2#GetDeliverabilityDashboardOptions": { @@ -3681,7 +3718,7 @@ } ], "traits": { - "smithy.api#documentation": "

Retrieve information about the status of the Deliverability dashboard for your account. When\n the Deliverability dashboard is enabled, you gain access to reputation, deliverability, and other\n metrics for the domains that you use to send email. You also gain the ability to perform\n predictive inbox placement tests.

\n \n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other AWS services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon SES Pricing.

", + "smithy.api#documentation": "

Retrieve information about the status of the Deliverability dashboard for your account. When\n the Deliverability dashboard is enabled, you gain access to reputation, deliverability, and other\n metrics for the domains that you use to send email. You also gain the ability to perform\n predictive inbox placement tests.

\n \n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other Amazon Web Services services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon SES Pricing.

", "smithy.api#http": { "method": "GET", "uri": "/v2/email/deliverability-dashboard", @@ -3693,7 +3730,7 @@ "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

Retrieve information about the status of the Deliverability dashboard for your AWS account.\n When the Deliverability dashboard is enabled, you gain access to reputation, deliverability, and\n other metrics for your domains. You also gain the ability to perform predictive inbox placement tests.

\n \n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other AWS services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon Pinpoint Pricing.

" + "smithy.api#documentation": "

Retrieve information about the status of the Deliverability dashboard for your Amazon Web Services account.\n When the Deliverability dashboard is enabled, you gain access to reputation, deliverability, and\n other metrics for your domains. You also gain the ability to perform predictive inbox placement tests.

\n \n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other Amazon Web Services services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon Pinpoint Pricing.

" } }, "com.amazonaws.sesv2#GetDeliverabilityDashboardOptionsResponse": { @@ -4023,7 +4060,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity that you want to retrieve policies for.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -4053,7 +4090,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity that you want to retrieve details for.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -4069,7 +4106,7 @@ "IdentityType": { "target": "com.amazonaws.sesv2#IdentityType", "traits": { - "smithy.api#documentation": "

The email identity type.

" + "smithy.api#documentation": "

The email identity type. Note: the MANAGED_DOMAIN identity type is not\n supported.

" } }, "FeedbackForwardingStatus": { @@ -4153,7 +4190,7 @@ "TemplateName": { "target": "com.amazonaws.sesv2#EmailTemplateName", "traits": { - "smithy.api#documentation": "

The name of the template you want to retrieve.

", + "smithy.api#documentation": "

The name of the template.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -4169,7 +4206,7 @@ "TemplateName": { "target": "com.amazonaws.sesv2#EmailTemplateName", "traits": { - "smithy.api#documentation": "

The name of the template you want to retrieve.

", + "smithy.api#documentation": "

The name of the template.

", "smithy.api#required": {} } }, @@ -4364,7 +4401,7 @@ "IdentityType": { "target": "com.amazonaws.sesv2#IdentityType", "traits": { - "smithy.api#documentation": "

The email identity type. The identity type can be one of the following:

\n " + "smithy.api#documentation": "

The email identity type. Note: the MANAGED_DOMAIN type is not supported\n for email identity types.

" } }, "IdentityName": { @@ -4393,7 +4430,6 @@ "com.amazonaws.sesv2#IdentityType": { "type": "string", "traits": { - "smithy.api#documentation": "

The email identity type. The identity type can be one of the following:

\n ", "smithy.api#enum": [ { "value": "EMAIL_ADDRESS", @@ -4520,7 +4556,7 @@ } }, "traits": { - "smithy.api#documentation": "

An object that contains information about the inbox placement data settings for a\n verified domain that’s associated with your AWS account. This data is available only\n if you enabled the Deliverability dashboard for the domain.

" + "smithy.api#documentation": "

An object that contains information about the inbox placement data settings for a\n verified domain that’s associated with your Amazon Web Services account. This data is available only\n if you enabled the Deliverability dashboard for the domain.

" } }, "com.amazonaws.sesv2#InvalidNextTokenException": { @@ -4709,7 +4745,7 @@ } }, "traits": { - "smithy.api#documentation": "

A request to obtain a list of configuration sets for your Amazon SES account in the current\n AWS Region.

" + "smithy.api#documentation": "

A request to obtain a list of configuration sets for your Amazon SES account in the current\n Amazon Web Services Region.

" } }, "com.amazonaws.sesv2#ListConfigurationSetsResponse": { @@ -4718,7 +4754,7 @@ "ConfigurationSets": { "target": "com.amazonaws.sesv2#ConfigurationSetNameList", "traits": { - "smithy.api#documentation": "

An array that contains all of the configuration sets in your Amazon SES account in the\n current AWS Region.

" + "smithy.api#documentation": "

An array that contains all of the configuration sets in your Amazon SES account in the\n current Amazon Web Services Region.

" } }, "NextToken": { @@ -4729,7 +4765,7 @@ } }, "traits": { - "smithy.api#documentation": "

A list of configuration sets in your Amazon SES account in the current AWS Region.

" + "smithy.api#documentation": "

A list of configuration sets in your Amazon SES account in the current Amazon Web Services Region.

" } }, "com.amazonaws.sesv2#ListContactLists": { @@ -4918,7 +4954,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists the existing custom verification email templates for your account in the current\n AWS Region.

\n

For more information about custom verification email templates, see Using Custom Verification Email Templates in the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", + "smithy.api#documentation": "

Lists the existing custom verification email templates for your account in the current\n Amazon Web Services Region.

\n

For more information about custom verification email templates, see Using Custom Verification Email Templates in the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", "smithy.api#http": { "method": "GET", "uri": "/v2/email/custom-verification-email-templates", @@ -4990,7 +5026,7 @@ } ], "traits": { - "smithy.api#documentation": "

List all of the dedicated IP pools that exist in your AWS account in the current\n Region.

", + "smithy.api#documentation": "

List all of the dedicated IP pools that exist in your Amazon Web Services account in the current\n Region.

", "smithy.api#http": { "method": "GET", "uri": "/v2/email/dedicated-ip-pools", @@ -5031,7 +5067,7 @@ "DedicatedIpPools": { "target": "com.amazonaws.sesv2#ListOfDedicatedIpPools", "traits": { - "smithy.api#documentation": "

A list of all of the dedicated IP pools that are associated with your AWS account in\n the current Region.

" + "smithy.api#documentation": "

A list of all of the dedicated IP pools that are associated with your Amazon Web Services account in\n the current Region.

" } }, "NextToken": { @@ -5238,7 +5274,7 @@ } ], "traits": { - "smithy.api#documentation": "

Returns a list of all of the email identities that are associated with your AWS\n account. An identity can be either an email address or a domain. This operation returns\n identities that are verified as well as those that aren't. This operation returns\n identities that are associated with Amazon SES and Amazon Pinpoint.

", + "smithy.api#documentation": "

Returns a list of all of the email identities that are associated with your Amazon Web Services\n account. An identity can be either an email address or a domain. This operation returns\n identities that are verified as well as those that aren't. This operation returns\n identities that are associated with Amazon SES and Amazon Pinpoint.

", "smithy.api#http": { "method": "GET", "uri": "/v2/email/identities", @@ -5270,7 +5306,7 @@ } }, "traits": { - "smithy.api#documentation": "

A request to list all of the email identities associated with your AWS account. This\n list includes identities that you've already verified, identities that are unverified,\n and identities that were verified in the past, but are no longer verified.

" + "smithy.api#documentation": "

A request to list all of the email identities associated with your Amazon Web Services account. This\n list includes identities that you've already verified, identities that are unverified,\n and identities that were verified in the past, but are no longer verified.

" } }, "com.amazonaws.sesv2#ListEmailIdentitiesResponse": { @@ -5279,7 +5315,7 @@ "EmailIdentities": { "target": "com.amazonaws.sesv2#IdentityInfoList", "traits": { - "smithy.api#documentation": "

An array that includes all of the email identities associated with your AWS\n account.

" + "smithy.api#documentation": "

An array that includes all of the email identities associated with your Amazon Web Services\n account.

" } }, "NextToken": { @@ -5310,7 +5346,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists the email templates present in your Amazon SES account in the current AWS\n Region.

\n\n

You can execute this operation no more than once per second.

", + "smithy.api#documentation": "

Lists the email templates present in your Amazon SES account in the current Amazon Web Services\n Region.

\n\n

You can execute this operation no more than once per second.

", "smithy.api#http": { "method": "GET", "uri": "/v2/email/templates", @@ -5342,7 +5378,7 @@ } }, "traits": { - "smithy.api#documentation": "

Represents a request to list the email templates present in your Amazon SES account in the\n current AWS Region. For more information, see the Amazon SES Developer\n Guide.

" + "smithy.api#documentation": "

Represents a request to list the email templates present in your Amazon SES account in the\n current Amazon Web Services Region. For more information, see the Amazon SES Developer\n Guide.

" } }, "com.amazonaws.sesv2#ListEmailTemplatesResponse": { @@ -5482,7 +5518,7 @@ "target": "com.amazonaws.sesv2#PoolName" }, "traits": { - "smithy.api#documentation": "

A list of dedicated IP pools that are associated with your AWS account.

" + "smithy.api#documentation": "

A list of dedicated IP pools that are associated with your Amazon Web Services account.

" } }, "com.amazonaws.sesv2#ListSuppressedDestinations": { @@ -5654,7 +5690,7 @@ "BehaviorOnMxFailure": { "target": "com.amazonaws.sesv2#BehaviorOnMxFailure", "traits": { - "smithy.api#documentation": "

The action that you want to take if the required MX record can't be found when you\n send an email. When you set this value to UseDefaultValue, the mail is sent\n using amazonses.com as the MAIL FROM domain. When you set this\n value to RejectMessage, the Amazon SES API v2 returns a\n MailFromDomainNotVerified error, and doesn't attempt to deliver the\n email.

\n

These behaviors are taken when the custom MAIL FROM domain configuration is in the\n Pending, Failed, and TemporaryFailure\n states.

", + "smithy.api#documentation": "

The action to take if the required MX record can't be found when you send an email.\n When you set this value to UseDefaultValue, the mail is sent using\n amazonses.com as the MAIL FROM domain. When you set this value\n to RejectMessage, the Amazon SES API v2 returns a\n MailFromDomainNotVerified error, and doesn't attempt to deliver the\n email.

\n

These behaviors are taken when the custom MAIL FROM domain configuration is in the\n Pending, Failed, and TemporaryFailure\n states.

", "smithy.api#required": {} } } @@ -5666,7 +5702,7 @@ "com.amazonaws.sesv2#MailFromDomainName": { "type": "string", "traits": { - "smithy.api#documentation": "

The domain that you want to use as a MAIL FROM domain.

" + "smithy.api#documentation": "

The domain to use as a MAIL FROM domain.

" } }, "com.amazonaws.sesv2#MailFromDomainNotVerifiedException": { @@ -5884,7 +5920,7 @@ "ApplicationArn": { "target": "com.amazonaws.sesv2#AmazonResourceName", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Amazon Pinpoint project that you want to send email\n events to.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Amazon Pinpoint project to send email events to.

" } } }, @@ -6015,7 +6051,7 @@ "AutoWarmupEnabled": { "target": "com.amazonaws.sesv2#Enabled", "traits": { - "smithy.api#documentation": "

Enables or disables the automatic warm-up feature for dedicated IP addresses that are\n associated with your Amazon SES account in the current AWS Region. Set to true\n to enable the automatic warm-up feature, or set to false to disable\n it.

" + "smithy.api#documentation": "

Enables or disables the automatic warm-up feature for dedicated IP addresses that are\n associated with your Amazon SES account in the current Amazon Web Services Region. Set to true\n to enable the automatic warm-up feature, or set to false to disable\n it.

" } } }, @@ -6097,7 +6133,7 @@ "ProductionAccessEnabled": { "target": "com.amazonaws.sesv2#EnabledWrapper", "traits": { - "smithy.api#documentation": "

Indicates whether or not your account should have production access in the current\n AWS Region.

\n

If the value is false, then your account is in the\n sandbox. When your account is in the sandbox, you can only send\n email to verified identities. Additionally, the maximum number of emails you can send in\n a 24-hour period (your sending quota) is 200, and the maximum number of emails you can\n send per second (your maximum sending rate) is 1.

\n

If the value is true, then your account has production access. When your\n account has production access, you can send email to any address. The sending quota and\n maximum sending rate for your account vary based on your specific use case.

" + "smithy.api#documentation": "

Indicates whether or not your account should have production access in the current\n Amazon Web Services Region.

\n

If the value is false, then your account is in the\n sandbox. When your account is in the sandbox, you can only send\n email to verified identities. Additionally, the maximum number of emails you can send in\n a 24-hour period (your sending quota) is 200, and the maximum number of emails you can\n send per second (your maximum sending rate) is 1.

\n

If the value is true, then your account has production access. When your\n account has production access, you can send email to any address. The sending quota and\n maximum sending rate for your account vary based on your specific use case.

" } } }, @@ -6143,7 +6179,7 @@ "SendingEnabled": { "target": "com.amazonaws.sesv2#Enabled", "traits": { - "smithy.api#documentation": "

Enables or disables your account's ability to send email. Set to true to\n enable email sending, or set to false to disable email sending.

\n \n

If AWS paused your account's ability to send email, you can't use this operation\n to resume your account's ability to send email.

\n
" + "smithy.api#documentation": "

Enables or disables your account's ability to send email. Set to true to\n enable email sending, or set to false to disable email sending.

\n \n

If Amazon Web Services paused your account's ability to send email, you can't use this operation\n to resume your account's ability to send email.

\n
" } } }, @@ -6238,7 +6274,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to associate with a dedicated IP\n pool.

", + "smithy.api#documentation": "

The name of the configuration set to associate with a dedicated IP pool.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6252,7 +6288,7 @@ "SendingPoolName": { "target": "com.amazonaws.sesv2#SendingPoolName", "traits": { - "smithy.api#documentation": "

The name of the dedicated IP pool that you want to associate with the configuration\n set.

" + "smithy.api#documentation": "

The name of the dedicated IP pool to associate with the configuration set.

" } } }, @@ -6287,7 +6323,7 @@ } ], "traits": { - "smithy.api#documentation": "

Enable or disable collection of reputation metrics for emails that you send using a\n particular configuration set in a specific AWS Region.

", + "smithy.api#documentation": "

Enable or disable collection of reputation metrics for emails that you send using a\n particular configuration set in a specific Amazon Web Services Region.

", "smithy.api#http": { "method": "PUT", "uri": "/v2/email/configuration-sets/{ConfigurationSetName}/reputation-options", @@ -6301,7 +6337,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to enable or disable reputation metric\n tracking for.

", + "smithy.api#documentation": "

The name of the configuration set.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6344,7 +6380,7 @@ } ], "traits": { - "smithy.api#documentation": "

Enable or disable email sending for messages that use a particular configuration set\n in a specific AWS Region.

", + "smithy.api#documentation": "

Enable or disable email sending for messages that use a particular configuration set\n in a specific Amazon Web Services Region.

", "smithy.api#http": { "method": "PUT", "uri": "/v2/email/configuration-sets/{ConfigurationSetName}/sending", @@ -6358,7 +6394,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to enable or disable email sending\n for.

", + "smithy.api#documentation": "

The name of the configuration set to enable or disable email sending for.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6415,7 +6451,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to change the suppression list\n preferences for.

", + "smithy.api#documentation": "

The name of the configuration set to change the suppression list preferences\n for.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6423,7 +6459,7 @@ "SuppressedReasons": { "target": "com.amazonaws.sesv2#SuppressionListReasons", "traits": { - "smithy.api#documentation": "

A list that contains the reasons that email addresses are automatically added to the\n suppression list for your account. This list can contain any or all of the\n following:

\n " + "smithy.api#documentation": "

A list that contains the reasons that email addresses are automatically added to the\n suppression list for your account. This list can contain any or all of the\n following:

\n " } } }, @@ -6472,7 +6508,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to add a custom tracking domain\n to.

", + "smithy.api#documentation": "

The name of the configuration set.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6480,7 +6516,7 @@ "CustomRedirectDomain": { "target": "com.amazonaws.sesv2#CustomRedirectDomain", "traits": { - "smithy.api#documentation": "

The domain that you want to use to track open and click events.

" + "smithy.api#documentation": "

The domain to use to track open and click events.

" } } }, @@ -6515,7 +6551,7 @@ } ], "traits": { - "smithy.api#documentation": "

Move a dedicated IP address to an existing dedicated IP pool.

\n \n

The dedicated IP address that you specify must already exist, and must be\n associated with your AWS account.\n \n

\n

The dedicated IP pool you specify must already exist. You can create a new pool by\n using the CreateDedicatedIpPool operation.

\n\n
", + "smithy.api#documentation": "

Move a dedicated IP address to an existing dedicated IP pool.

\n \n

The dedicated IP address that you specify must already exist, and must be\n associated with your Amazon Web Services account.\n \n

\n

The dedicated IP pool you specify must already exist. You can create a new pool by\n using the CreateDedicatedIpPool operation.

\n\n
", "smithy.api#http": { "method": "PUT", "uri": "/v2/email/dedicated-ips/{Ip}/pool", @@ -6529,7 +6565,7 @@ "Ip": { "target": "com.amazonaws.sesv2#Ip", "traits": { - "smithy.api#documentation": "

The IP address that you want to move to the dedicated IP pool. The value you specify\n has to be a dedicated IP address that's associated with your AWS account.

", + "smithy.api#documentation": "

The IP address that you want to move to the dedicated IP pool. The value you specify\n has to be a dedicated IP address that's associated with your Amazon Web Services account.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6637,7 +6673,7 @@ } ], "traits": { - "smithy.api#documentation": "

Enable or disable the Deliverability dashboard. When you enable the Deliverability dashboard, you gain\n access to reputation, deliverability, and other metrics for the domains that you use to\n send email. You also gain the ability to perform predictive inbox placement tests.

\n \n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other AWS services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon SES Pricing.

", + "smithy.api#documentation": "

Enable or disable the Deliverability dashboard. When you enable the Deliverability dashboard, you gain\n access to reputation, deliverability, and other metrics for the domains that you use to\n send email. You also gain the ability to perform predictive inbox placement tests.

\n \n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other Amazon Web Services services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon SES Pricing.

", "smithy.api#http": { "method": "PUT", "uri": "/v2/email/deliverability-dashboard", @@ -6663,7 +6699,7 @@ } }, "traits": { - "smithy.api#documentation": "

Enable or disable the Deliverability dashboard. When you enable the Deliverability dashboard, you gain\n access to reputation, deliverability, and other metrics for the domains that you use to\n send email using Amazon SES API v2. You also gain the ability to perform predictive inbox placement tests.

\n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other AWS services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon Pinpoint Pricing.

" + "smithy.api#documentation": "

Enable or disable the Deliverability dashboard. When you enable the Deliverability dashboard, you gain\n access to reputation, deliverability, and other metrics for the domains that you use to\n send email using Amazon SES API v2. You also gain the ability to perform predictive inbox placement tests.

\n

When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition\n to any other fees that you accrue by using Amazon SES and other Amazon Web Services services. For more\n information about the features and cost of a Deliverability dashboard subscription, see Amazon Pinpoint Pricing.

" } }, "com.amazonaws.sesv2#PutDeliverabilityDashboardOptionResponse": { @@ -6707,7 +6743,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email address or domain that you want to associate with a configuration set.

", + "smithy.api#documentation": "

The email address or domain to associate with a configuration set.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6715,7 +6751,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The configuration set that you want to associate with an email identity.

" + "smithy.api#documentation": "

The configuration set to associate with an email identity.

" } } }, @@ -6727,7 +6763,7 @@ "type": "structure", "members": {}, "traits": { - "smithy.api#documentation": "

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

" + "smithy.api#documentation": "

If the action is successful, the service sends back an HTTP 200 response with an empty\n HTTP body.

" } }, "com.amazonaws.sesv2#PutEmailIdentityDkimAttributes": { @@ -6764,7 +6800,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity that you want to change the DKIM settings for.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6807,7 +6843,7 @@ } ], "traits": { - "smithy.api#documentation": "

Used to configure or change the DKIM authentication settings for an email domain\n identity. You can use this operation to do any of the following:

\n ", + "smithy.api#documentation": "

Used to configure or change the DKIM authentication settings for an email domain\n identity. You can use this operation to do any of the following:

\n ", "smithy.api#http": { "method": "PUT", "uri": "/v1/email/identities/{EmailIdentity}/dkim/signing", @@ -6821,7 +6857,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity that you want to configure DKIM for.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6829,14 +6865,14 @@ "SigningAttributesOrigin": { "target": "com.amazonaws.sesv2#DkimSigningAttributesOrigin", "traits": { - "smithy.api#documentation": "

The method that you want to use to configure DKIM for the identity. There are two\n possible values:

\n ", + "smithy.api#documentation": "

The method to use to configure DKIM for the identity. There are the following possible\n values:

\n ", "smithy.api#required": {} } }, "SigningAttributes": { "target": "com.amazonaws.sesv2#DkimSigningAttributes", "traits": { - "smithy.api#documentation": "

An object that contains information about the private key and selector that you want\n to use to configure DKIM for the identity. This object is only required if you want to\n configure Bring Your Own DKIM (BYODKIM) for the identity.

" + "smithy.api#documentation": "

An object that contains information about the private key and selector that you want\n to use to configure DKIM for the identity for Bring Your Own DKIM (BYODKIM) for the identity, or,\n configures the key length to be used for\n Easy DKIM.

" } } }, @@ -6898,7 +6934,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity that you want to configure bounce and complaint feedback forwarding\n for.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6955,7 +6991,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The verified email identity that you want to set up the custom MAIL FROM domain\n for.

", + "smithy.api#documentation": "

The verified email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -6969,7 +7005,7 @@ "BehaviorOnMxFailure": { "target": "com.amazonaws.sesv2#BehaviorOnMxFailure", "traits": { - "smithy.api#documentation": "

The action that you want to take if the required MX record isn't found when you send\n an email. When you set this value to UseDefaultValue, the mail is sent\n using amazonses.com as the MAIL FROM domain. When you set this\n value to RejectMessage, the Amazon SES API v2 returns a\n MailFromDomainNotVerified error, and doesn't attempt to deliver the\n email.

\n

These behaviors are taken when the custom MAIL FROM domain configuration is in the\n Pending, Failed, and TemporaryFailure\n states.

" + "smithy.api#documentation": "

The action to take if the required MX record isn't found when you send an email. When\n you set this value to UseDefaultValue, the mail is sent using\n amazonses.com as the MAIL FROM domain. When you set this value\n to RejectMessage, the Amazon SES API v2 returns a\n MailFromDomainNotVerified error, and doesn't attempt to deliver the\n email.

\n

These behaviors are taken when the custom MAIL FROM domain configuration is in the\n Pending, Failed, and TemporaryFailure\n states.

" } } }, @@ -7128,7 +7164,7 @@ } }, "traits": { - "smithy.api#documentation": "

Enable or disable collection of reputation metrics for emails that you send using this\n configuration set in the current AWS Region.

" + "smithy.api#documentation": "

Enable or disable collection of reputation metrics for emails that you send using this\n configuration set in the current Amazon Web Services Region.

" } }, "com.amazonaws.sesv2#ReviewDetails": { @@ -7240,7 +7276,7 @@ "FromEmailAddress": { "target": "com.amazonaws.sesv2#EmailAddress", "traits": { - "smithy.api#documentation": "

The email address that you want to use as the \"From\" address for the email. The\n address that you specify has to be verified.

" + "smithy.api#documentation": "

The email address to use as the \"From\" address for the email. The\n address that you specify has to be verified.

" } }, "FromEmailAddressIdentityArn": { @@ -7290,7 +7326,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to use when sending the email.

" + "smithy.api#documentation": "

The name of the configuration set to use when sending the email.

" } } }, @@ -7304,6 +7340,7 @@ "BulkEmailEntryResults": { "target": "com.amazonaws.sesv2#BulkEmailEntryResultList", "traits": { + "smithy.api#documentation": "

One object per intended recipient. Check each response object and retry any messages\n with a failure status.

", "smithy.api#required": {} } } @@ -7344,7 +7381,7 @@ } ], "traits": { - "smithy.api#documentation": "

Adds an email address to the list of identities for your Amazon SES account in the current\n AWS Region and attempts to verify it. As a result of executing this operation, a\n customized verification email is sent to the specified address.

\n

To use this operation, you must first create a custom verification email template. For\n more information about creating and using custom verification email templates, see\n Using Custom Verification Email Templates in the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", + "smithy.api#documentation": "

Adds an email address to the list of identities for your Amazon SES account in the current\n Amazon Web Services Region and attempts to verify it. As a result of executing this operation, a\n customized verification email is sent to the specified address.

\n

To use this operation, you must first create a custom verification email template. For\n more information about creating and using custom verification email templates, see\n Using Custom Verification Email Templates in the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", "smithy.api#http": { "method": "POST", "uri": "/v2/email/outbound-custom-verification-emails", @@ -7429,7 +7466,7 @@ } ], "traits": { - "smithy.api#documentation": "

Sends an email message. You can use the Amazon SES API v2 to send two types of\n messages:

\n ", + "smithy.api#documentation": "

Sends an email message. You can use the Amazon SES API v2 to send the following types of\n messages:

\n ", "smithy.api#http": { "method": "POST", "uri": "/v2/email/outbound-emails", @@ -7443,7 +7480,7 @@ "FromEmailAddress": { "target": "com.amazonaws.sesv2#EmailAddress", "traits": { - "smithy.api#documentation": "

The email address that you want to use as the \"From\" address for the email. The\n address that you specify has to be verified.\n

" + "smithy.api#documentation": "

The email address to use as the \"From\" address for the email. The\n address that you specify has to be verified.\n

" } }, "FromEmailAddressIdentityArn": { @@ -7492,7 +7529,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that you want to use when sending the email.

" + "smithy.api#documentation": "

The name of the configuration set to use when sending the email.

" } }, "ListManagementOptions": { @@ -7526,24 +7563,24 @@ "Max24HourSend": { "target": "com.amazonaws.sesv2#Max24HourSend", "traits": { - "smithy.api#documentation": "

The maximum number of emails that you can send in the current AWS Region over a\n 24-hour period. This value is also called your sending\n quota.

" + "smithy.api#documentation": "

The maximum number of emails that you can send in the current Amazon Web Services Region over a\n 24-hour period. This value is also called your sending\n quota.

" } }, "MaxSendRate": { "target": "com.amazonaws.sesv2#MaxSendRate", "traits": { - "smithy.api#documentation": "

The maximum number of emails that you can send per second in the current AWS Region.\n This value is also called your maximum sending rate or your\n maximum TPS (transactions per second) rate.

" + "smithy.api#documentation": "

The maximum number of emails that you can send per second in the current Amazon Web Services Region.\n This value is also called your maximum sending rate or your\n maximum TPS (transactions per second) rate.

" } }, "SentLast24Hours": { "target": "com.amazonaws.sesv2#SentLast24Hours", "traits": { - "smithy.api#documentation": "

The number of emails sent from your Amazon SES account in the current AWS Region over the\n past 24 hours.

" + "smithy.api#documentation": "

The number of emails sent from your Amazon SES account in the current Amazon Web Services Region over the\n past 24 hours.

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

An object that contains information about the per-day and per-second sending limits\n for your Amazon SES account in the current AWS Region.

" + "smithy.api#documentation": "

An object that contains information about the per-day and per-second sending limits\n for your Amazon SES account in the current Amazon Web Services Region.

" } }, "com.amazonaws.sesv2#SendingOptions": { @@ -7557,7 +7594,7 @@ } }, "traits": { - "smithy.api#documentation": "

Used to enable or disable email sending for messages that use this configuration set\n in the current AWS Region.

" + "smithy.api#documentation": "

Used to enable or disable email sending for messages that use this configuration set\n in the current Amazon Web Services Region.

" } }, "com.amazonaws.sesv2#SendingPausedException": { @@ -7576,7 +7613,7 @@ "com.amazonaws.sesv2#SendingPoolName": { "type": "string", "traits": { - "smithy.api#documentation": "

The name of the dedicated IP pool that you want to associate with the configuration\n set.

" + "smithy.api#documentation": "

The name of the dedicated IP pool to associate with the configuration set.

" } }, "com.amazonaws.sesv2#SentLast24Hours": { @@ -7842,7 +7879,7 @@ "name": "ses" }, "aws.protocols#restJson1": {}, - "smithy.api#documentation": "Amazon SES API v2\n

Welcome to the Amazon SES API v2 Reference. This guide provides information about the Amazon SES API v2,\n including supported operations, data types, parameters, and schemas.

\n

\n Amazon SES is an AWS service that\n you can use to send email messages to your customers.

\n

If you're new to Amazon SES API v2, you might find it helpful to also review the Amazon Simple Email Service Developer\n Guide. The Amazon SES Developer Guide provides information\n and code samples that demonstrate how to use Amazon SES API v2 features programmatically.

\n

The Amazon SES API v2 is available in several AWS Regions and it provides an endpoint for each\n of these Regions. For a list of all the Regions and endpoints where the API is currently\n available, see AWS Service Endpoints in the Amazon Web Services General Reference. To\n learn more about AWS Regions, see Managing AWS Regions in the\n Amazon Web Services General Reference.

\n

In each Region, AWS maintains multiple Availability Zones. These Availability Zones\n are physically isolated from each other, but are united by private, low-latency,\n high-throughput, and highly redundant network connections. These Availability Zones\n enable us to provide very high levels of availability and redundancy, while also\n minimizing latency. To learn more about the number of Availability Zones that are\n available in each Region, see AWS Global Infrastructure.

", + "smithy.api#documentation": "Amazon SES API v2\n \n

\n Amazon SES is an Amazon Web Services service that\n you can use to send email messages to your customers.

\n

If you're new to Amazon SES API v2, you might find it helpful to review the Amazon Simple Email Service Developer\n Guide. The Amazon SES Developer Guide provides information\n and code samples that demonstrate how to use Amazon SES API v2 features programmatically.

", "smithy.api#title": "Amazon Simple Email Service" } }, @@ -7852,7 +7889,7 @@ "TopicArn": { "target": "com.amazonaws.sesv2#AmazonResourceName", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Amazon SNS topic that you want to publish email\n events to. For more information about Amazon SNS topics, see the Amazon SNS Developer\n Guide.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Amazon SNS topic to publish email events to. For\n more information about Amazon SNS topics, see the Amazon SNS Developer Guide.

", "smithy.api#required": {} } } @@ -7986,7 +8023,7 @@ } }, "traits": { - "smithy.api#documentation": "

An object that contains information about the email address suppression preferences\n for your account in the current AWS Region.

" + "smithy.api#documentation": "

An object that contains information about the email address suppression preferences\n for your account in the current Amazon Web Services Region.

" } }, "com.amazonaws.sesv2#SuppressionListDestination": { @@ -7995,7 +8032,7 @@ "SuppressionListImportAction": { "target": "com.amazonaws.sesv2#SuppressionListImportAction", "traits": { - "smithy.api#documentation": "

The type of action that you want to perform on the address. Acceptable values:

\n ", + "smithy.api#documentation": "

The type of action to perform on the address. The following are possible values:

\n ", "smithy.api#required": {} } } @@ -8007,7 +8044,7 @@ "com.amazonaws.sesv2#SuppressionListImportAction": { "type": "string", "traits": { - "smithy.api#documentation": "

The type of action that you want to perform on the address. Acceptable values:

\n ", + "smithy.api#documentation": "

The type of action to perform on the address. The following are possible values:

\n ", "smithy.api#enum": [ { "value": "DELETE", @@ -8075,7 +8112,7 @@ } }, "traits": { - "smithy.api#documentation": "

An object that defines the tags that are associated with a resource.\n A tag is a label that you optionally define and associate with\n a resource. Tags can help you categorize and manage resources in different ways, such as\n by purpose, owner, environment, or other criteria. A resource can have as many as 50\n tags.

\n

Each tag consists of a required tag key and an\n associated tag value, both of which you define. A tag key is a\n general label that acts as a category for a more specific tag value. A tag value acts as\n a descriptor within a tag key. A tag key can contain as many as 128 characters. A tag\n value can contain as many as 256 characters. The characters can be Unicode letters,\n digits, white space, or one of the following symbols: _ . : / = + -. The following\n additional restrictions apply to tags:

\n " + "smithy.api#documentation": "

An object that defines the tags that are associated with a resource.\n A tag is a label that you optionally define and associate with\n a resource. Tags can help you categorize and manage resources in different ways, such as\n by purpose, owner, environment, or other criteria. A resource can have as many as 50\n tags.

\n

Each tag consists of a required tag key and an\n associated tag value, both of which you define. A tag key is a\n general label that acts as a category for a more specific tag value. A tag value acts as\n a descriptor within a tag key. A tag key can contain as many as 128 characters. A tag\n value can contain as many as 256 characters. The characters can be Unicode letters,\n digits, white space, or one of the following symbols: _ . : / = + -. The following\n additional restrictions apply to tags:

\n " } }, "com.amazonaws.sesv2#TagKey": { @@ -8216,7 +8253,7 @@ "TemplateName": { "target": "com.amazonaws.sesv2#EmailTemplateName", "traits": { - "smithy.api#documentation": "

The name of the template that you want to render.

", + "smithy.api#documentation": "

The name of the template.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -8378,13 +8415,13 @@ "CustomRedirectDomain": { "target": "com.amazonaws.sesv2#CustomRedirectDomain", "traits": { - "smithy.api#documentation": "

The domain that you want to use for tracking open and click events.

", + "smithy.api#documentation": "

The domain to use for tracking open and click events.

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

An object that defines the tracking options for a configuration set. When you use the\n Amazon SES API v2 to send an email, it contains an invisible image that's used to track when\n recipients open your email. If your email contains links, those links are changed\n slightly in order to track when recipients click them.

\n

These images and links include references to a domain operated by AWS. You can\n optionally configure the Amazon SES to use a domain that you operate for these images and\n links.

" + "smithy.api#documentation": "

An object that defines the tracking options for a configuration set. When you use the\n Amazon SES API v2 to send an email, it contains an invisible image that's used to track when\n recipients open your email. If your email contains links, those links are changed\n slightly in order to track when recipients click them.

\n

These images and links include references to a domain operated by Amazon Web Services. You can\n optionally configure the Amazon SES to use a domain that you operate for these images and\n links.

" } }, "com.amazonaws.sesv2#UnsubscribeAll": { @@ -8480,7 +8517,7 @@ "ConfigurationSetName": { "target": "com.amazonaws.sesv2#ConfigurationSetName", "traits": { - "smithy.api#documentation": "

The name of the configuration set that contains the event destination that you want to\n modify.

", + "smithy.api#documentation": "

The name of the configuration set that contains the event destination to\n modify.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -8488,7 +8525,7 @@ "EventDestinationName": { "target": "com.amazonaws.sesv2#EventDestinationName", "traits": { - "smithy.api#documentation": "

The name of the event destination that you want to modify.

", + "smithy.api#documentation": "

The name of the event destination.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -8766,7 +8803,7 @@ "EmailIdentity": { "target": "com.amazonaws.sesv2#Identity", "traits": { - "smithy.api#documentation": "

The email identity for which you want to update policy.

", + "smithy.api#documentation": "

The email identity.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -8818,7 +8855,7 @@ } ], "traits": { - "smithy.api#documentation": "

Updates an email template. Email templates enable you to send personalized email to\n one or more destinations in a single API operation. For more information, see the Amazon SES\n Developer Guide.

\n

You can execute this operation no more than once per second.

", + "smithy.api#documentation": "

Updates an email template. Email templates enable you to send personalized email to\n one or more destinations in a single API operation. For more information, see the Amazon SES Developer\n Guide.

\n

You can execute this operation no more than once per second.

", "smithy.api#http": { "method": "PUT", "uri": "/v2/email/templates/{TemplateName}", @@ -8832,7 +8869,7 @@ "TemplateName": { "target": "com.amazonaws.sesv2#EmailTemplateName", "traits": { - "smithy.api#documentation": "

The name of the template you want to update.

", + "smithy.api#documentation": "

The name of the template.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -8931,7 +8968,7 @@ "min": 1, "max": 1000 }, - "smithy.api#pattern": "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?", + "smithy.api#pattern": "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$", "smithy.api#sensitive": {} } } diff --git a/codegen/sdk-codegen/aws-models/transfer.2018-11-05.json b/codegen/sdk-codegen/aws-models/transfer.2018-11-05.json index 6d83acec6f0..041de3a5edb 100644 --- a/codegen/sdk-codegen/aws-models/transfer.2018-11-05.json +++ b/codegen/sdk-codegen/aws-models/transfer.2018-11-05.json @@ -170,7 +170,7 @@ "HomeDirectoryMappings": { "target": "com.amazonaws.transfer#HomeDirectoryMappings", "traits": { - "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n

The following is an Entry and Target pair example.

\n

\n [ { \"Entry\": \"your-personal-report.pdf\", \"Target\": \"/bucket3/customized-reports/${transfer:UserName}.pdf\" } ]\n

\n

In most cases, you can use this value instead of the session policy to lock down your\n user to the designated home directory (\"chroot\"). To do this, you can set\n Entry to / and set Target to the\n HomeDirectory parameter value.

\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" + "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n

The following is an Entry and Target pair example.

\n

\n [ { \"Entry\": \"/directory1\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n

In most cases, you can use this value instead of the session policy to lock down your\n user to the designated home directory (\"chroot\"). To do this, you can set\n Entry to / and set Target to the\n HomeDirectory parameter value.

\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" } }, "Policy": { @@ -395,7 +395,7 @@ "HomeDirectoryMappings": { "target": "com.amazonaws.transfer#HomeDirectoryMappings", "traits": { - "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n\n

The following is an Entry and Target pair example.

\n\n

\n [ { \"Entry\": \"your-personal-report.pdf\", \"Target\":\n \"/bucket3/customized-reports/${transfer:UserName}.pdf\" } ]\n

\n\n

In most cases, you can use this value instead of the session policy to lock your user\n down to the designated home directory (\"chroot\"). To do this, you can set\n Entry to / and set Target to the HomeDirectory\n parameter value.

\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" + "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n\n

The following is an Entry and Target pair example.

\n\n

\n [ { \"Entry\": \"/directory1\", \"Target\":\n \"/bucket_name/home/mydirectory\" } ]\n

\n\n

In most cases, you can use this value instead of the session policy to lock your user\n down to the designated home directory (\"chroot\"). To do this, you can set\n Entry to / and set Target to the HomeDirectory\n parameter value.

\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" } }, "Policy": { @@ -508,14 +508,14 @@ "Steps": { "target": "com.amazonaws.transfer#WorkflowSteps", "traits": { - "smithy.api#documentation": "

Specifies the details for the steps that are in the specified workflow.

\n

\n The TYPE specifies which of the following actions is being taken for this step.\n

\n \n

\n For file location, you specify either the S3 bucket and key, or the EFS filesystem ID and path.\n

", + "smithy.api#documentation": "

Specifies the details for the steps that are in the specified workflow.

\n

\n The TYPE specifies which of the following actions is being taken for this step.\n

\n \n \n

\n Currently, copying and tagging are supported only on S3.\n

\n
\n

\n For file location, you specify either the S3 bucket and key, or the EFS filesystem ID and path.\n

", "smithy.api#required": {} } }, "OnExceptionSteps": { "target": "com.amazonaws.transfer#WorkflowSteps", "traits": { - "smithy.api#documentation": "

Specifies the steps (actions) to take if any errors are encountered during execution of the workflow.

" + "smithy.api#documentation": "

Specifies the steps (actions) to take if errors are encountered during execution of the workflow.

\n \n

For custom steps, the lambda function needs to send FAILURE to the call\n back API to kick off the exception steps. Additionally, if the lambda does not send\n SUCCESS before it times out, the exception steps are executed.

\n
" } }, "Tags": { @@ -745,7 +745,7 @@ } }, "traits": { - "smithy.api#documentation": "

The name of the step, used to identify the step that is being deleted.

" + "smithy.api#documentation": "

The name of the step, used to identify the delete step.

" } }, "com.amazonaws.transfer#DeleteUser": { @@ -1520,7 +1520,7 @@ "OnExceptionSteps": { "target": "com.amazonaws.transfer#WorkflowSteps", "traits": { - "smithy.api#documentation": "

Specifies the steps (actions) to take if any errors are encountered during execution of the workflow.

" + "smithy.api#documentation": "

Specifies the steps (actions) to take if errors are encountered during execution of the workflow.

" } }, "WorkflowId": { @@ -1582,7 +1582,7 @@ } }, "traits": { - "smithy.api#documentation": "

Specifies the details for the file location for the file being used in the workflow. Only applicable if you are using Amazon EFS for storage.

\n

\n You need to provide the file system ID and the pathname.\n The pathname can represent either a path or a file.\n This is determined by whether or not you end the path value with the forward slash (/) character.\n If the final character is \"/\", then your file is copied to the folder, and its name does not change.\n If, rather, the final character is alphanumeric, your uploaded file is renamed to the path value. In this case, if a file with that name already exists, it is overwritten.\n

\n

For example, if your path is shared-files/bob/, your uploaded files are copied to the shared-files/bob/, folder.\n If your path is shared-files/today, each uploaded file is copied to the shared-files folder and named today:\n each upload overwrites the previous version of the bob file.

" + "smithy.api#documentation": "

Reserved for future use.

\n

\n \n

" } }, "com.amazonaws.transfer#EfsFileSystemId": { @@ -1720,7 +1720,7 @@ "OnExceptionSteps": { "target": "com.amazonaws.transfer#ExecutionStepResults", "traits": { - "smithy.api#documentation": "

Specifies the steps (actions) to take if any errors are encountered during execution of the workflow.

" + "smithy.api#documentation": "

Specifies the steps (actions) to take if errors are encountered during execution of the workflow.

" } } }, @@ -2042,7 +2042,7 @@ "EfsFileLocation": { "target": "com.amazonaws.transfer#EfsFileLocation", "traits": { - "smithy.api#documentation": "

Specifies the details for the Amazon EFS file being copied.

" + "smithy.api#documentation": "

Reserved for future use.

" } } }, @@ -3182,7 +3182,7 @@ } }, "traits": { - "smithy.api#documentation": "

Specifies the details for the file location for the file being used in the workflow. Only applicable if you are using S3 storage.

\n

\n You need to provide the bucket and key.\n The key can represent either a path or a file.\n This is determined by whether or not you end the key value with the forward slash (/) character.\n If the final character is \"/\", then your file is copied to the folder, and its name does not change.\n If, rather, the final character is alphanumeric, your uploaded file is renamed to the path value. In this case, if a file with that name already exists, it is overwritten.\n

\n

For example, if your path is shared-files/bob/, your uploaded files are copied to the shared-files/bob/, folder.\n If your path is shared-files/today, each uploaded file is copied to the shared-files folder and named today:\n each upload overwrites the previous version of the bob file.

" + "smithy.api#documentation": "

Specifies the details for the file location for the file being used in the workflow. Only applicable if you are using S3 storage.

" } }, "com.amazonaws.transfer#S3InputFileLocation": { @@ -3191,7 +3191,7 @@ "Bucket": { "target": "com.amazonaws.transfer#S3Bucket", "traits": { - "smithy.api#documentation": "

Specifies the S3 bucket that contains the file being copied.

" + "smithy.api#documentation": "

Specifies the S3 bucket for the customer input file.

" } }, "Key": { @@ -3202,7 +3202,7 @@ } }, "traits": { - "smithy.api#documentation": "

Specifies the details for the S3 file being copied.

" + "smithy.api#documentation": "

Specifies the customer input S3 file location. If it is used inside copyStepDetails.DestinationFileLocation, it should be the S3 copy destination.

\n

\n You need to provide the bucket and key.\n The key can represent either a path or a file.\n This is determined by whether or not you end the key value with the forward slash (/) character.\n If the final character is \"/\", then your file is copied to the folder, and its name does not change.\n If, rather, the final character is alphanumeric, your uploaded file is renamed to the path value. In this case, if a file with that name already exists, it is overwritten.\n

\n

For example, if your path is shared-files/bob/, your uploaded files are copied to the shared-files/bob/, folder.\n If your path is shared-files/today, each uploaded file is copied to the shared-files folder and named today:\n each upload overwrites the previous version of the bob file.

" } }, "com.amazonaws.transfer#S3Key": { @@ -4110,7 +4110,7 @@ "HomeDirectoryMappings": { "target": "com.amazonaws.transfer#HomeDirectoryMappings", "traits": { - "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n

The following is an Entry and Target pair example.

\n

\n [ { \"Entry\": \"your-personal-report.pdf\", \"Target\": \"/bucket3/customized-reports/${transfer:UserName}.pdf\" } ]\n

\n

In most cases, you can use this value instead of the session policy to lock down your\n user to the designated home directory (\"chroot\"). To do this, you can set\n Entry to / and set Target to the\n HomeDirectory parameter value.

\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" + "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n

The following is an Entry and Target pair example.

\n

\n [ { \"Entry\": \"/directory1\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n

In most cases, you can use this value instead of the session policy to lock down your\n user to the designated home directory (\"chroot\"). To do this, you can set\n Entry to / and set Target to the\n HomeDirectory parameter value.

\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" } }, "Policy": { @@ -4332,7 +4332,7 @@ "HomeDirectoryMappings": { "target": "com.amazonaws.transfer#HomeDirectoryMappings", "traits": { - "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n\n

The following is an Entry and Target pair example.

\n

\n [ { \"Entry\": \"your-personal-report.pdf\", \"Target\":\n \"/bucket3/customized-reports/${transfer:UserName}.pdf\" } ]\n

\n\n

In most cases, you can use this value instead of the session policy to lock down your\n user to the designated home directory (\"chroot\"). To do this, you can set\n Entry to '/' and set Target to the HomeDirectory\n parameter value.

\n\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" + "smithy.api#documentation": "

Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should\n be visible to your user and how you want to make them visible. You must specify the\n Entry and Target pair, where Entry shows how the path\n is made visible and Target is the actual Amazon S3 or Amazon EFS path. If you\n only specify a target, it is displayed as is. You also must ensure that your Amazon Web Services Identity\n and Access Management (IAM) role provides access to paths in Target. This value\n can only be set when HomeDirectoryType is set to\n LOGICAL.

\n\n

The following is an Entry and Target pair example.

\n

\n [ { \"Entry\": \"/directory1\", \"Target\":\n \"/bucket_name/home/mydirectory\" } ]\n

\n\n

In most cases, you can use this value instead of the session policy to lock down your\n user to the designated home directory (\"chroot\"). To do this, you can set\n Entry to '/' and set Target to the HomeDirectory\n parameter value.

\n\n

The following is an Entry and Target pair example for chroot.

\n

\n [ { \"Entry:\": \"/\", \"Target\": \"/bucket_name/home/mydirectory\" } ]\n

\n \n \n

If the target of a logical directory entry does not exist in Amazon S3 or EFS, the entry is\n ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0 byte objects as place\n holders for your directory. If using the CLI, use the s3api or efsapi call instead of\n s3 or efs so you can use the put-object operation. For example, you use the\n following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make\n sure that the end of the key name ends in a / for it to be considered a folder.

\n
" } }, "Policy": { @@ -4536,7 +4536,7 @@ "CopyStepDetails": { "target": "com.amazonaws.transfer#CopyStepDetails", "traits": { - "smithy.api#documentation": "

Details for a step that performs a file copy.

\n

\n Consists of the following values:\n

\n " + "smithy.api#documentation": "

Details for a step that performs a file copy.

\n

\n Consists of the following values:\n

\n " } }, "CustomStepDetails": { @@ -4548,7 +4548,7 @@ "DeleteStepDetails": { "target": "com.amazonaws.transfer#DeleteStepDetails", "traits": { - "smithy.api#documentation": "

You need to specify the name of the file to be deleted.

" + "smithy.api#documentation": "

Details for a step that deletes the file.

" } }, "TagStepDetails": { diff --git a/codegen/sdk-codegen/aws-models/voiceid.2021-09-27.json b/codegen/sdk-codegen/aws-models/voiceid.2021-09-27.json new file mode 100644 index 00000000000..c0c33f87894 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/voiceid.2021-09-27.json @@ -0,0 +1,3194 @@ +{ + "smithy": "1.0", + "shapes": { + "com.amazonaws.voiceid#AccessDeniedException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.voiceid#String" + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient permissions to perform this action. Check the error message and try \n again.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.voiceid#AmazonResourceName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1011 + }, + "smithy.api#pattern": "^arn:aws(-[^:]+)?:voiceid.+:[0-9]{12}:domain/[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#Arn": { + "type": "string", + "traits": { + "smithy.api#pattern": "^arn:aws(-[^:]+)?:voiceid.+:[0-9]{12}:domain/[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#AuthenticationConfiguration": { + "type": "structure", + "members": { + "AcceptanceThreshold": { + "target": "com.amazonaws.voiceid#Score", + "traits": { + "smithy.api#documentation": "

The minimum threshold needed to successfully authenticate a speaker.

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

The configuration used to authenticate a speaker during a session.

" + } + }, + "com.amazonaws.voiceid#AuthenticationDecision": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ACCEPT", + "name": "ACCEPT" + }, + { + "value": "REJECT", + "name": "REJECT" + }, + { + "value": "NOT_ENOUGH_SPEECH", + "name": "NOT_ENOUGH_SPEECH" + }, + { + "value": "SPEAKER_NOT_ENROLLED", + "name": "SPEAKER_NOT_ENROLLED" + }, + { + "value": "SPEAKER_OPTED_OUT", + "name": "SPEAKER_OPTED_OUT" + }, + { + "value": "SPEAKER_ID_NOT_PROVIDED", + "name": "SPEAKER_ID_NOT_PROVIDED" + } + ] + } + }, + "com.amazonaws.voiceid#AuthenticationResult": { + "type": "structure", + "members": { + "AuthenticationResultId": { + "target": "com.amazonaws.voiceid#UniqueIdLarge", + "traits": { + "smithy.api#documentation": "

The unique identifier for this authentication result. Because there can be multiple authentications\n for a given session, this field helps to identify if the returned result is from a previous streaming \n activity or a new result. Note that in absence of any new streaming activity, \n AcceptanceThreshold changes, or SpeakerId changes, Voice ID \n always returns cached Authentication Result for this API.

" + } + }, + "AudioAggregationStartedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp indicating when audio aggregation started for this authentication result.

" + } + }, + "AudioAggregationEndedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp indicating when audio aggregation ended for this authentication result.

" + } + }, + "CustomerSpeakerId": { + "target": "com.amazonaws.voiceid#CustomerSpeakerId", + "traits": { + "smithy.api#documentation": "

The client-provided identifier for the speaker whose authentication result is produced. Only present if a\n SpeakerId is provided for the session.

" + } + }, + "GeneratedSpeakerId": { + "target": "com.amazonaws.voiceid#GeneratedSpeakerId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the speaker whose authentication result is produced.

" + } + }, + "Decision": { + "target": "com.amazonaws.voiceid#AuthenticationDecision", + "traits": { + "smithy.api#documentation": "

The authentication decision produced by Voice ID, processed against the current session state and streamed\n audio of the speaker.

" + } + }, + "Score": { + "target": "com.amazonaws.voiceid#Score", + "traits": { + "smithy.api#documentation": "

The authentication score for the speaker whose authentication result is produced. This value is \n only present if the authentication decision is either ACCEPT or REJECT.

" + } + }, + "Configuration": { + "target": "com.amazonaws.voiceid#AuthenticationConfiguration", + "traits": { + "smithy.api#documentation": "

The AuthenticationConfiguration used to generate this authentication result.

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

The authentication result produced by Voice ID, processed against the current session state and streamed\n audio of the speaker.

" + } + }, + "com.amazonaws.voiceid#ClientTokenString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "^[a-zA-Z0-9-_]+$" + } + }, + "com.amazonaws.voiceid#ConflictException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.voiceid#String" + }, + "ConflictType": { + "target": "com.amazonaws.voiceid#ConflictType", + "traits": { + "smithy.api#documentation": "

The type of conflict which caused a ConflictException. Possible types and the corresponding error messages\n are as follows:

\n " + } + } + }, + "traits": { + "smithy.api#documentation": "

The request failed due to a conflict. Check the ConflictType and error message for\n more details.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.voiceid#ConflictType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ANOTHER_ACTIVE_STREAM", + "name": "ANOTHER_ACTIVE_STREAM" + }, + { + "value": "DOMAIN_NOT_ACTIVE", + "name": "DOMAIN_NOT_ACTIVE" + }, + { + "value": "CANNOT_CHANGE_SPEAKER_AFTER_ENROLLMENT", + "name": "CANNOT_CHANGE_SPEAKER_AFTER_ENROLLMENT" + }, + { + "value": "ENROLLMENT_ALREADY_EXISTS", + "name": "ENROLLMENT_ALREADY_EXISTS" + }, + { + "value": "SPEAKER_NOT_SET", + "name": "SPEAKER_NOT_SET" + }, + { + "value": "SPEAKER_OPTED_OUT", + "name": "SPEAKER_OPTED_OUT" + }, + { + "value": "CONCURRENT_CHANGES", + "name": "CONCURRENT_CHANGES" + } + ] + } + }, + "com.amazonaws.voiceid#CreateDomain": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#CreateDomainRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#CreateDomainResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a domain that contains all Amazon Connect Voice ID data, such as speakers, fraudsters, customer \n audio, and voiceprints.\n

", + "smithy.api#http": { + "method": "POST", + "uri": "/domains", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.voiceid#CreateDomainRequest": { + "type": "structure", + "members": { + "Name": { + "target": "com.amazonaws.voiceid#DomainName", + "traits": { + "smithy.api#documentation": "

The name of the domain.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "com.amazonaws.voiceid#Description", + "traits": { + "smithy.api#documentation": "

A brief description of this domain.

" + } + }, + "ServerSideEncryptionConfiguration": { + "target": "com.amazonaws.voiceid#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The configuration, containing the KMS Key Identifier, to be used by Voice ID for \n the server-side encryption of your data. Refer to \n Amazon Connect VoiceID encryption at rest for more details on how the KMS Key is used.\n

", + "smithy.api#required": {} + } + }, + "ClientToken": { + "target": "com.amazonaws.voiceid#ClientTokenString", + "traits": { + "smithy.api#documentation": "

The idempotency token for creating a new domain. If not provided, Amazon Web Services SDK populates \n this field.

", + "smithy.api#idempotencyToken": {} + } + }, + "Tags": { + "target": "com.amazonaws.voiceid#TagList", + "traits": { + "smithy.api#documentation": "

A list of tags you want added to the domain.

" + } + } + } + }, + "com.amazonaws.voiceid#CreateDomainResponse": { + "type": "structure", + "members": { + "Domain": { + "target": "com.amazonaws.voiceid#Domain", + "traits": { + "smithy.api#documentation": "

Information about the newly created domain.

" + } + } + } + }, + "com.amazonaws.voiceid#CustomerSpeakerId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#DeleteDomain": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DeleteDomainRequest" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the specified domain from the Amazon Connect Voice ID system.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/domains/{DomainId}", + "code": 204 + } + } + }, + "com.amazonaws.voiceid#DeleteDomainRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain you want to delete.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DeleteFraudster": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DeleteFraudsterRequest" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the specified fraudster from the Amazon Connect Voice ID system.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/domains/{DomainId}/fraudsters/{FraudsterId}", + "code": 204 + } + } + }, + "com.amazonaws.voiceid#DeleteFraudsterRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the fraudster.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "FraudsterId": { + "target": "com.amazonaws.voiceid#FraudsterId", + "traits": { + "smithy.api#documentation": "

The identifier of the fraudster you want to delete.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DeleteSpeaker": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DeleteSpeakerRequest" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the specified speaker from the Amazon Connect Voice ID system.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/domains/{DomainId}/speakers/{SpeakerId}", + "code": 204 + } + } + }, + "com.amazonaws.voiceid#DeleteSpeakerRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the speaker.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "SpeakerId": { + "target": "com.amazonaws.voiceid#SpeakerId", + "traits": { + "smithy.api#documentation": "

The identifier of the speaker you want to delete.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DescribeDomain": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DescribeDomainRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#DescribeDomainResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes the specified domain.

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#DescribeDomainRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain you are describing.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DescribeDomainResponse": { + "type": "structure", + "members": { + "Domain": { + "target": "com.amazonaws.voiceid#Domain", + "traits": { + "smithy.api#documentation": "

Information about the specified domain.

" + } + } + } + }, + "com.amazonaws.voiceid#DescribeFraudster": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DescribeFraudsterRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#DescribeFraudsterResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes the specified fraudster.

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}/fraudsters/{FraudsterId}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#DescribeFraudsterRegistrationJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DescribeFraudsterRegistrationJobRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#DescribeFraudsterRegistrationJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes the specified fraudster registration job.

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}/fraudster-registration-jobs/{JobId}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#DescribeFraudsterRegistrationJobRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier for the domain containing the fraudster registration job.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "JobId": { + "target": "com.amazonaws.voiceid#JobId", + "traits": { + "smithy.api#documentation": "

The identifier for the fraudster registration job you are describing.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DescribeFraudsterRegistrationJobResponse": { + "type": "structure", + "members": { + "Job": { + "target": "com.amazonaws.voiceid#FraudsterRegistrationJob", + "traits": { + "smithy.api#documentation": "

Contains details about the specified fraudster registration job.

" + } + } + } + }, + "com.amazonaws.voiceid#DescribeFraudsterRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the fraudster.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "FraudsterId": { + "target": "com.amazonaws.voiceid#FraudsterId", + "traits": { + "smithy.api#documentation": "

The identifier of the fraudster you are describing.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DescribeFraudsterResponse": { + "type": "structure", + "members": { + "Fraudster": { + "target": "com.amazonaws.voiceid#Fraudster", + "traits": { + "smithy.api#documentation": "

Information about the specified fraudster.

" + } + } + } + }, + "com.amazonaws.voiceid#DescribeSpeaker": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DescribeSpeakerRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#DescribeSpeakerResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes the specified speaker.

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}/speakers/{SpeakerId}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#DescribeSpeakerEnrollmentJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#DescribeSpeakerEnrollmentJobRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#DescribeSpeakerEnrollmentJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes the specified speaker enrollment job.

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}/speaker-enrollment-jobs/{JobId}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#DescribeSpeakerEnrollmentJobRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the speaker enrollment job.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "JobId": { + "target": "com.amazonaws.voiceid#JobId", + "traits": { + "smithy.api#documentation": "

The identifier of the speaker enrollment job you are describing.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DescribeSpeakerEnrollmentJobResponse": { + "type": "structure", + "members": { + "Job": { + "target": "com.amazonaws.voiceid#SpeakerEnrollmentJob", + "traits": { + "smithy.api#documentation": "

Contains details about the specified speaker enrollment job.

" + } + } + } + }, + "com.amazonaws.voiceid#DescribeSpeakerRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain that contains the speaker.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "SpeakerId": { + "target": "com.amazonaws.voiceid#SpeakerId", + "traits": { + "smithy.api#documentation": "

The identifier of the speaker you are describing.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#DescribeSpeakerResponse": { + "type": "structure", + "members": { + "Speaker": { + "target": "com.amazonaws.voiceid#Speaker", + "traits": { + "smithy.api#documentation": "

Information about the specified speaker.

" + } + } + } + }, + "com.amazonaws.voiceid#Description": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-%@]*)$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#Domain": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the domain.

" + } + }, + "Arn": { + "target": "com.amazonaws.voiceid#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) for the domain.

" + } + }, + "Name": { + "target": "com.amazonaws.voiceid#DomainName", + "traits": { + "smithy.api#documentation": "

The client-provided name for the domain.

" + } + }, + "Description": { + "target": "com.amazonaws.voiceid#Description", + "traits": { + "smithy.api#documentation": "

The client-provided description of the domain.

" + } + }, + "DomainStatus": { + "target": "com.amazonaws.voiceid#DomainStatus", + "traits": { + "smithy.api#documentation": "

The current status of the domain.

" + } + }, + "ServerSideEncryptionConfiguration": { + "target": "com.amazonaws.voiceid#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The server-side encryption configuration containing the KMS Key Identifier you want Voice ID to use\n to encrypt your data.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

The timestamp at which the domain is created.

" + } + }, + "UpdatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

The timestamp showing the domain's last update.

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

Contains all the information about a domain.

" + } + }, + "com.amazonaws.voiceid#DomainId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 22, + "max": 22 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#DomainName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#DomainStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ACTIVE", + "name": "ACTIVE" + }, + { + "value": "PENDING", + "name": "PENDING" + }, + { + "value": "SUSPENDED", + "name": "SUSPENDED" + } + ] + } + }, + "com.amazonaws.voiceid#DomainSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.voiceid#DomainSummary" + } + }, + "com.amazonaws.voiceid#DomainSummary": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the domain.

" + } + }, + "Arn": { + "target": "com.amazonaws.voiceid#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) for the domain.

" + } + }, + "Name": { + "target": "com.amazonaws.voiceid#DomainName", + "traits": { + "smithy.api#documentation": "

The client-provided name for the domain.

" + } + }, + "Description": { + "target": "com.amazonaws.voiceid#Description", + "traits": { + "smithy.api#documentation": "

The client-provided description of the domain.

" + } + }, + "DomainStatus": { + "target": "com.amazonaws.voiceid#DomainStatus", + "traits": { + "smithy.api#documentation": "

The current status of the domain.

" + } + }, + "ServerSideEncryptionConfiguration": { + "target": "com.amazonaws.voiceid#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The server-side encryption configuration containing the KMS Key Identifier you want Voice ID to use\n to encrypt your data..

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

The timestamp showing when the domain is created.

" + } + }, + "UpdatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

The timestamp showing the domain's last update.

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

Contains a summary of information about a domain.

" + } + }, + "com.amazonaws.voiceid#DuplicateRegistrationAction": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SKIP", + "name": "SKIP" + }, + { + "value": "REGISTER_AS_NEW", + "name": "REGISTER_AS_NEW" + } + ] + } + }, + "com.amazonaws.voiceid#EnrollmentConfig": { + "type": "structure", + "members": { + "ExistingEnrollmentAction": { + "target": "com.amazonaws.voiceid#ExistingEnrollmentAction", + "traits": { + "smithy.api#documentation": "

The action to take when the specified speaker is already enrolled in the specified domain. The default \n value is SKIP, which skips the enrollment for the existing speaker. Setting the value to\n OVERWRITE replaces the existing voice prints and enrollment audio stored for that speaker\n with new data generated from the latest audio.

" + } + }, + "FraudDetectionConfig": { + "target": "com.amazonaws.voiceid#EnrollmentJobFraudDetectionConfig", + "traits": { + "smithy.api#documentation": "

The fraud detection configuration to use for the speaker enrollment job.

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

Contains configurations defining enrollment behavior for the batch job.

" + } + }, + "com.amazonaws.voiceid#EnrollmentJobFraudDetectionConfig": { + "type": "structure", + "members": { + "FraudDetectionAction": { + "target": "com.amazonaws.voiceid#FraudDetectionAction", + "traits": { + "smithy.api#documentation": "

The action to take when the given speaker is flagged by the fraud detection system. The default value is\n FAIL, which fails the speaker enrollment. Changing this value to IGNORE \n results in the speaker being enrolled even if they are flagged by the fraud detection system.

" + } + }, + "RiskThreshold": { + "target": "com.amazonaws.voiceid#Score", + "traits": { + "smithy.api#documentation": "

Threshold value for determining whether the speaker is a high risk to be fraudulent. If the detected risk\n score calculated by Voice ID is greater than or equal to the threshold, the speaker is considered a fraudster.

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

The configuration defining the action to take when a speaker is flagged by the fraud detection system\n during a batch speaker enrollment job, and the risk threshold to use for identification.

" + } + }, + "com.amazonaws.voiceid#EvaluateSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#EvaluateSessionRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#EvaluateSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Evaluates a specified session based on audio data accumulated during a streaming Amazon Connect Voice \n ID call.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/sessions/{SessionNameOrId}/evaluate", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#EvaluateSessionRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain where the session started.

", + "smithy.api#httpQuery": "domainId", + "smithy.api#required": {} + } + }, + "SessionNameOrId": { + "target": "com.amazonaws.voiceid#SessionNameOrId", + "traits": { + "smithy.api#documentation": "

The session identifier, or name of the session, that you want to evaluate. In Voice ID\n integration, this is the Contact-Id.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#EvaluateSessionResponse": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the session.

" + } + }, + "SessionId": { + "target": "com.amazonaws.voiceid#SessionId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier of the session.

" + } + }, + "SessionName": { + "target": "com.amazonaws.voiceid#SessionName", + "traits": { + "smithy.api#documentation": "

The client-provided name of the session.

" + } + }, + "StreamingStatus": { + "target": "com.amazonaws.voiceid#StreamingStatus", + "traits": { + "smithy.api#documentation": "

The current status of audio streaming for this session. This field is useful to infer next steps when\n the Authentication or Fraud Detection results are empty or the decision is NOT_ENOUGH_SPEECH.\n In this situation, if the StreamingStatus is ONGOING/PENDING_CONFIGURATION, it can\n mean that the client should call the API again later, once Voice ID has enough audio to produce a result.\n If the decision remains NOT_ENOUGH_SPEECH even after StreamingStatus is ENDED,\n it means that the previously streamed session did not have enough speech to perform evaluation, and a new\n streaming session is needed to try again.

" + } + }, + "AuthenticationResult": { + "target": "com.amazonaws.voiceid#AuthenticationResult", + "traits": { + "smithy.api#documentation": "

Details resulting from the authentication process, such as authentication decision and\n authentication score.

" + } + }, + "FraudDetectionResult": { + "target": "com.amazonaws.voiceid#FraudDetectionResult", + "traits": { + "smithy.api#documentation": "

Details resulting from the fraud detection process, such as fraud detection decision and risk score.

" + } + } + } + }, + "com.amazonaws.voiceid#ExistingEnrollmentAction": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SKIP", + "name": "SKIP" + }, + { + "value": "OVERWRITE", + "name": "OVERWRITE" + } + ] + } + }, + "com.amazonaws.voiceid#FailureDetails": { + "type": "structure", + "members": { + "StatusCode": { + "target": "com.amazonaws.voiceid#Integer", + "traits": { + "smithy.api#documentation": "

An HTTP status code representing the nature of the error.

" + } + }, + "Message": { + "target": "com.amazonaws.voiceid#String", + "traits": { + "smithy.api#documentation": "

A description of the error that caused the batch job failure.

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

Contains error details for a failed batch job.

" + } + }, + "com.amazonaws.voiceid#FraudDetectionAction": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "IGNORE", + "name": "IGNORE" + }, + { + "value": "FAIL", + "name": "FAIL" + } + ] + } + }, + "com.amazonaws.voiceid#FraudDetectionConfiguration": { + "type": "structure", + "members": { + "RiskThreshold": { + "target": "com.amazonaws.voiceid#Score", + "traits": { + "smithy.api#documentation": "

Threshold value for determining whether the speaker is a fraudster. If the detected risk score \n calculated by Voice ID is higher than the threshold, the speaker is considered a fraudster.

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

The configuration used for performing fraud detection over a speaker during a session.

" + } + }, + "com.amazonaws.voiceid#FraudDetectionDecision": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "HIGH_RISK", + "name": "HIGH_RISK" + }, + { + "value": "LOW_RISK", + "name": "LOW_RISK" + }, + { + "value": "NOT_ENOUGH_SPEECH", + "name": "NOT_ENOUGH_SPEECH" + } + ] + } + }, + "com.amazonaws.voiceid#FraudDetectionReason": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "KNOWN_FRAUDSTER", + "name": "KNOWN_FRAUDSTER" + } + ] + } + }, + "com.amazonaws.voiceid#FraudDetectionReasons": { + "type": "list", + "member": { + "target": "com.amazonaws.voiceid#FraudDetectionReason" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 3 + } + } + }, + "com.amazonaws.voiceid#FraudDetectionResult": { + "type": "structure", + "members": { + "FraudDetectionResultId": { + "target": "com.amazonaws.voiceid#UniqueIdLarge", + "traits": { + "smithy.api#documentation": "

The unique identifier for this fraud detection result. Given there can be multiple fraud detections \n for a given session, this field helps in identifying if the returned result is from previous streaming \n activity or a new result. Note that in the absence of any new streaming activity or risk threshold \n changes, Voice ID always returns cached Fraud Detection result for this API.

" + } + }, + "AudioAggregationStartedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp indicating when audio aggregation started for this fraud detection result.

" + } + }, + "AudioAggregationEndedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp indicating when audio aggregation ended for this fraud detection result.

" + } + }, + "Configuration": { + "target": "com.amazonaws.voiceid#FraudDetectionConfiguration", + "traits": { + "smithy.api#documentation": "

The FraudDetectionConfiguration used to generate this fraud detection result.

" + } + }, + "Decision": { + "target": "com.amazonaws.voiceid#FraudDetectionDecision", + "traits": { + "smithy.api#documentation": "

The fraud detection decision produced by Voice ID, processed against the current session state and\n streamed audio of the speaker.

" + } + }, + "Reasons": { + "target": "com.amazonaws.voiceid#FraudDetectionReasons", + "traits": { + "smithy.api#documentation": "

The reason speaker was flagged by the fraud detection system. This is only be populated if fraud\n detection Decision is HIGH_RISK, and only has one possible value:\n KNOWN_FRAUDSTER.

" + } + }, + "RiskDetails": { + "target": "com.amazonaws.voiceid#FraudRiskDetails", + "traits": { + "smithy.api#documentation": "

Details about each risk analyzed for this speaker.

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

The fraud detection result produced by Voice ID, processed against the current session state and streamed\n audio of the speaker.

" + } + }, + "com.amazonaws.voiceid#FraudRiskDetails": { + "type": "structure", + "members": { + "KnownFraudsterRisk": { + "target": "com.amazonaws.voiceid#KnownFraudsterRisk", + "traits": { + "smithy.api#documentation": "

The details resulting from 'Known Fraudster Risk' analysis of the speaker.

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

Details regarding various fraud risk analyses performed against the current session state and streamed\n audio of the speaker.

" + } + }, + "com.amazonaws.voiceid#Fraudster": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier for the domain containing the fraudster.

" + } + }, + "GeneratedFraudsterId": { + "target": "com.amazonaws.voiceid#GeneratedFraudsterId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the fraudster.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

The timestamp when Voice ID identified the fraudster.

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

Contains all the information about a fraudster.

" + } + }, + "com.amazonaws.voiceid#FraudsterId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 25, + "max": 25 + }, + "smithy.api#pattern": "^id#[a-zA-Z0-9]{22}$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#FraudsterRegistrationJob": { + "type": "structure", + "members": { + "JobName": { + "target": "com.amazonaws.voiceid#JobName", + "traits": { + "smithy.api#documentation": "

The client-provied name for the fraudster registration job.

" + } + }, + "JobId": { + "target": "com.amazonaws.voiceid#JobId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the fraudster registration job.

" + } + }, + "JobStatus": { + "target": "com.amazonaws.voiceid#FraudsterRegistrationJobStatus", + "traits": { + "smithy.api#documentation": "

The current status of the fraudster registration job.

" + } + }, + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the fraudster registration job.

" + } + }, + "DataAccessRoleArn": { + "target": "com.amazonaws.voiceid#IamRoleArn", + "traits": { + "smithy.api#documentation": "

The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to access customer's buckets\n to read the input manifest file and write the job output file.

" + } + }, + "RegistrationConfig": { + "target": "com.amazonaws.voiceid#RegistrationConfig", + "traits": { + "smithy.api#documentation": "

The registration config containing details such as the action to take when a duplicate fraudster is \n detected, and the similarity threshold to use for detecting a duplicate fraudster.

" + } + }, + "InputDataConfig": { + "target": "com.amazonaws.voiceid#InputDataConfig", + "traits": { + "smithy.api#documentation": "

The input data config containing an S3 URI for the input manifest file that contains the list\n of fraudster registration job requests.

" + } + }, + "OutputDataConfig": { + "target": "com.amazonaws.voiceid#OutputDataConfig", + "traits": { + "smithy.api#documentation": "

The output data config containing the S3 location where you want Voice ID to write your job output \n file; you must also include a KMS Key ID in order to encrypt the file.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing the creation time of the fraudster registration job.

" + } + }, + "EndedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing when the fraudster registration job ended.

" + } + }, + "FailureDetails": { + "target": "com.amazonaws.voiceid#FailureDetails", + "traits": { + "smithy.api#documentation": "

Contains details that are populated when an entire batch job fails. In cases of individual registration\n job failures, the batch job as a whole doesn't fail; it is completed with a JobStatus of\n COMPLETED_WITH_ERRORS. You can use the job output file to identify the individual \n registration requests that failed.

" + } + }, + "JobProgress": { + "target": "com.amazonaws.voiceid#JobProgress", + "traits": { + "smithy.api#documentation": "

Shows the completed percentage of registration requests listed in the input file.

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

Contains all the information about a fraudster registration job.

" + } + }, + "com.amazonaws.voiceid#FraudsterRegistrationJobStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SUBMITTED", + "name": "SUBMITTED" + }, + { + "value": "IN_PROGRESS", + "name": "IN_PROGRESS" + }, + { + "value": "COMPLETED", + "name": "COMPLETED" + }, + { + "value": "COMPLETED_WITH_ERRORS", + "name": "COMPLETED_WITH_ERRORS" + }, + { + "value": "FAILED", + "name": "FAILED" + } + ] + } + }, + "com.amazonaws.voiceid#FraudsterRegistrationJobSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.voiceid#FraudsterRegistrationJobSummary" + } + }, + "com.amazonaws.voiceid#FraudsterRegistrationJobSummary": { + "type": "structure", + "members": { + "JobName": { + "target": "com.amazonaws.voiceid#JobName", + "traits": { + "smithy.api#documentation": "

The client-provied name for the fraudster registration job.

" + } + }, + "JobId": { + "target": "com.amazonaws.voiceid#JobId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the fraudster registration job.

" + } + }, + "JobStatus": { + "target": "com.amazonaws.voiceid#FraudsterRegistrationJobStatus", + "traits": { + "smithy.api#documentation": "

The current status of the fraudster registration job.

" + } + }, + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the fraudster registration job.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing when the fraudster registration job is created.

" + } + }, + "EndedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing when the fraudster registration job ended.

" + } + }, + "FailureDetails": { + "target": "com.amazonaws.voiceid#FailureDetails", + "traits": { + "smithy.api#documentation": "

Contains details that are populated when an entire batch job fails. In cases of individual registration\n job failures, the batch job as a whole doesn't fail; it is completed with a JobStatus of\n COMPLETED_WITH_ERRORS. You can use the job output file to identify the individual \n registration requests that failed.

" + } + }, + "JobProgress": { + "target": "com.amazonaws.voiceid#JobProgress", + "traits": { + "smithy.api#documentation": "

Shows the completed percentage of registration requests listed in the input file.

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

Contains a summary of information about a fraudster registration job.

" + } + }, + "com.amazonaws.voiceid#GeneratedFraudsterId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 25, + "max": 25 + }, + "smithy.api#pattern": "^id#[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#GeneratedSpeakerId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 25, + "max": 25 + }, + "smithy.api#pattern": "^id#[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#IamRoleArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+$" + } + }, + "com.amazonaws.voiceid#InputDataConfig": { + "type": "structure", + "members": { + "S3Uri": { + "target": "com.amazonaws.voiceid#S3Uri", + "traits": { + "smithy.api#documentation": "

The S3 location for the input manifest file that contains the list of individual enrollment or registration\n job requests.

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

The configuration containing input file information for a batch job.

" + } + }, + "com.amazonaws.voiceid#Integer": { + "type": "integer", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.voiceid#InternalServerException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.voiceid#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request failed due to an unknown error on the server side.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.voiceid#JobId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 22, + "max": 22 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#JobName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#JobProgress": { + "type": "structure", + "members": { + "PercentComplete": { + "target": "com.amazonaws.voiceid#Score", + "traits": { + "smithy.api#documentation": "

Shows the completed percentage of enrollment or registration requests listed in the input file.

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

Indicates the completion progress for a batch job.

" + } + }, + "com.amazonaws.voiceid#KmsKeyId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, + "com.amazonaws.voiceid#KnownFraudsterRisk": { + "type": "structure", + "members": { + "RiskScore": { + "target": "com.amazonaws.voiceid#Score", + "traits": { + "smithy.api#documentation": "

The score indicating the likelihood the speaker is a known fraudster.

", + "smithy.api#required": {} + } + }, + "GeneratedFraudsterId": { + "target": "com.amazonaws.voiceid#GeneratedFraudsterId", + "traits": { + "smithy.api#documentation": "

The identifier of the fraudster that is the closest match to the speaker. If there are no fraudsters\n registered in a given domain, or if there are no fraudsters with a non-zero RiskScore, this value is\n null.

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

Contains details produced as a result of performing known fraudster risk analysis on a speaker.

" + } + }, + "com.amazonaws.voiceid#ListDomains": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#ListDomainsRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#ListDomainsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all the domains in the Amazon Web Services account.\n

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.voiceid#ListDomainsRequest": { + "type": "structure", + "members": { + "MaxResults": { + "target": "com.amazonaws.voiceid#MaxResultsForListDomainFe", + "traits": { + "smithy.api#documentation": "

The maximum number of results that are returned per call. You can use NextToken to obtain\n further pages of results. The default is 100; the maximum allowed page size is also 100.\n

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#NextToken", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

", + "smithy.api#httpQuery": "nextToken" + } + } + } + }, + "com.amazonaws.voiceid#ListDomainsResponse": { + "type": "structure", + "members": { + "DomainSummaries": { + "target": "com.amazonaws.voiceid#DomainSummaries", + "traits": { + "smithy.api#documentation": "

A list containing details about each domain in the Amazon Web Services account.

" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#String", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

" + } + } + } + }, + "com.amazonaws.voiceid#ListFraudsterRegistrationJobs": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#ListFraudsterRegistrationJobsRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#ListFraudsterRegistrationJobsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all the fraudster registration jobs in the domain with the given JobStatus.\n If JobStatus is not provided, this lists all fraudster registration jobs in the given\n domain.\n

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}/fraudster-registration-jobs", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.voiceid#ListFraudsterRegistrationJobsRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the fraudster registration Jobs.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "JobStatus": { + "target": "com.amazonaws.voiceid#FraudsterRegistrationJobStatus", + "traits": { + "smithy.api#documentation": "

Provides the status of your fraudster registration job.

", + "smithy.api#httpQuery": "jobStatus" + } + }, + "MaxResults": { + "target": "com.amazonaws.voiceid#MaxResultsForList", + "traits": { + "smithy.api#documentation": "

The maximum number of results that are returned per call. You can use NextToken to obtain\n further pages of results. The default is 100; the maximum allowed page size is also 100.\n

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#NextToken", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

", + "smithy.api#httpQuery": "nextToken" + } + } + } + }, + "com.amazonaws.voiceid#ListFraudsterRegistrationJobsResponse": { + "type": "structure", + "members": { + "JobSummaries": { + "target": "com.amazonaws.voiceid#FraudsterRegistrationJobSummaries", + "traits": { + "smithy.api#documentation": "

A list containing details about each specified fraudster registration job.

" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#String", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

" + } + } + } + }, + "com.amazonaws.voiceid#ListSpeakerEnrollmentJobs": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#ListSpeakerEnrollmentJobsRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#ListSpeakerEnrollmentJobsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all the speaker enrollment jobs in the domain with the specified JobStatus. If\n JobStatus is not provided, this lists all jobs with all possible speaker enrollment job\n statuses.

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}/speaker-enrollment-jobs", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.voiceid#ListSpeakerEnrollmentJobsRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the speaker enrollment jobs.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "JobStatus": { + "target": "com.amazonaws.voiceid#SpeakerEnrollmentJobStatus", + "traits": { + "smithy.api#documentation": "

Provides the status of your speaker enrollment Job.

", + "smithy.api#httpQuery": "jobStatus" + } + }, + "MaxResults": { + "target": "com.amazonaws.voiceid#MaxResultsForList", + "traits": { + "smithy.api#documentation": "

The maximum number of results that are returned per call. You can use NextToken to obtain\n further pages of results. The default is 100; the maximum allowed page size is also 100.\n

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#NextToken", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

", + "smithy.api#httpQuery": "nextToken" + } + } + } + }, + "com.amazonaws.voiceid#ListSpeakerEnrollmentJobsResponse": { + "type": "structure", + "members": { + "JobSummaries": { + "target": "com.amazonaws.voiceid#SpeakerEnrollmentJobSummaries", + "traits": { + "smithy.api#documentation": "

A list containing details about each specified speaker enrollment job.

" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#String", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

" + } + } + } + }, + "com.amazonaws.voiceid#ListSpeakers": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#ListSpeakersRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#ListSpeakersResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all speakers in a specified domain.

", + "smithy.api#http": { + "method": "GET", + "uri": "/domains/{DomainId}/speakers", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.voiceid#ListSpeakersRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "MaxResults": { + "target": "com.amazonaws.voiceid#MaxResultsForList", + "traits": { + "smithy.api#documentation": "

The maximum number of results that are returned per call. You can use NextToken to obtain\n further pages of results. The default is 100; the maximum allowed page size is also 100.\n

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#NextToken", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

", + "smithy.api#httpQuery": "nextToken" + } + } + } + }, + "com.amazonaws.voiceid#ListSpeakersResponse": { + "type": "structure", + "members": { + "SpeakerSummaries": { + "target": "com.amazonaws.voiceid#SpeakerSummaries", + "traits": { + "smithy.api#documentation": "

A list containing details about each speaker in the Amazon Web Services account.\n

" + } + }, + "NextToken": { + "target": "com.amazonaws.voiceid#String", + "traits": { + "smithy.api#documentation": "

If NextToken is returned, there are more results available. The value of NextToken\n is a unique pagination token for each page. Make the call again using the returned token to retrieve the\n next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.\n

" + } + } + } + }, + "com.amazonaws.voiceid#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all tags associated with a specified Voice ID resource.

", + "smithy.api#http": { + "method": "GET", + "uri": "/tags/{ResourceArn}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.voiceid#AmazonResourceName", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Voice ID resource for which you want to list the tags.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "Tags": { + "target": "com.amazonaws.voiceid#TagList", + "traits": { + "smithy.api#documentation": "

The list of tags associated with the specified resource.

" + } + } + } + }, + "com.amazonaws.voiceid#MaxResultsForList": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.voiceid#MaxResultsForListDomainFe": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.voiceid#NextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 8192 + }, + "smithy.api#pattern": "^\\p{ASCII}{0,8192}$" + } + }, + "com.amazonaws.voiceid#OptOutSpeaker": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#OptOutSpeakerRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#OptOutSpeakerResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Opts out a speaker from Voice ID system. A speaker can be opted out regardless of whether or not they\n already exist in the system. If they don't yet exist, a new speaker is created in an opted out state.\n If they already exist, their existing status is overridden and they are opted out. Enrollment and\n evaluation authentication requests are rejected for opted out speakers, and opted out speakers have\n no voice embeddings stored in the system.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/domains/{DomainId}/speakers/{SpeakerId}/optout", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#OptOutSpeakerRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the speaker.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "SpeakerId": { + "target": "com.amazonaws.voiceid#SpeakerId", + "traits": { + "smithy.api#documentation": "

The identifier of the speaker you want opted-out.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#OptOutSpeakerResponse": { + "type": "structure", + "members": { + "Speaker": { + "target": "com.amazonaws.voiceid#Speaker", + "traits": { + "smithy.api#documentation": "

Details about the opted-out speaker.

" + } + } + } + }, + "com.amazonaws.voiceid#OutputDataConfig": { + "type": "structure", + "members": { + "S3Uri": { + "target": "com.amazonaws.voiceid#S3Uri", + "traits": { + "smithy.api#documentation": "

The S3 path of the folder to which Voice ID writes the job output file, which has a \n *.out extension. For example, if the input file name is input-file.json and \n the output folder path is s3://output-bucket/output-folder, the full output file path is \n s3://output-bucket/output-folder/job-Id/input-file.json.out.

", + "smithy.api#required": {} + } + }, + "KmsKeyId": { + "target": "com.amazonaws.voiceid#KmsKeyId", + "traits": { + "smithy.api#documentation": "

the identifier of the KMS key you want Voice ID to use to encrypt the output file of the fraudster\n registration job.

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

The configuration containing output file information for a batch job.

" + } + }, + "com.amazonaws.voiceid#RegistrationConfig": { + "type": "structure", + "members": { + "DuplicateRegistrationAction": { + "target": "com.amazonaws.voiceid#DuplicateRegistrationAction", + "traits": { + "smithy.api#documentation": "

The action to take when a fraudster is identified as a duplicate. The default action is \n SKIP, which skips registering the duplicate fraudster. Setting the value to\n REGISTER_AS_NEW always registers a new fraudster into the specified domain.

" + } + }, + "FraudsterSimilarityThreshold": { + "target": "com.amazonaws.voiceid#Score", + "traits": { + "smithy.api#documentation": "

The minimum similarity score between the new and old fraudsters in order to consider the new \n fraudster a duplicate.

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

The configuration definining the action to take when a duplicate fraudster is detected, and the \n similarity threshold to use for detecting a duplicate fraudster during a batch fraudster registration job.

" + } + }, + "com.amazonaws.voiceid#ResourceNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.voiceid#String" + }, + "ResourceType": { + "target": "com.amazonaws.voiceid#ResourceType", + "traits": { + "smithy.api#documentation": "

The type of resource which cannot not be found. Possible types are BATCH_JOB, COMPLIANCE_CONSENT,\n DOMAIN, FRAUDSTER, SESSION and SPEAKER.

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

The specified resource cannot be found. Check the ResourceType and error message for\n more details.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.voiceid#ResourceType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "BATCH_JOB", + "name": "BATCH_JOB" + }, + { + "value": "COMPLIANCE_CONSENT", + "name": "COMPLIANCE_CONSENT" + }, + { + "value": "DOMAIN", + "name": "DOMAIN" + }, + { + "value": "FRAUDSTER", + "name": "FRAUDSTER" + }, + { + "value": "SESSION", + "name": "SESSION" + }, + { + "value": "SPEAKER", + "name": "SPEAKER" + } + ] + } + }, + "com.amazonaws.voiceid#S3Uri": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^s3://[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9](/.*)?$" + } + }, + "com.amazonaws.voiceid#Score": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0, + "max": 100 + } + } + }, + "com.amazonaws.voiceid#ServerSideEncryptionConfiguration": { + "type": "structure", + "members": { + "KmsKeyId": { + "target": "com.amazonaws.voiceid#KmsKeyId", + "traits": { + "smithy.api#documentation": "

The identifier of the KMS Key you want Voice ID to use to encrypt your data.

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

The configuration containing information about the customer-managed KMS Key used for encrypting\n customer data.

" + } + }, + "com.amazonaws.voiceid#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.voiceid#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request exceeded the service quota. Refer to Voice ID Service \n Quotas and try your request again.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.voiceid#SessionId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 25, + "max": 25 + }, + "smithy.api#pattern": "^id#[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#SessionName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 36 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + } + }, + "com.amazonaws.voiceid#SessionNameOrId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 36 + }, + "smithy.api#pattern": "^(id#[a-zA-Z0-9]{22}|[a-zA-Z0-9][a-zA-Z0-9_-]*)$" + } + }, + "com.amazonaws.voiceid#Speaker": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain that contains the speaker.

" + } + }, + "CustomerSpeakerId": { + "target": "com.amazonaws.voiceid#CustomerSpeakerId", + "traits": { + "smithy.api#documentation": "

The client-provided identifier for the speaker.

" + } + }, + "GeneratedSpeakerId": { + "target": "com.amazonaws.voiceid#GeneratedSpeakerId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the speaker.

" + } + }, + "Status": { + "target": "com.amazonaws.voiceid#SpeakerStatus", + "traits": { + "smithy.api#documentation": "

The current status of the speaker.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing when the speaker is created.

" + } + }, + "UpdatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing the speaker's last update.

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

Contains all the information about a speaker.

" + } + }, + "com.amazonaws.voiceid#SpeakerEnrollmentJob": { + "type": "structure", + "members": { + "JobName": { + "target": "com.amazonaws.voiceid#JobName", + "traits": { + "smithy.api#documentation": "

The client-provided name for the speaker enrollment job.

" + } + }, + "JobId": { + "target": "com.amazonaws.voiceid#JobId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the speaker enrollment job.

" + } + }, + "JobStatus": { + "target": "com.amazonaws.voiceid#SpeakerEnrollmentJobStatus", + "traits": { + "smithy.api#documentation": "

The current status of the speaker enrollment job.

" + } + }, + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain that contains the speaker enrollment job.

" + } + }, + "DataAccessRoleArn": { + "target": "com.amazonaws.voiceid#IamRoleArn", + "traits": { + "smithy.api#documentation": "

The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to access customer's buckets\n to read the input manifest file and write the job output file.

" + } + }, + "EnrollmentConfig": { + "target": "com.amazonaws.voiceid#EnrollmentConfig", + "traits": { + "smithy.api#documentation": "

The configuration that defines the action to take when the speaker is already enrolled in Voice ID, and the\n FraudDetectionConfig to use.

" + } + }, + "InputDataConfig": { + "target": "com.amazonaws.voiceid#InputDataConfig", + "traits": { + "smithy.api#documentation": "

The input data config containing an S3 URI for the input manifest file that contains the list\n of speaker enrollment job requests.

" + } + }, + "OutputDataConfig": { + "target": "com.amazonaws.voiceid#OutputDataConfig", + "traits": { + "smithy.api#documentation": "

The output data config containing the S3 location where Voice ID writes the job output file; you must \n also include a KMS Key ID to encrypt the file.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing the creation of the speaker enrollment job.

" + } + }, + "EndedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing when the speaker enrollment job ended.

" + } + }, + "FailureDetails": { + "target": "com.amazonaws.voiceid#FailureDetails", + "traits": { + "smithy.api#documentation": "

Contains details that are populated when an entire batch job fails. In cases of individual registration\n job failures, the batch job as a whole doesn't fail; it is completed with a JobStatus of\n COMPLETED_WITH_ERRORS. You can use the job output file to identify the individual \n registration requests that failed.

" + } + }, + "JobProgress": { + "target": "com.amazonaws.voiceid#JobProgress", + "traits": { + "smithy.api#documentation": "

Provides details on job progress. This field shows the completed percentage of registration \n requests listed in the input file.

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

Contains all the information about a speaker enrollment job.

" + } + }, + "com.amazonaws.voiceid#SpeakerEnrollmentJobStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SUBMITTED", + "name": "SUBMITTED" + }, + { + "value": "IN_PROGRESS", + "name": "IN_PROGRESS" + }, + { + "value": "COMPLETED", + "name": "COMPLETED" + }, + { + "value": "COMPLETED_WITH_ERRORS", + "name": "COMPLETED_WITH_ERRORS" + }, + { + "value": "FAILED", + "name": "FAILED" + } + ] + } + }, + "com.amazonaws.voiceid#SpeakerEnrollmentJobSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.voiceid#SpeakerEnrollmentJobSummary" + } + }, + "com.amazonaws.voiceid#SpeakerEnrollmentJobSummary": { + "type": "structure", + "members": { + "JobName": { + "target": "com.amazonaws.voiceid#JobName", + "traits": { + "smithy.api#documentation": "

The client-provided name for the speaker enrollment job.

" + } + }, + "JobId": { + "target": "com.amazonaws.voiceid#JobId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the speaker enrollment job.

" + } + }, + "JobStatus": { + "target": "com.amazonaws.voiceid#SpeakerEnrollmentJobStatus", + "traits": { + "smithy.api#documentation": "

The current status of the speaker enrollment job.

" + } + }, + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain that contains the speaker enrollment job.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing the creation time of the speaker enrollment job.

" + } + }, + "EndedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing when the speaker enrollment job ended.

" + } + }, + "FailureDetails": { + "target": "com.amazonaws.voiceid#FailureDetails", + "traits": { + "smithy.api#documentation": "

Contains details that are populated when an entire batch job fails. In cases of individual registration\n job failures, the batch job as a whole doesn't fail; it is completed with a JobStatus of\n COMPLETED_WITH_ERRORS. You can use the job output file to identify the individual \n registration requests that failed.

" + } + }, + "JobProgress": { + "target": "com.amazonaws.voiceid#JobProgress", + "traits": { + "smithy.api#documentation": "

Provides details regarding job progress. This field shows the completed percentage of enrollment \n requests listed in the input file.

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

Contains a summary of information about a speaker enrollment job.

" + } + }, + "com.amazonaws.voiceid#SpeakerId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^(id#[a-zA-Z0-9]{22}|[a-zA-Z0-9][a-zA-Z0-9_-]*)$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#SpeakerStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ENROLLED", + "name": "ENROLLED" + }, + { + "value": "EXPIRED", + "name": "EXPIRED" + }, + { + "value": "OPTED_OUT", + "name": "OPTED_OUT" + }, + { + "value": "PENDING", + "name": "PENDING" + } + ] + } + }, + "com.amazonaws.voiceid#SpeakerSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.voiceid#SpeakerSummary" + } + }, + "com.amazonaws.voiceid#SpeakerSummary": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain that contains the speaker.

" + } + }, + "CustomerSpeakerId": { + "target": "com.amazonaws.voiceid#CustomerSpeakerId", + "traits": { + "smithy.api#documentation": "

The client-provided identifier for the speaker.

" + } + }, + "GeneratedSpeakerId": { + "target": "com.amazonaws.voiceid#GeneratedSpeakerId", + "traits": { + "smithy.api#documentation": "

The service-generated identifier for the speaker.

" + } + }, + "Status": { + "target": "com.amazonaws.voiceid#SpeakerStatus", + "traits": { + "smithy.api#documentation": "

The current status of the speaker.

" + } + }, + "CreatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing the speaker's creation time.

" + } + }, + "UpdatedAt": { + "target": "com.amazonaws.voiceid#Timestamp", + "traits": { + "smithy.api#documentation": "

A timestamp showing the speaker's last update.

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

Contains a summary of information about a speaker.

" + } + }, + "com.amazonaws.voiceid#StartFraudsterRegistrationJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#StartFraudsterRegistrationJobRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#StartFraudsterRegistrationJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Starts a new batch fraudster registration job using provided details.

", + "smithy.api#http": { + "method": "POST", + "uri": "/domains/{DomainId}/fraudster-registration-jobs", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.voiceid#StartFraudsterRegistrationJobRequest": { + "type": "structure", + "members": { + "ClientToken": { + "target": "com.amazonaws.voiceid#ClientTokenString", + "traits": { + "smithy.api#documentation": "

The idempotency token for starting a new fraudster registration job. If not provided, Amazon Web Services \n SDK populates this field.

", + "smithy.api#idempotencyToken": {} + } + }, + "JobName": { + "target": "com.amazonaws.voiceid#JobName", + "traits": { + "smithy.api#documentation": "

The name of the new fraudster registration job.

" + } + }, + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain containing the fraudster registration job and in which the fraudsters are\n registered.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "DataAccessRoleArn": { + "target": "com.amazonaws.voiceid#IamRoleArn", + "traits": { + "smithy.api#documentation": "

The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to access customer's buckets\n to read the input manifest file and write the Job output file. Refer to the\n Create and\n edit a fraudster watchlist documentation for the permissions needed in this role.

", + "smithy.api#required": {} + } + }, + "RegistrationConfig": { + "target": "com.amazonaws.voiceid#RegistrationConfig", + "traits": { + "smithy.api#documentation": "

The registration config containing details such as the action to take when a duplicate fraudster is\n detected, and the similarity threshold to use for detecting a duplicate fraudster.

" + } + }, + "InputDataConfig": { + "target": "com.amazonaws.voiceid#InputDataConfig", + "traits": { + "smithy.api#documentation": "

The input data config containing an S3 URI for the input manifest file that contains the list\n of fraudster registration requests.

", + "smithy.api#required": {} + } + }, + "OutputDataConfig": { + "target": "com.amazonaws.voiceid#OutputDataConfig", + "traits": { + "smithy.api#documentation": "

The output data config containing the S3 location where Voice ID writes the job output file; you must\n also include a KMS Key ID to encrypt the file.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#StartFraudsterRegistrationJobResponse": { + "type": "structure", + "members": { + "Job": { + "target": "com.amazonaws.voiceid#FraudsterRegistrationJob", + "traits": { + "smithy.api#documentation": "

Details about the started fraudster registration job.

" + } + } + } + }, + "com.amazonaws.voiceid#StartSpeakerEnrollmentJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#StartSpeakerEnrollmentJobRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#StartSpeakerEnrollmentJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Starts a new batch speaker enrollment job using specified details.

", + "smithy.api#http": { + "method": "POST", + "uri": "/domains/{DomainId}/speaker-enrollment-jobs", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.voiceid#StartSpeakerEnrollmentJobRequest": { + "type": "structure", + "members": { + "ClientToken": { + "target": "com.amazonaws.voiceid#ClientTokenString", + "traits": { + "smithy.api#documentation": "

The idempotency token for starting a new speaker enrollment Job. If not provided, Amazon Web Services \n SDK populates this field.

", + "smithy.api#idempotencyToken": {} + } + }, + "JobName": { + "target": "com.amazonaws.voiceid#JobName", + "traits": { + "smithy.api#documentation": "

A name for your speaker enrollment job.

" + } + }, + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain that contains the speaker enrollment job and in which the speakers are\n enrolled.\n

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "DataAccessRoleArn": { + "target": "com.amazonaws.voiceid#IamRoleArn", + "traits": { + "smithy.api#documentation": "

The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to access customer's buckets\n to read the input manifest file and write the job output file. Refer to Batch enrollment using audio data from prior\n calls documentation for the permissions needed in this role.

", + "smithy.api#required": {} + } + }, + "EnrollmentConfig": { + "target": "com.amazonaws.voiceid#EnrollmentConfig", + "traits": { + "smithy.api#documentation": "

The enrollment config that contains details such as the action to take when a speaker is already\n enrolled in the Voice ID system or when a speaker is identified as a fraudster.

" + } + }, + "InputDataConfig": { + "target": "com.amazonaws.voiceid#InputDataConfig", + "traits": { + "smithy.api#documentation": "

The input data config containing the S3 location for the input manifest file that contains the list of\n speaker enrollment requests.

", + "smithy.api#required": {} + } + }, + "OutputDataConfig": { + "target": "com.amazonaws.voiceid#OutputDataConfig", + "traits": { + "smithy.api#documentation": "

The output data config containing the S3 location where Voice ID writes the job output file; you must\n also include a KMS Key ID to encrypt the file.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#StartSpeakerEnrollmentJobResponse": { + "type": "structure", + "members": { + "Job": { + "target": "com.amazonaws.voiceid#SpeakerEnrollmentJob", + "traits": { + "smithy.api#documentation": "

Details about the started speaker enrollment job.

" + } + } + } + }, + "com.amazonaws.voiceid#StreamingStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "PENDING_CONFIGURATION", + "name": "PENDING_CONFIGURATION" + }, + { + "value": "ONGOING", + "name": "ONGOING" + }, + { + "value": "ENDED", + "name": "ENDED" + } + ] + } + }, + "com.amazonaws.voiceid#String": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.voiceid#Tag": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.voiceid#TagKey", + "traits": { + "smithy.api#documentation": "

The first part of a key:value pair that forms a tag associated with a given resource. For example,\n in the tag ‘Department’:’Sales’, the key is 'Department'.\n

", + "smithy.api#required": {} + } + }, + "Value": { + "target": "com.amazonaws.voiceid#TagValue", + "traits": { + "smithy.api#documentation": "

The second part of a key:value pair that forms a tag associated with a given resource. For example,\n in the tag ‘Department’:’Sales’, the value is 'Sales'.\n

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

A tag that can be assigned to a Voice ID resource.

" + } + }, + "com.amazonaws.voiceid#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#TagKeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.voiceid#TagKey" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.voiceid#TagList": { + "type": "list", + "member": { + "target": "com.amazonaws.voiceid#Tag" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.voiceid#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Tags an Amazon Connect Voice ID resource with the provided list of tags.

", + "smithy.api#http": { + "method": "POST", + "uri": "/tags/{ResourceArn}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#TagResourceRequest": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.voiceid#AmazonResourceName", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Voice ID resource you want to tag.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "Tags": { + "target": "com.amazonaws.voiceid#TagList", + "traits": { + "smithy.api#documentation": "

The list of tags to assign to the specified resource.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#TagResourceResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.voiceid#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.voiceid#ThrottlingException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.voiceid#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied due to request throttling. Please slow down your request rate. Refer to\n \n Amazon Connect Voice ID Service API throttling quotas\n and try your request again.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, + "com.amazonaws.voiceid#Timestamp": { + "type": "timestamp" + }, + "com.amazonaws.voiceid#UniqueIdLarge": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 22, + "max": 22 + }, + "smithy.api#pattern": "^[a-zA-Z0-9]{22}$" + } + }, + "com.amazonaws.voiceid#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Removes specified tags from a specified Amazon Connect Voice ID resource.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/tags/{ResourceArn}", + "code": 204 + } + } + }, + "com.amazonaws.voiceid#UntagResourceRequest": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.voiceid#AmazonResourceName", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Voice ID resource you want to remove tags from.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "TagKeys": { + "target": "com.amazonaws.voiceid#TagKeyList", + "traits": { + "smithy.api#documentation": "

The list of tag keys you want to remove from the specified resource.

", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#UntagResourceResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.voiceid#UpdateDomain": { + "type": "operation", + "input": { + "target": "com.amazonaws.voiceid#UpdateDomainRequest" + }, + "output": { + "target": "com.amazonaws.voiceid#UpdateDomainResponse" + }, + "errors": [ + { + "target": "com.amazonaws.voiceid#AccessDeniedException" + }, + { + "target": "com.amazonaws.voiceid#ConflictException" + }, + { + "target": "com.amazonaws.voiceid#InternalServerException" + }, + { + "target": "com.amazonaws.voiceid#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.voiceid#ThrottlingException" + }, + { + "target": "com.amazonaws.voiceid#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates the specified domain. This API has clobber behavior, and clears and replaces all attributes.\n If an optional field, such as 'Description' is not provided, it is removed from the domain.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/domains/{DomainId}", + "code": 200 + } + } + }, + "com.amazonaws.voiceid#UpdateDomainRequest": { + "type": "structure", + "members": { + "DomainId": { + "target": "com.amazonaws.voiceid#DomainId", + "traits": { + "smithy.api#documentation": "

The identifier of the domain to be updated.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "Name": { + "target": "com.amazonaws.voiceid#DomainName", + "traits": { + "smithy.api#documentation": "

The name of the domain.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "com.amazonaws.voiceid#Description", + "traits": { + "smithy.api#documentation": "

A brief description about this domain.

" + } + }, + "ServerSideEncryptionConfiguration": { + "target": "com.amazonaws.voiceid#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The configuration, containing the KMS Key Identifier, to be used by Voice ID for the server-side\n encryption of your data. Note that all the existing data in the domain are still encrypted using the\n existing key, only the data added to domain after updating the key is encrypted using the new key.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.voiceid#UpdateDomainResponse": { + "type": "structure", + "members": { + "Domain": { + "target": "com.amazonaws.voiceid#Domain", + "traits": { + "smithy.api#documentation": "

Details about the updated domain

" + } + } + } + }, + "com.amazonaws.voiceid#ValidationException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.voiceid#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request failed one or more validations; check the error message for more details.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.voiceid#VoiceID": { + "type": "service", + "version": "2021-09-27", + "operations": [ + { + "target": "com.amazonaws.voiceid#CreateDomain" + }, + { + "target": "com.amazonaws.voiceid#DeleteDomain" + }, + { + "target": "com.amazonaws.voiceid#DeleteFraudster" + }, + { + "target": "com.amazonaws.voiceid#DeleteSpeaker" + }, + { + "target": "com.amazonaws.voiceid#DescribeDomain" + }, + { + "target": "com.amazonaws.voiceid#DescribeFraudster" + }, + { + "target": "com.amazonaws.voiceid#DescribeFraudsterRegistrationJob" + }, + { + "target": "com.amazonaws.voiceid#DescribeSpeaker" + }, + { + "target": "com.amazonaws.voiceid#DescribeSpeakerEnrollmentJob" + }, + { + "target": "com.amazonaws.voiceid#EvaluateSession" + }, + { + "target": "com.amazonaws.voiceid#ListDomains" + }, + { + "target": "com.amazonaws.voiceid#ListFraudsterRegistrationJobs" + }, + { + "target": "com.amazonaws.voiceid#ListSpeakerEnrollmentJobs" + }, + { + "target": "com.amazonaws.voiceid#ListSpeakers" + }, + { + "target": "com.amazonaws.voiceid#ListTagsForResource" + }, + { + "target": "com.amazonaws.voiceid#OptOutSpeaker" + }, + { + "target": "com.amazonaws.voiceid#StartFraudsterRegistrationJob" + }, + { + "target": "com.amazonaws.voiceid#StartSpeakerEnrollmentJob" + }, + { + "target": "com.amazonaws.voiceid#TagResource" + }, + { + "target": "com.amazonaws.voiceid#UntagResource" + }, + { + "target": "com.amazonaws.voiceid#UpdateDomain" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "Voice ID", + "arnNamespace": "voiceid", + "cloudFormationName": "VoiceID", + "cloudTrailEventSource": "voiceid.amazonaws.com", + "endpointPrefix": "voiceid" + }, + "aws.auth#sigv4": { + "name": "voiceid" + }, + "aws.protocols#awsJson1_0": {}, + "smithy.api#documentation": "

Amazon Connect Voice ID provides real-time caller authentication and fraud screening. This guide\n describes the APIs used for this service.\n

", + "smithy.api#title": "Amazon Voice ID" + } + } + } +} \ No newline at end of file diff --git a/codegen/sdk-codegen/aws-models/wisdom.2020-10-19.json b/codegen/sdk-codegen/aws-models/wisdom.2020-10-19.json new file mode 100644 index 00000000000..09b5f68738f --- /dev/null +++ b/codegen/sdk-codegen/aws-models/wisdom.2020-10-19.json @@ -0,0 +1,3976 @@ +{ + "smithy": "1.0", + "shapes": { + "com.amazonaws.wisdom#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.wisdom#AppIntegrationsConfiguration": { + "type": "structure", + "members": { + "appIntegrationArn": { + "target": "com.amazonaws.wisdom#GenericArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the AppIntegrations DataIntegration to use for ingesting content.

", + "smithy.api#required": {} + } + }, + "objectFields": { + "target": "com.amazonaws.wisdom#ObjectFieldsList", + "traits": { + "smithy.api#documentation": "

The fields from the source that are made available to your agents in Wisdom.

\n \n

Make sure to include additional field(s); these are indexed and used to source\n recommendations.

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

Configuration information for Amazon AppIntegrations to automatically ingest content.

" + } + }, + "com.amazonaws.wisdom#Arn": { + "type": "string", + "traits": { + "smithy.api#pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$" + } + }, + "com.amazonaws.wisdom#Assistant": { + "type": "resource", + "identifiers": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + } + }, + "create": { + "target": "com.amazonaws.wisdom#CreateAssistant" + }, + "read": { + "target": "com.amazonaws.wisdom#GetAssistant" + }, + "delete": { + "target": "com.amazonaws.wisdom#DeleteAssistant" + }, + "list": { + "target": "com.amazonaws.wisdom#ListAssistants" + }, + "operations": [ + { + "target": "com.amazonaws.wisdom#GetRecommendations" + }, + { + "target": "com.amazonaws.wisdom#NotifyRecommendationsReceived" + }, + { + "target": "com.amazonaws.wisdom#QueryAssistant" + }, + { + "target": "com.amazonaws.wisdom#SearchSessions" + } + ], + "resources": [ + { + "target": "com.amazonaws.wisdom#AssistantAssociation" + }, + { + "target": "com.amazonaws.wisdom#Session" + } + ], + "traits": { + "aws.api#arn": { + "template": "assistant/{assistantId}", + "absolute": false, + "noAccount": false, + "noRegion": false + }, + "aws.cloudformation#cfnResource": {}, + "aws.iam#disableConditionKeyInference": {} + } + }, + "com.amazonaws.wisdom#AssistantAssociation": { + "type": "resource", + "identifiers": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + }, + "assistantAssociationId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + } + }, + "create": { + "target": "com.amazonaws.wisdom#CreateAssistantAssociation" + }, + "read": { + "target": "com.amazonaws.wisdom#GetAssistantAssociation" + }, + "delete": { + "target": "com.amazonaws.wisdom#DeleteAssistantAssociation" + }, + "list": { + "target": "com.amazonaws.wisdom#ListAssistantAssociations" + }, + "traits": { + "aws.api#arn": { + "template": "association/{assistantId}/{assistantAssociationId}", + "absolute": false, + "noAccount": false, + "noRegion": false + }, + "aws.cloudformation#cfnResource": {}, + "aws.iam#disableConditionKeyInference": {} + } + }, + "com.amazonaws.wisdom#AssistantAssociationData": { + "type": "structure", + "members": { + "assistantAssociationId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the assistant association.

", + "smithy.api#required": {} + } + }, + "assistantAssociationArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the assistant association.

", + "smithy.api#required": {} + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant.

", + "smithy.api#required": {} + } + }, + "assistantArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Wisdom assistant

", + "smithy.api#required": {} + } + }, + "associationType": { + "target": "com.amazonaws.wisdom#AssociationType", + "traits": { + "smithy.api#documentation": "

The type of association.

", + "smithy.api#required": {} + } + }, + "associationData": { + "target": "com.amazonaws.wisdom#AssistantAssociationOutputData", + "traits": { + "smithy.api#documentation": "

A union type that currently has a single argument, the knowledge base ID.

", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

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

Information about the assistant association.

", + "smithy.api#references": [ + { + "resource": "com.amazonaws.wisdom#AssistantAssociation" + } + ] + } + }, + "com.amazonaws.wisdom#AssistantAssociationInputData": { + "type": "union", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base.

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

The data that is input into Wisdom as a result of the assistant association.

" + } + }, + "com.amazonaws.wisdom#AssistantAssociationOutputData": { + "type": "union", + "members": { + "knowledgeBaseAssociation": { + "target": "com.amazonaws.wisdom#KnowledgeBaseAssociationData", + "traits": { + "smithy.api#documentation": "

The knowledge base where output data is sent.

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

The data that is output as a result of the assistant association.

" + } + }, + "com.amazonaws.wisdom#AssistantAssociationSummary": { + "type": "structure", + "members": { + "assistantAssociationId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the assistant association.

", + "smithy.api#required": {} + } + }, + "assistantAssociationArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the assistant association.

", + "smithy.api#required": {} + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant.

", + "smithy.api#required": {} + } + }, + "assistantArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Wisdom assistant

", + "smithy.api#required": {} + } + }, + "associationType": { + "target": "com.amazonaws.wisdom#AssociationType", + "traits": { + "smithy.api#documentation": "

The type of association.

", + "smithy.api#required": {} + } + }, + "associationData": { + "target": "com.amazonaws.wisdom#AssistantAssociationOutputData", + "traits": { + "smithy.api#documentation": "

The association data.

", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

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

Summary information about the assistant association.

", + "smithy.api#references": [ + { + "resource": "com.amazonaws.wisdom#AssistantAssociation" + } + ] + } + }, + "com.amazonaws.wisdom#AssistantAssociationSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#AssistantAssociationSummary" + } + }, + "com.amazonaws.wisdom#AssistantData": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant.

", + "smithy.api#required": {} + } + }, + "assistantArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Wisdom assistant

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name.

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.wisdom#AssistantType", + "traits": { + "smithy.api#documentation": "

The type of assistant.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.wisdom#AssistantStatus", + "traits": { + "smithy.api#documentation": "

The status of the assistant.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.wisdom#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The KMS key used for encryption.

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

The assistant data.

" + } + }, + "com.amazonaws.wisdom#AssistantList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#AssistantSummary" + } + }, + "com.amazonaws.wisdom#AssistantStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATE_IN_PROGRESS", + "name": "CREATE_IN_PROGRESS" + }, + { + "value": "CREATE_FAILED", + "name": "CREATE_FAILED" + }, + { + "value": "ACTIVE", + "name": "ACTIVE" + }, + { + "value": "DELETE_IN_PROGRESS", + "name": "DELETE_IN_PROGRESS" + }, + { + "value": "DELETE_FAILED", + "name": "DELETE_FAILED" + }, + { + "value": "DELETED", + "name": "DELETED" + } + ] + } + }, + "com.amazonaws.wisdom#AssistantSummary": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant.

", + "smithy.api#required": {} + } + }, + "assistantArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Wisdom assistant

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the assistant.

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.wisdom#AssistantType", + "traits": { + "smithy.api#documentation": "

The type of the assistant.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.wisdom#AssistantStatus", + "traits": { + "smithy.api#documentation": "

The status of the assistant.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description of the assistant.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.wisdom#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The KMS key used for encryption.

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

Summary information about the assistant.

" + } + }, + "com.amazonaws.wisdom#AssistantType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "AGENT", + "name": "AGENT" + } + ] + } + }, + "com.amazonaws.wisdom#AssociationType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "KNOWLEDGE_BASE", + "name": "KNOWLEDGE_BASE" + } + ] + } + }, + "com.amazonaws.wisdom#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 4096 + } + } + }, + "com.amazonaws.wisdom#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request could not be processed because of conflict in the current state of the\n resource. For example, if you're using a Create API (such as\n CreateAssistant) that accepts name, a conflicting resource (usually with the\n same name) is being created or mutated.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.wisdom#Content": { + "type": "resource", + "identifiers": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + }, + "contentId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + } + }, + "create": { + "target": "com.amazonaws.wisdom#CreateContent" + }, + "read": { + "target": "com.amazonaws.wisdom#GetContent" + }, + "update": { + "target": "com.amazonaws.wisdom#UpdateContent" + }, + "delete": { + "target": "com.amazonaws.wisdom#DeleteContent" + }, + "list": { + "target": "com.amazonaws.wisdom#ListContents" + }, + "operations": [ + { + "target": "com.amazonaws.wisdom#GetContentSummary" + } + ], + "traits": { + "aws.api#arn": { + "template": "content/{knowledgeBaseId}/{contentId}", + "absolute": false, + "noAccount": false, + "noRegion": false + }, + "aws.iam#disableConditionKeyInference": {} + } + }, + "com.amazonaws.wisdom#ContentData": { + "type": "structure", + "members": { + "contentArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the content.

", + "smithy.api#required": {} + } + }, + "contentId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the content.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the knowledge base.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the content.

", + "smithy.api#required": {} + } + }, + "revisionId": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The identifier of the content revision.

", + "smithy.api#required": {} + } + }, + "title": { + "target": "com.amazonaws.wisdom#ContentTitle", + "traits": { + "smithy.api#documentation": "

The title of the content.

", + "smithy.api#required": {} + } + }, + "contentType": { + "target": "com.amazonaws.wisdom#ContentType", + "traits": { + "smithy.api#documentation": "

The media type of the content.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.wisdom#ContentStatus", + "traits": { + "smithy.api#documentation": "

The status of the content.

", + "smithy.api#required": {} + } + }, + "metadata": { + "target": "com.amazonaws.wisdom#ContentMetadata", + "traits": { + "smithy.api#documentation": "

A key/value map to store attributes without affecting tagging or recommendations. \nFor example, when synchronizing data between an external system and Wisdom, you can store an external version identifier as metadata to utilize for determining drift.

", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + }, + "linkOutUri": { + "target": "com.amazonaws.wisdom#Uri", + "traits": { + "smithy.api#documentation": "

The URI of the content.

" + } + }, + "url": { + "target": "com.amazonaws.wisdom#Url", + "traits": { + "smithy.api#documentation": "

The URL of the content.

", + "smithy.api#required": {}, + "smithy.api#sensitive": {} + } + }, + "urlExpiry": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The expiration time of the URL as an epoch timestamp.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "epoch-seconds" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the content.

", + "smithy.api#references": [ + { + "resource": "com.amazonaws.wisdom#Content" + }, + { + "resource": "com.amazonaws.wisdom#KnowledgeBase" + } + ] + } + }, + "com.amazonaws.wisdom#ContentMetadata": { + "type": "map", + "key": { + "target": "com.amazonaws.wisdom#NonEmptyString" + }, + "value": { + "target": "com.amazonaws.wisdom#NonEmptyString" + } + }, + "com.amazonaws.wisdom#ContentReference": { + "type": "structure", + "members": { + "knowledgeBaseArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the knowledge base.

" + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base.

" + } + }, + "contentArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the content.

" + } + }, + "contentId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the content.

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

Reference information about the content.

" + } + }, + "com.amazonaws.wisdom#ContentStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATE_IN_PROGRESS", + "name": "CREATE_IN_PROGRESS" + }, + { + "value": "CREATE_FAILED", + "name": "CREATE_FAILED" + }, + { + "value": "ACTIVE", + "name": "ACTIVE" + }, + { + "value": "DELETE_IN_PROGRESS", + "name": "DELETE_IN_PROGRESS" + }, + { + "value": "DELETE_FAILED", + "name": "DELETE_FAILED" + }, + { + "value": "DELETED", + "name": "DELETED" + }, + { + "value": "UPDATE_FAILED", + "name": "UPDATE_FAILED" + } + ] + } + }, + "com.amazonaws.wisdom#ContentSummary": { + "type": "structure", + "members": { + "contentArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the content.

", + "smithy.api#required": {} + } + }, + "contentId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the content.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the knowledge base.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the content.

", + "smithy.api#required": {} + } + }, + "revisionId": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The identifier of the revision of the content.

", + "smithy.api#required": {} + } + }, + "title": { + "target": "com.amazonaws.wisdom#ContentTitle", + "traits": { + "smithy.api#documentation": "

The title of the content.

", + "smithy.api#required": {} + } + }, + "contentType": { + "target": "com.amazonaws.wisdom#ContentType", + "traits": { + "smithy.api#documentation": "

The media type of the content.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.wisdom#ContentStatus", + "traits": { + "smithy.api#documentation": "

The status of the content.

", + "smithy.api#required": {} + } + }, + "metadata": { + "target": "com.amazonaws.wisdom#ContentMetadata", + "traits": { + "smithy.api#documentation": "

A key/value map to store attributes without affecting tagging or recommendations. \nFor example, when synchronizing data between an external system and Wisdom, you can store an external version identifier as metadata to utilize for determining drift.

", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

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

Summary information about the content.

", + "smithy.api#references": [ + { + "resource": "com.amazonaws.wisdom#Content" + }, + { + "resource": "com.amazonaws.wisdom#KnowledgeBase" + } + ] + } + }, + "com.amazonaws.wisdom#ContentSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#ContentSummary" + } + }, + "com.amazonaws.wisdom#ContentTitle": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + }, + "com.amazonaws.wisdom#ContentType": { + "type": "string", + "traits": { + "smithy.api#pattern": "^(text/(plain|html))|(application/x\\.wisdom-json;source=(salesforce|servicenow))$" + } + }, + "com.amazonaws.wisdom#CreateAssistant": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#CreateAssistantRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#CreateAssistantResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ConflictException" + }, + { + "target": "com.amazonaws.wisdom#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates an Amazon Connect Wisdom assistant.

", + "smithy.api#http": { + "method": "POST", + "uri": "/assistants", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#CreateAssistantAssociation": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#CreateAssistantAssociationRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#CreateAssistantAssociationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ConflictException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates an association between an Amazon Connect Wisdom assistant and another resource. Currently, the\n only supported association is with a knowledge base. An assistant can have only a single\n association.

", + "smithy.api#http": { + "method": "POST", + "uri": "/assistants/{assistantId}/associations", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#CreateAssistantAssociationRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "associationType": { + "target": "com.amazonaws.wisdom#AssociationType", + "traits": { + "smithy.api#documentation": "

The type of association.

", + "smithy.api#required": {} + } + }, + "association": { + "target": "com.amazonaws.wisdom#AssistantAssociationInputData", + "traits": { + "smithy.api#documentation": "

The identifier of the associated resource.

", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.wisdom#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request.

", + "smithy.api#idempotencyToken": {} + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateAssistantAssociationResponse": { + "type": "structure", + "members": { + "assistantAssociation": { + "target": "com.amazonaws.wisdom#AssistantAssociationData", + "traits": { + "smithy.api#documentation": "

The assistant association.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateAssistantRequest": { + "type": "structure", + "members": { + "clientToken": { + "target": "com.amazonaws.wisdom#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request.

", + "smithy.api#idempotencyToken": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the assistant.

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.wisdom#AssistantType", + "traits": { + "smithy.api#documentation": "

The type of assistant.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description of the assistant.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.wisdom#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The KMS key used for encryption.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateAssistantResponse": { + "type": "structure", + "members": { + "assistant": { + "target": "com.amazonaws.wisdom#AssistantData", + "traits": { + "smithy.api#documentation": "

Information about the assistant.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateContent": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#CreateContentRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#CreateContentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ConflictException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates Wisdom content. Before to calling this API, use StartContentUpload to\n upload an asset.

", + "smithy.api#http": { + "method": "POST", + "uri": "/knowledgeBases/{knowledgeBaseId}/contents", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#CreateContentRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the content. Each piece of content in a knowledge base must have a unique\n name. You can retrieve a piece of content using only its knowledge base and its name with the\n SearchContent API.

", + "smithy.api#required": {} + } + }, + "title": { + "target": "com.amazonaws.wisdom#ContentTitle", + "traits": { + "smithy.api#documentation": "

The title of the content. If not set, the title is equal to the name.

" + } + }, + "overrideLinkOutUri": { + "target": "com.amazonaws.wisdom#Uri", + "traits": { + "smithy.api#documentation": "

The URI you want to use for the article. If the knowledge base has a templateUri, setting\n this argument overrides it for this piece of content.

" + } + }, + "metadata": { + "target": "com.amazonaws.wisdom#ContentMetadata", + "traits": { + "smithy.api#documentation": "

A key/value map to store attributes without affecting tagging or recommendations. \nFor example, when synchronizing data between an external system and Wisdom, you can store an external version identifier as metadata to utilize for determining drift.

" + } + }, + "uploadId": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

A pointer to the uploaded asset. This value is returned by StartContentUpload.

", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request.

", + "smithy.api#idempotencyToken": {} + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateContentResponse": { + "type": "structure", + "members": { + "content": { + "target": "com.amazonaws.wisdom#ContentData", + "traits": { + "smithy.api#documentation": "

The content.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#CreateKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#CreateKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ConflictException" + }, + { + "target": "com.amazonaws.wisdom#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a knowledge base.

\n \n

When using this API, you cannot reuse Amazon AppIntegrations\n DataIntegrations with external knowledge bases such as Salesforce and ServiceNow. If you do,\n you'll get an InvalidRequestException error.

\n\n

For example, you're programmatically managing your external knowledge base, and you want\n to add or remove one of the fields that is being ingested from Salesforce. Do the\n following:

\n
    \n
  1. \n

    Call DeleteKnowledgeBase.

    \n
  2. \n
  3. \n

    Call DeleteDataIntegration.

    \n
  4. \n
  5. \n

    Call CreateDataIntegration to recreate the DataIntegration or a create different\n one.

    \n
  6. \n
  7. \n

    Call CreateKnowledgeBase.

    \n
  8. \n
\n
", + "smithy.api#http": { + "method": "POST", + "uri": "/knowledgeBases", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#CreateKnowledgeBaseRequest": { + "type": "structure", + "members": { + "clientToken": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request.

", + "smithy.api#idempotencyToken": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the knowledge base.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseType": { + "target": "com.amazonaws.wisdom#KnowledgeBaseType", + "traits": { + "smithy.api#documentation": "

The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your own content.\n EXTERNAL knowledge bases support integrations with third-party systems whose content is\n synchronized automatically.

", + "smithy.api#required": {} + } + }, + "sourceConfiguration": { + "target": "com.amazonaws.wisdom#SourceConfiguration", + "traits": { + "smithy.api#documentation": "

The source of the knowledge base content. Only set this argument for EXTERNAL knowledge\n bases.

" + } + }, + "renderingConfiguration": { + "target": "com.amazonaws.wisdom#RenderingConfiguration", + "traits": { + "smithy.api#documentation": "

Information about how to render the content.

" + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.wisdom#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The KMS key used for encryption.

" + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateKnowledgeBaseResponse": { + "type": "structure", + "members": { + "knowledgeBase": { + "target": "com.amazonaws.wisdom#KnowledgeBaseData", + "traits": { + "smithy.api#documentation": "

The knowledge base.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#CreateSessionRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#CreateSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#ConflictException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a session. A session is a contextual container used for generating\n recommendations. Amazon Connect creates a new Wisdom session for each contact on which Wisdom is\n enabled.

", + "smithy.api#http": { + "method": "POST", + "uri": "/assistants/{assistantId}/sessions", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#CreateSessionRequest": { + "type": "structure", + "members": { + "clientToken": { + "target": "com.amazonaws.wisdom#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request.

", + "smithy.api#idempotencyToken": {} + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the session.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + } + } + }, + "com.amazonaws.wisdom#CreateSessionResponse": { + "type": "structure", + "members": { + "session": { + "target": "com.amazonaws.wisdom#SessionData", + "traits": { + "smithy.api#documentation": "

The session.

" + } + } + } + }, + "com.amazonaws.wisdom#DeleteAssistant": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#DeleteAssistantRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#DeleteAssistantResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes an assistant.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/assistants/{assistantId}", + "code": 204 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#DeleteAssistantAssociation": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#DeleteAssistantAssociationRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#DeleteAssistantAssociationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes an assistant association.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/assistants/{assistantId}/associations/{assistantAssociationId}", + "code": 204 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#DeleteAssistantAssociationRequest": { + "type": "structure", + "members": { + "assistantAssociationId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the assistant association. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#DeleteAssistantAssociationResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.wisdom#DeleteAssistantRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#DeleteAssistantResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.wisdom#DeleteContent": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#DeleteContentRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#DeleteContentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the content.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}", + "code": 204 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#DeleteContentRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "contentId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#DeleteContentResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.wisdom#DeleteKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#DeleteKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#DeleteKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ConflictException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the knowledge base.

\n \n

When you use this API to delete an external knowledge base such as Salesforce or\n ServiceNow, you must also delete the Amazon AppIntegrations DataIntegration.\n This is because you can't reuse the DataIntegration after it's been associated with an\n external knowledge base. However, you can delete and recreate it. See DeleteDataIntegration and CreateDataIntegration in the Amazon AppIntegrations API\n Reference.

\n
", + "smithy.api#http": { + "method": "DELETE", + "uri": "/knowledgeBases/{knowledgeBaseId}", + "code": 204 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#DeleteKnowledgeBaseRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The knowledge base to delete content from. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#DeleteKnowledgeBaseResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.wisdom#Description": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s_.,-]+" + } + }, + "com.amazonaws.wisdom#Document": { + "type": "structure", + "members": { + "contentReference": { + "target": "com.amazonaws.wisdom#ContentReference", + "traits": { + "smithy.api#documentation": "

A reference to the content resource.

", + "smithy.api#required": {} + } + }, + "title": { + "target": "com.amazonaws.wisdom#DocumentText", + "traits": { + "smithy.api#documentation": "

The title of the document.

" + } + }, + "excerpt": { + "target": "com.amazonaws.wisdom#DocumentText", + "traits": { + "smithy.api#documentation": "

The excerpt from the document.

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

The document.

" + } + }, + "com.amazonaws.wisdom#DocumentText": { + "type": "structure", + "members": { + "text": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Text in the document.

", + "smithy.api#sensitive": {} + } + }, + "highlights": { + "target": "com.amazonaws.wisdom#Highlights", + "traits": { + "smithy.api#documentation": "

Highlights in the document text.

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

The text of the document.

" + } + }, + "com.amazonaws.wisdom#Filter": { + "type": "structure", + "members": { + "field": { + "target": "com.amazonaws.wisdom#FilterField", + "traits": { + "smithy.api#documentation": "

The field on which to filter.

", + "smithy.api#required": {} + } + }, + "operator": { + "target": "com.amazonaws.wisdom#FilterOperator", + "traits": { + "smithy.api#documentation": "

The operator to use for comparing the field’s value with the provided value.

", + "smithy.api#required": {} + } + }, + "value": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The desired field value on which to filter.

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

A search filter.

" + } + }, + "com.amazonaws.wisdom#FilterField": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "NAME", + "name": "NAME" + } + ] + } + }, + "com.amazonaws.wisdom#FilterList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#Filter" + } + }, + "com.amazonaws.wisdom#FilterOperator": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "EQUALS", + "name": "EQUALS" + } + ] + } + }, + "com.amazonaws.wisdom#GenericArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^arn:[a-z-]+?:[a-z-]+?:[a-z0-9-]*?:([0-9]{12})?:[a-zA-Z0-9-:/]+$" + } + }, + "com.amazonaws.wisdom#GetAssistant": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#GetAssistantRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#GetAssistantResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves information about an assistant.

", + "smithy.api#http": { + "method": "GET", + "uri": "/assistants/{assistantId}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#GetAssistantAssociation": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#GetAssistantAssociationRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#GetAssistantAssociationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves information about an assistant association.

", + "smithy.api#http": { + "method": "GET", + "uri": "/assistants/{assistantId}/associations/{assistantAssociationId}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#GetAssistantAssociationRequest": { + "type": "structure", + "members": { + "assistantAssociationId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the assistant association. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#GetAssistantAssociationResponse": { + "type": "structure", + "members": { + "assistantAssociation": { + "target": "com.amazonaws.wisdom#AssistantAssociationData", + "traits": { + "smithy.api#documentation": "

The assistant association.

" + } + } + } + }, + "com.amazonaws.wisdom#GetAssistantRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#GetAssistantResponse": { + "type": "structure", + "members": { + "assistant": { + "target": "com.amazonaws.wisdom#AssistantData", + "traits": { + "smithy.api#documentation": "

Information about the assistant.

" + } + } + } + }, + "com.amazonaws.wisdom#GetContent": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#GetContentRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#GetContentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves content, including a pre-signed URL to download the content.

", + "smithy.api#http": { + "method": "GET", + "uri": "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#GetContentRequest": { + "type": "structure", + "members": { + "contentId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#GetContentResponse": { + "type": "structure", + "members": { + "content": { + "target": "com.amazonaws.wisdom#ContentData", + "traits": { + "smithy.api#documentation": "

The content.

" + } + } + } + }, + "com.amazonaws.wisdom#GetContentSummary": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#GetContentSummaryRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#GetContentSummaryResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves summary information about the content.

", + "smithy.api#http": { + "method": "GET", + "uri": "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#GetContentSummaryRequest": { + "type": "structure", + "members": { + "contentId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#GetContentSummaryResponse": { + "type": "structure", + "members": { + "contentSummary": { + "target": "com.amazonaws.wisdom#ContentSummary", + "traits": { + "smithy.api#documentation": "

The content summary.

" + } + } + } + }, + "com.amazonaws.wisdom#GetKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#GetKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#GetKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves information about the knowledge base.

", + "smithy.api#http": { + "method": "GET", + "uri": "/knowledgeBases/{knowledgeBaseId}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#GetKnowledgeBaseRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#GetKnowledgeBaseResponse": { + "type": "structure", + "members": { + "knowledgeBase": { + "target": "com.amazonaws.wisdom#KnowledgeBaseData", + "traits": { + "smithy.api#documentation": "

The knowledge base.

" + } + } + } + }, + "com.amazonaws.wisdom#GetRecommendations": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#GetRecommendationsRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#GetRecommendationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves recommendations for the specified session. To avoid retrieving the same\n recommendations in subsequent calls, use NotifyRecommendationsReceived. This API supports long-polling behavior with the\n waitTimeSeconds parameter. Short poll is the default behavior and only returns\n recommendations already available. To perform a manual query against an assistant, use QueryAssistant.

", + "smithy.api#http": { + "method": "GET", + "uri": "/assistants/{assistantId}/sessions/{sessionId}/recommendations", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#GetRecommendationsRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "sessionId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.wisdom#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "waitTimeSeconds": { + "target": "com.amazonaws.wisdom#WaitTimeSeconds", + "traits": { + "smithy.api#documentation": "

The duration (in seconds) for which the call waits for a recommendation to be made\n available before returning. If a recommendation is available, the call returns sooner than\n WaitTimeSeconds. If no messages are available and the wait time expires, the\n call returns successfully with an empty list.

", + "smithy.api#httpQuery": "waitTimeSeconds" + } + } + } + }, + "com.amazonaws.wisdom#GetRecommendationsResponse": { + "type": "structure", + "members": { + "recommendations": { + "target": "com.amazonaws.wisdom#RecommendationList", + "traits": { + "smithy.api#documentation": "

The recommendations.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#GetSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#GetSessionRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#GetSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves information for a specified session.

", + "smithy.api#http": { + "method": "GET", + "uri": "/assistants/{assistantId}/sessions/{sessionId}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#GetSessionRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "sessionId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#GetSessionResponse": { + "type": "structure", + "members": { + "session": { + "target": "com.amazonaws.wisdom#SessionData", + "traits": { + "smithy.api#documentation": "

The session.

" + } + } + } + }, + "com.amazonaws.wisdom#Headers": { + "type": "map", + "key": { + "target": "com.amazonaws.wisdom#NonEmptyString" + }, + "value": { + "target": "com.amazonaws.wisdom#NonEmptyString" + } + }, + "com.amazonaws.wisdom#Highlight": { + "type": "structure", + "members": { + "beginOffsetInclusive": { + "target": "com.amazonaws.wisdom#HighlightOffset", + "traits": { + "smithy.api#documentation": "

The offset for the start of the highlight.

" + } + }, + "endOffsetExclusive": { + "target": "com.amazonaws.wisdom#HighlightOffset", + "traits": { + "smithy.api#documentation": "

The offset for the end of the highlight.

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

Offset specification to describe highlighting of document excerpts for rendering search\n results and recommendations.

" + } + }, + "com.amazonaws.wisdom#HighlightOffset": { + "type": "integer" + }, + "com.amazonaws.wisdom#Highlights": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#Highlight" + } + }, + "com.amazonaws.wisdom#KnowledgeBase": { + "type": "resource", + "identifiers": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + } + }, + "create": { + "target": "com.amazonaws.wisdom#CreateKnowledgeBase" + }, + "read": { + "target": "com.amazonaws.wisdom#GetKnowledgeBase" + }, + "delete": { + "target": "com.amazonaws.wisdom#DeleteKnowledgeBase" + }, + "list": { + "target": "com.amazonaws.wisdom#ListKnowledgeBases" + }, + "operations": [ + { + "target": "com.amazonaws.wisdom#RemoveKnowledgeBaseTemplateUri" + }, + { + "target": "com.amazonaws.wisdom#SearchContent" + }, + { + "target": "com.amazonaws.wisdom#StartContentUpload" + }, + { + "target": "com.amazonaws.wisdom#UpdateKnowledgeBaseTemplateUri" + } + ], + "resources": [ + { + "target": "com.amazonaws.wisdom#Content" + } + ], + "traits": { + "aws.api#arn": { + "template": "knowledge-base/{knowledgeBaseId}", + "absolute": false, + "noAccount": false, + "noRegion": false + }, + "aws.cloudformation#cfnResource": {}, + "aws.iam#disableConditionKeyInference": {} + } + }, + "com.amazonaws.wisdom#KnowledgeBaseAssociationData": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base.

" + } + }, + "knowledgeBaseArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the knowledge base.

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

Association information about the knowledge base.

" + } + }, + "com.amazonaws.wisdom#KnowledgeBaseData": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the knowledge base.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the knowledge base.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseType": { + "target": "com.amazonaws.wisdom#KnowledgeBaseType", + "traits": { + "smithy.api#documentation": "

The type of knowledge base.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.wisdom#KnowledgeBaseStatus", + "traits": { + "smithy.api#documentation": "

The status of the knowledge base.

", + "smithy.api#required": {} + } + }, + "lastContentModificationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

An epoch timestamp indicating the most recent content modification inside the knowledge\n base. If no content exists in a knowledge base, this value is unset.

", + "smithy.api#timestampFormat": "epoch-seconds" + } + }, + "sourceConfiguration": { + "target": "com.amazonaws.wisdom#SourceConfiguration", + "traits": { + "smithy.api#documentation": "

Source configuration information about the knowledge base.

" + } + }, + "renderingConfiguration": { + "target": "com.amazonaws.wisdom#RenderingConfiguration", + "traits": { + "smithy.api#documentation": "

Information about how to render the content.

" + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.wisdom#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The KMS key used for encryption.

" + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

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

Information about the knowledge base.

", + "smithy.api#references": [ + { + "resource": "com.amazonaws.wisdom#KnowledgeBase" + } + ] + } + }, + "com.amazonaws.wisdom#KnowledgeBaseList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#KnowledgeBaseSummary" + } + }, + "com.amazonaws.wisdom#KnowledgeBaseStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATE_IN_PROGRESS", + "name": "CREATE_IN_PROGRESS" + }, + { + "value": "CREATE_FAILED", + "name": "CREATE_FAILED" + }, + { + "value": "ACTIVE", + "name": "ACTIVE" + }, + { + "value": "DELETE_IN_PROGRESS", + "name": "DELETE_IN_PROGRESS" + }, + { + "value": "DELETE_FAILED", + "name": "DELETE_FAILED" + }, + { + "value": "DELETED", + "name": "DELETED" + } + ] + } + }, + "com.amazonaws.wisdom#KnowledgeBaseSummary": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the knowledge base.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the knowledge base.

", + "smithy.api#required": {} + } + }, + "knowledgeBaseType": { + "target": "com.amazonaws.wisdom#KnowledgeBaseType", + "traits": { + "smithy.api#documentation": "

The type of knowledge base.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.wisdom#KnowledgeBaseStatus", + "traits": { + "smithy.api#documentation": "

The status of the knowledge base summary.

", + "smithy.api#required": {} + } + }, + "sourceConfiguration": { + "target": "com.amazonaws.wisdom#SourceConfiguration", + "traits": { + "smithy.api#documentation": "

[KEVIN]

" + } + }, + "renderingConfiguration": { + "target": "com.amazonaws.wisdom#RenderingConfiguration", + "traits": { + "smithy.api#documentation": "

Information about how to render the content.

" + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.wisdom#ServerSideEncryptionConfiguration", + "traits": { + "smithy.api#documentation": "

The KMS key used for encryption.

" + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description of the knowledge base.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

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

Summary information about the knowledge base.

", + "smithy.api#references": [ + { + "resource": "com.amazonaws.wisdom#KnowledgeBase" + } + ] + } + }, + "com.amazonaws.wisdom#KnowledgeBaseType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "EXTERNAL", + "name": "EXTERNAL" + }, + { + "value": "CUSTOM", + "name": "CUSTOM" + } + ] + } + }, + "com.amazonaws.wisdom#ListAssistantAssociations": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#ListAssistantAssociationsRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#ListAssistantAssociationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists information about assistant associations.

", + "smithy.api#http": { + "method": "GET", + "uri": "/assistants/{assistantId}/associations", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "assistantAssociationSummaries", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#ListAssistantAssociationsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.wisdom#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#ListAssistantAssociationsResponse": { + "type": "structure", + "members": { + "assistantAssociationSummaries": { + "target": "com.amazonaws.wisdom#AssistantAssociationSummaryList", + "traits": { + "smithy.api#documentation": "

Summary information about assistant associations.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.wisdom#ListAssistants": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#ListAssistantsRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#ListAssistantsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists information about assistants.

", + "smithy.api#http": { + "method": "GET", + "uri": "/assistants", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "assistantSummaries", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#ListAssistantsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.wisdom#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + } + } + }, + "com.amazonaws.wisdom#ListAssistantsResponse": { + "type": "structure", + "members": { + "assistantSummaries": { + "target": "com.amazonaws.wisdom#AssistantList", + "traits": { + "smithy.api#documentation": "

Information about the assistants.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.wisdom#ListContents": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#ListContentsRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#ListContentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the content.

", + "smithy.api#http": { + "method": "GET", + "uri": "/knowledgeBases/{knowledgeBaseId}/contents", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "contentSummaries", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#ListContentsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.wisdom#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#ListContentsResponse": { + "type": "structure", + "members": { + "contentSummaries": { + "target": "com.amazonaws.wisdom#ContentSummaryList", + "traits": { + "smithy.api#documentation": "

Information about the content.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.wisdom#ListKnowledgeBases": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#ListKnowledgeBasesRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#ListKnowledgeBasesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the knowledge bases.

", + "smithy.api#http": { + "method": "GET", + "uri": "/knowledgeBases", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "knowledgeBaseSummaries", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#ListKnowledgeBasesRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.wisdom#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + } + } + }, + "com.amazonaws.wisdom#ListKnowledgeBasesResponse": { + "type": "structure", + "members": { + "knowledgeBaseSummaries": { + "target": "com.amazonaws.wisdom#KnowledgeBaseList", + "traits": { + "smithy.api#documentation": "

Information about the knowledge bases.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.wisdom#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the tags for the specified resource.

", + "smithy.api#http": { + "method": "GET", + "uri": "/tags/{resourceArn}", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

" + } + } + } + }, + "com.amazonaws.wisdom#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.wisdom#Name": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s_.,-]+" + } + }, + "com.amazonaws.wisdom#NextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, + "com.amazonaws.wisdom#NonEmptyString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 4096 + } + } + }, + "com.amazonaws.wisdom#NotifyRecommendationsReceived": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#NotifyRecommendationsReceivedRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#NotifyRecommendationsReceivedResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Removes the specified recommendations from the specified assistant's queue of newly\n available recommendations. You can use this API in conjunction with GetRecommendations and a waitTimeSeconds input for long-polling\n behavior and avoiding duplicate recommendations.

", + "smithy.api#http": { + "method": "POST", + "uri": "/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#NotifyRecommendationsReceivedError": { + "type": "structure", + "members": { + "recommendationId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The identifier of the recommendation that is in error.

" + } + }, + "message": { + "target": "com.amazonaws.wisdom#NotifyRecommendationsReceivedErrorMessage", + "traits": { + "smithy.api#documentation": "

A recommendation is causing an error.

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

An error occurred when creating a recommendation.

" + } + }, + "com.amazonaws.wisdom#NotifyRecommendationsReceivedErrorList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#NotifyRecommendationsReceivedError" + } + }, + "com.amazonaws.wisdom#NotifyRecommendationsReceivedErrorMessage": { + "type": "string" + }, + "com.amazonaws.wisdom#NotifyRecommendationsReceivedRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "sessionId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "recommendationIds": { + "target": "com.amazonaws.wisdom#RecommendationIdList", + "traits": { + "smithy.api#documentation": "

The identifiers of the recommendations.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#NotifyRecommendationsReceivedResponse": { + "type": "structure", + "members": { + "recommendationIds": { + "target": "com.amazonaws.wisdom#RecommendationIdList", + "traits": { + "smithy.api#documentation": "

The identifiers of the recommendations.

" + } + }, + "errors": { + "target": "com.amazonaws.wisdom#NotifyRecommendationsReceivedErrorList", + "traits": { + "smithy.api#documentation": "

The identifiers of recommendations that are causing errors.

" + } + } + } + }, + "com.amazonaws.wisdom#ObjectFieldsList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#NonEmptyString" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.wisdom#PreconditionFailedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The provided revisionId does not match, indicating the content has been\n modified since it was last read.

", + "smithy.api#error": "client", + "smithy.api#httpError": 412 + } + }, + "com.amazonaws.wisdom#QueryAssistant": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#QueryAssistantRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#QueryAssistantResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Performs a manual search against the specified assistant. To retrieve recommendations for\n an assistant, use GetRecommendations.\n

", + "smithy.api#http": { + "method": "POST", + "uri": "/assistants/{assistantId}/query", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "results", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#QueryAssistantRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "queryText": { + "target": "com.amazonaws.wisdom#QueryText", + "traits": { + "smithy.api#documentation": "

The text to search for.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

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

The maximum number of results to return per page.

" + } + } + } + }, + "com.amazonaws.wisdom#QueryAssistantResponse": { + "type": "structure", + "members": { + "results": { + "target": "com.amazonaws.wisdom#QueryResultsList", + "traits": { + "smithy.api#documentation": "

The results of the query.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.wisdom#QueryResultsList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#ResultData" + } + }, + "com.amazonaws.wisdom#QueryText": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.wisdom#RecommendationData": { + "type": "structure", + "members": { + "recommendationId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The identifier of the recommendation.

", + "smithy.api#required": {} + } + }, + "document": { + "target": "com.amazonaws.wisdom#Document", + "traits": { + "smithy.api#documentation": "

The recommended document.

", + "smithy.api#required": {} + } + }, + "relevanceScore": { + "target": "com.amazonaws.wisdom#RelevanceScore", + "traits": { + "smithy.api#documentation": "

The relevance score of the recommendation.

" + } + }, + "relevanceLevel": { + "target": "com.amazonaws.wisdom#RelevanceLevel", + "traits": { + "smithy.api#documentation": "

The relevance level of the recommendation.

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

Information about the recommendation.

" + } + }, + "com.amazonaws.wisdom#RecommendationIdList": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + }, + "com.amazonaws.wisdom#RecommendationList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#RecommendationData" + } + }, + "com.amazonaws.wisdom#RelevanceLevel": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "HIGH", + "name": "HIGH" + }, + { + "value": "MEDIUM", + "name": "MEDIUM" + }, + { + "value": "LOW", + "name": "LOW" + } + ] + } + }, + "com.amazonaws.wisdom#RelevanceScore": { + "type": "double", + "traits": { + "smithy.api#range": { + "min": 0.0 + } + } + }, + "com.amazonaws.wisdom#RemoveKnowledgeBaseTemplateUri": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#RemoveKnowledgeBaseTemplateUriRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#RemoveKnowledgeBaseTemplateUriResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Removes a URI template from a knowledge base.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/knowledgeBases/{knowledgeBaseId}/templateUri", + "code": 204 + } + } + }, + "com.amazonaws.wisdom#RemoveKnowledgeBaseTemplateUriRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#RemoveKnowledgeBaseTemplateUriResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.wisdom#RenderingConfiguration": { + "type": "structure", + "members": { + "templateUri": { + "target": "com.amazonaws.wisdom#Uri", + "traits": { + "smithy.api#documentation": "

A URI template containing exactly one variable in ${variableName} format.\n This can only be set for EXTERNAL knowledge bases. For Salesforce and ServiceNow,\n the variable must be one of the following:

\n \n\n

The variable is replaced with the actual value for a piece of content when calling GetContent.

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

Information about how to render the content.

" + } + }, + "com.amazonaws.wisdom#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + }, + "resourceName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The specified resource name.

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

The specified resource does not exist.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.wisdom#ResultData": { + "type": "structure", + "members": { + "resultId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the result data.

", + "smithy.api#required": {} + } + }, + "document": { + "target": "com.amazonaws.wisdom#Document", + "traits": { + "smithy.api#documentation": "

The document.

", + "smithy.api#required": {} + } + }, + "relevanceScore": { + "target": "com.amazonaws.wisdom#RelevanceScore", + "traits": { + "smithy.api#documentation": "

The relevance score of the results.

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

Information about the result.

" + } + }, + "com.amazonaws.wisdom#SearchContent": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#SearchContentRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#SearchContentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Searches for content in a specified knowledge base. Can be used to get a specific content\n resource by its name.

", + "smithy.api#http": { + "method": "POST", + "uri": "/knowledgeBases/{knowledgeBaseId}/search", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "contentSummaries", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#SearchContentRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.wisdom#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "searchExpression": { + "target": "com.amazonaws.wisdom#SearchExpression", + "traits": { + "smithy.api#documentation": "

The search expression to filter results.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#SearchContentResponse": { + "type": "structure", + "members": { + "contentSummaries": { + "target": "com.amazonaws.wisdom#ContentSummaryList", + "traits": { + "smithy.api#documentation": "

Summary information about the content.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.wisdom#SearchExpression": { + "type": "structure", + "members": { + "filters": { + "target": "com.amazonaws.wisdom#FilterList", + "traits": { + "smithy.api#documentation": "

The search expression filters.

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

The search expression.

" + } + }, + "com.amazonaws.wisdom#SearchSessions": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#SearchSessionsRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#SearchSessionsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Searches for sessions.

", + "smithy.api#http": { + "method": "POST", + "uri": "/assistants/{assistantId}/searchSessions", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "sessionSummaries", + "pageSize": "maxResults" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.wisdom#SearchSessionsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous \nresponse in the next request to retrieve the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.wisdom#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "searchExpression": { + "target": "com.amazonaws.wisdom#SearchExpression", + "traits": { + "smithy.api#documentation": "

The search expression to filter results.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#SearchSessionsResponse": { + "type": "structure", + "members": { + "sessionSummaries": { + "target": "com.amazonaws.wisdom#SessionSummaries", + "traits": { + "smithy.api#documentation": "

Summary information about the sessions.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.wisdom#NextToken", + "traits": { + "smithy.api#documentation": "

If there are additional results, this is the token for the next set of results.

" + } + } + } + }, + "com.amazonaws.wisdom#ServerSideEncryptionConfiguration": { + "type": "structure", + "members": { + "kmsKeyId": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The KMS key. For information about valid ID values, see Key identifiers (KeyId) in the\n AWS Key Management Service Developer Guide.

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

The KMS key used for encryption.

" + } + }, + "com.amazonaws.wisdom#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

You've exceeded your service quota. To perform the requested action, remove some of the\n relevant resources, or use service quotas to request a service quota increase.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.wisdom#Session": { + "type": "resource", + "identifiers": { + "assistantId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + }, + "sessionId": { + "target": "com.amazonaws.wisdom#UuidOrArn" + } + }, + "create": { + "target": "com.amazonaws.wisdom#CreateSession" + }, + "read": { + "target": "com.amazonaws.wisdom#GetSession" + }, + "traits": { + "aws.api#arn": { + "template": "session/{assistantId}/{sessionId}", + "absolute": false, + "noAccount": false, + "noRegion": false + }, + "aws.iam#disableConditionKeyInference": {} + } + }, + "com.amazonaws.wisdom#SessionData": { + "type": "structure", + "members": { + "sessionArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the session.

", + "smithy.api#required": {} + } + }, + "sessionId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the session.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.wisdom#Name", + "traits": { + "smithy.api#documentation": "

The name of the session.

", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.wisdom#Description", + "traits": { + "smithy.api#documentation": "

The description of the session.

" + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

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

Information about the session.

" + } + }, + "com.amazonaws.wisdom#SessionSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#SessionSummary" + } + }, + "com.amazonaws.wisdom#SessionSummary": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the session.

", + "smithy.api#required": {} + } + }, + "sessionArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the session.

", + "smithy.api#required": {} + } + }, + "assistantId": { + "target": "com.amazonaws.wisdom#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the Wisdom assistant.

", + "smithy.api#required": {} + } + }, + "assistantArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Wisdom assistant

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

Summary information about the session.

" + } + }, + "com.amazonaws.wisdom#SourceConfiguration": { + "type": "union", + "members": { + "appIntegrations": { + "target": "com.amazonaws.wisdom#AppIntegrationsConfiguration", + "traits": { + "smithy.api#documentation": "

Configuration information for Amazon AppIntegrations to automatically ingest content.

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

Configuration information about the external data source.

" + } + }, + "com.amazonaws.wisdom#StartContentUpload": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#StartContentUploadRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#StartContentUploadResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Get a URL to upload content to a knowledge base. To upload content, first make a PUT\n request to the returned URL with your file, making sure to include the required headers. Then\n use CreateContent to finalize the content creation process or UpdateContent to modify an existing resource. You can only upload content to a\n knowledge base of type CUSTOM.

", + "smithy.api#http": { + "method": "POST", + "uri": "/knowledgeBases/{knowledgeBaseId}/upload", + "code": 200 + } + } + }, + "com.amazonaws.wisdom#StartContentUploadRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "contentType": { + "target": "com.amazonaws.wisdom#ContentType", + "traits": { + "smithy.api#documentation": "

The type of content to upload.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#StartContentUploadResponse": { + "type": "structure", + "members": { + "uploadId": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The identifier of the upload.

", + "smithy.api#required": {} + } + }, + "url": { + "target": "com.amazonaws.wisdom#Url", + "traits": { + "smithy.api#documentation": "

The URL of the upload.

", + "smithy.api#required": {}, + "smithy.api#sensitive": {} + } + }, + "urlExpiry": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The expiration time of the URL as an epoch timestamp.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "epoch-seconds" + } + }, + "headersToInclude": { + "target": "com.amazonaws.wisdom#Headers", + "traits": { + "smithy.api#documentation": "

The headers to include in the upload.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^(?!aws:)[a-zA-Z+-=._:/]+$" + } + }, + "com.amazonaws.wisdom#TagKeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.wisdom#TagKey" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.wisdom#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#TooManyTagsException" + } + ], + "traits": { + "smithy.api#documentation": "

Adds the specified tags to the specified resource.

", + "smithy.api#http": { + "method": "POST", + "uri": "/tags/{resourceArn}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#TagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.wisdom#Tags", + "traits": { + "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#TagResourceResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.wisdom#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + } + } + }, + "com.amazonaws.wisdom#Tags": { + "type": "map", + "key": { + "target": "com.amazonaws.wisdom#TagKey" + }, + "value": { + "target": "com.amazonaws.wisdom#TagValue" + } + }, + "com.amazonaws.wisdom#TooManyTagsException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + }, + "resourceName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The specified resource name.

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

Amazon Connect Wisdom throws this exception if you have too many tags in your tag set.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.wisdom#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Removes the specified tags from the specified resource.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/tags/{resourceArn}", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.wisdom#UntagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.wisdom#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tagKeys": { + "target": "com.amazonaws.wisdom#TagKeyList", + "traits": { + "smithy.api#documentation": "

The tag keys.

", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#UntagResourceResponse": { + "type": "structure", + "members": {} + }, + "com.amazonaws.wisdom#UpdateContent": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#UpdateContentRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#UpdateContentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#PreconditionFailedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates information about the content.

", + "smithy.api#http": { + "method": "POST", + "uri": "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}", + "code": 200 + } + } + }, + "com.amazonaws.wisdom#UpdateContentRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "contentId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "revisionId": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

The revisionId of the content resource to update, taken from an earlier call\n to GetContent, GetContentSummary, SearchContent, or\n ListContents. If included, this argument acts as an optimistic lock to ensure\n content was not modified since it was last read. If it has been modified, this API throws a\n PreconditionFailedException.

" + } + }, + "title": { + "target": "com.amazonaws.wisdom#ContentTitle", + "traits": { + "smithy.api#documentation": "

The title of the content.

" + } + }, + "overrideLinkOutUri": { + "target": "com.amazonaws.wisdom#Uri", + "traits": { + "smithy.api#documentation": "

The URI for the article. If the knowledge base has a templateUri, setting this argument\n overrides it for this piece of content. To remove an existing overrideLinkOurUri,\n exclude this argument and set removeOverrideLinkOutUri to true.

" + } + }, + "removeOverrideLinkOutUri": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Unset the existing overrideLinkOutUri if it exists.

" + } + }, + "metadata": { + "target": "com.amazonaws.wisdom#ContentMetadata", + "traits": { + "smithy.api#documentation": "

A key/value map to store attributes without affecting tagging or recommendations. For\n example, when synchronizing data between an external system and Wisdom, you can store an\n external version identifier as metadata to utilize for determining drift.

" + } + }, + "uploadId": { + "target": "com.amazonaws.wisdom#NonEmptyString", + "traits": { + "smithy.api#documentation": "

A pointer to the uploaded asset. This value is returned by StartContentUpload.\n

" + } + } + } + }, + "com.amazonaws.wisdom#UpdateContentResponse": { + "type": "structure", + "members": { + "content": { + "target": "com.amazonaws.wisdom#ContentData", + "traits": { + "smithy.api#documentation": "

The content.

" + } + } + } + }, + "com.amazonaws.wisdom#UpdateKnowledgeBaseTemplateUri": { + "type": "operation", + "input": { + "target": "com.amazonaws.wisdom#UpdateKnowledgeBaseTemplateUriRequest" + }, + "output": { + "target": "com.amazonaws.wisdom#UpdateKnowledgeBaseTemplateUriResponse" + }, + "errors": [ + { + "target": "com.amazonaws.wisdom#AccessDeniedException" + }, + { + "target": "com.amazonaws.wisdom#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.wisdom#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates the template URI of a knowledge base. This is only supported for knowledge bases\n of type EXTERNAL. Include a single variable in ${variable} format; this\n interpolated by Wisdom using ingested content. For example, if you ingest a Salesforce\n article, it has an Id value, and you can set the template URI to\n https://myInstanceName.lightning.force.com/lightning/r/Knowledge__kav/*${Id}*/view.\n

", + "smithy.api#http": { + "method": "POST", + "uri": "/knowledgeBases/{knowledgeBaseId}/templateUri", + "code": 200 + } + } + }, + "com.amazonaws.wisdom#UpdateKnowledgeBaseTemplateUriRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.wisdom#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The the identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "templateUri": { + "target": "com.amazonaws.wisdom#Uri", + "traits": { + "smithy.api#documentation": "

The template URI to update.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.wisdom#UpdateKnowledgeBaseTemplateUriResponse": { + "type": "structure", + "members": { + "knowledgeBase": { + "target": "com.amazonaws.wisdom#KnowledgeBaseData", + "traits": { + "smithy.api#documentation": "

The knowledge base to update.

" + } + } + } + }, + "com.amazonaws.wisdom#Uri": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 4096 + } + } + }, + "com.amazonaws.wisdom#Url": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 4096 + } + } + }, + "com.amazonaws.wisdom#Uuid": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + } + }, + "com.amazonaws.wisdom#UuidOrArn": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$|^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$" + } + }, + "com.amazonaws.wisdom#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The input fails to satisfy the constraints specified by an AWS service.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.wisdom#WaitTimeSeconds": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 20 + } + } + }, + "com.amazonaws.wisdom#WisdomService": { + "type": "service", + "version": "2020-10-19", + "operations": [ + { + "target": "com.amazonaws.wisdom#ListTagsForResource" + }, + { + "target": "com.amazonaws.wisdom#TagResource" + }, + { + "target": "com.amazonaws.wisdom#UntagResource" + } + ], + "resources": [ + { + "target": "com.amazonaws.wisdom#Assistant" + }, + { + "target": "com.amazonaws.wisdom#KnowledgeBase" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "Wisdom", + "arnNamespace": "wisdom", + "cloudFormationName": "Wisdom", + "cloudTrailEventSource": "wisdom.amazonaws.com", + "endpointPrefix": "wisdom" + }, + "aws.auth#sigv4": { + "name": "wisdom" + }, + "aws.protocols#restJson1": {}, + "smithy.api#cors": {}, + "smithy.api#documentation": "

All Amazon Connect Wisdom functionality is accessible using the API. For example, you can create an\n assistant and a knowledge base.

\n\n

Some more advanced features are only accessible using the Wisdom API. For example, you\n can manually manage content by uploading custom files and control their lifecycle.

", + "smithy.api#title": "Amazon Connect Wisdom Service" + } + } + } +} \ No newline at end of file diff --git a/codegen/sdk-codegen/aws-models/workmail.2017-10-01.json b/codegen/sdk-codegen/aws-models/workmail.2017-10-01.json index a9a03acfdb3..d9dbe5a1252 100644 --- a/codegen/sdk-codegen/aws-models/workmail.2017-10-01.json +++ b/codegen/sdk-codegen/aws-models/workmail.2017-10-01.json @@ -110,7 +110,7 @@ "min": 1, "max": 64 }, - "smithy.api#pattern": "[a-zA-Z]+" + "smithy.api#pattern": "^[a-zA-Z]+$" } }, "com.amazonaws.workmail#AccessControlRuleDescription": { @@ -120,7 +120,7 @@ "min": 0, "max": 255 }, - "smithy.api#pattern": "[\\u0020-\\u00FF]+" + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$" } }, "com.amazonaws.workmail#AccessControlRuleEffect": { @@ -145,7 +145,7 @@ "min": 1, "max": 64 }, - "smithy.api#pattern": "[a-zA-Z0-9_-]+" + "smithy.api#pattern": "^[a-zA-Z0-9_-]+$" } }, "com.amazonaws.workmail#AccessControlRuleNameList": { @@ -1167,6 +1167,62 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#DeleteMobileDeviceAccessOverride": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#DeleteMobileDeviceAccessOverrideRequest" + }, + "output": { + "target": "com.amazonaws.workmail#DeleteMobileDeviceAccessOverrideResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#EntityNotFoundException" + }, + { + "target": "com.amazonaws.workmail#InvalidParameterException" + }, + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the mobile device access override for the given WorkMail organization, user, and device.

" + } + }, + "com.amazonaws.workmail#DeleteMobileDeviceAccessOverrideRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization for which the access override will be deleted.

", + "smithy.api#required": {} + } + }, + "UserId": { + "target": "com.amazonaws.workmail#EntityIdentifier", + "traits": { + "smithy.api#documentation": "

The WorkMail user for which you want to delete the override. Accepts the following types of user identities:

\n ", + "smithy.api#required": {} + } + }, + "DeviceId": { + "target": "com.amazonaws.workmail#DeviceId", + "traits": { + "smithy.api#documentation": "

The mobile device for which you delete the override. DeviceId is case insensitive.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.workmail#DeleteMobileDeviceAccessOverrideResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.workmail#DeleteMobileDeviceAccessRule": { "type": "operation", "input": { @@ -1996,7 +2052,17 @@ "min": 0, "max": 1023 }, - "smithy.api#pattern": "[\\S\\s]*" + "smithy.api#pattern": "^[\\S\\s]*$" + } + }, + "com.amazonaws.workmail#DeviceId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 32 + }, + "smithy.api#pattern": "^[A-Za-z0-9]+$" } }, "com.amazonaws.workmail#DeviceModel": { @@ -2006,7 +2072,7 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "[\\u0020-\\u00FF]+" + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$" } }, "com.amazonaws.workmail#DeviceModelList": { @@ -2028,7 +2094,7 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "[\\u0020-\\u00FF]+" + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$" } }, "com.amazonaws.workmail#DeviceOperatingSystemList": { @@ -2050,7 +2116,7 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "[\\u0020-\\u00FF]+" + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$" } }, "com.amazonaws.workmail#DeviceTypeList": { @@ -2072,7 +2138,7 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "[\\u0020-\\u00FF]+" + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$" } }, "com.amazonaws.workmail#DeviceUserAgentList": { @@ -2289,7 +2355,7 @@ "min": 3, "max": 255 }, - "smithy.api#pattern": "[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}" + "smithy.api#pattern": "^[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}$" } }, "com.amazonaws.workmail#Domains": { @@ -2311,7 +2377,7 @@ "min": 1, "max": 254 }, - "smithy.api#pattern": "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}" + "smithy.api#pattern": "^[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}$" } }, "com.amazonaws.workmail#EmailAddressInUseException": { @@ -2338,6 +2404,16 @@ "smithy.api#error": "client" } }, + "com.amazonaws.workmail#EntityIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9._%+@-]+$" + } + }, "com.amazonaws.workmail#EntityNotFoundException": { "type": "structure", "members": { @@ -2722,6 +2798,102 @@ } } }, + "com.amazonaws.workmail#GetMobileDeviceAccessOverride": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#GetMobileDeviceAccessOverrideRequest" + }, + "output": { + "target": "com.amazonaws.workmail#GetMobileDeviceAccessOverrideResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#EntityNotFoundException" + }, + { + "target": "com.amazonaws.workmail#InvalidParameterException" + }, + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + }, + { + "target": "com.amazonaws.workmail#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Gets the mobile device access override for the given WorkMail organization, user, and device.

" + } + }, + "com.amazonaws.workmail#GetMobileDeviceAccessOverrideRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization to which you want to apply the override.

", + "smithy.api#required": {} + } + }, + "UserId": { + "target": "com.amazonaws.workmail#EntityIdentifier", + "traits": { + "smithy.api#documentation": "

Identifies the WorkMail user for the override. Accepts the following types of user identities:

\n ", + "smithy.api#required": {} + } + }, + "DeviceId": { + "target": "com.amazonaws.workmail#DeviceId", + "traits": { + "smithy.api#documentation": "

The mobile device to which the override applies. DeviceId is case insensitive.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.workmail#GetMobileDeviceAccessOverrideResponse": { + "type": "structure", + "members": { + "UserId": { + "target": "com.amazonaws.workmail#WorkMailIdentifier", + "traits": { + "smithy.api#documentation": "

The WorkMail user to which the access override applies.

" + } + }, + "DeviceId": { + "target": "com.amazonaws.workmail#DeviceId", + "traits": { + "smithy.api#documentation": "

The device to which the access override applies.

" + } + }, + "Effect": { + "target": "com.amazonaws.workmail#MobileDeviceAccessRuleEffect", + "traits": { + "smithy.api#documentation": "

The effect of the override, ALLOW or DENY.

" + } + }, + "Description": { + "target": "com.amazonaws.workmail#MobileDeviceAccessRuleDescription", + "traits": { + "smithy.api#documentation": "

A description of the override.

" + } + }, + "DateCreated": { + "target": "com.amazonaws.workmail#Timestamp", + "traits": { + "smithy.api#documentation": "

The date the override was first created.

" + } + }, + "DateModified": { + "target": "com.amazonaws.workmail#Timestamp", + "traits": { + "smithy.api#documentation": "

The date the description was last modified.

" + } + } + } + }, "com.amazonaws.workmail#Group": { "type": "structure", "members": { @@ -2773,7 +2945,7 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "[\\u0020-\\u00FF]+" + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$" } }, "com.amazonaws.workmail#Groups": { @@ -2789,7 +2961,7 @@ "min": 1, "max": 32 }, - "smithy.api#pattern": "[\\S\\s]*" + "smithy.api#pattern": "^[\\S\\s]*$" } }, "com.amazonaws.workmail#IdempotencyClientToken": { @@ -2799,7 +2971,7 @@ "min": 1, "max": 128 }, - "smithy.api#pattern": "[\\x21-\\x7e]+" + "smithy.api#pattern": "^[\\x21-\\x7e]+$" } }, "com.amazonaws.workmail#InvalidConfigurationException": { @@ -2883,7 +3055,7 @@ "min": 20, "max": 2048 }, - "smithy.api#pattern": "arn:aws:kms:[a-z0-9-]*:[a-z0-9-]+:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}" + "smithy.api#pattern": "^arn:aws:kms:[a-z0-9-]*:[a-z0-9-]+:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$" } }, "com.amazonaws.workmail#LimitExceededException": { @@ -3330,6 +3502,90 @@ } } }, + "com.amazonaws.workmail#ListMobileDeviceAccessOverrides": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#ListMobileDeviceAccessOverridesRequest" + }, + "output": { + "target": "com.amazonaws.workmail#ListMobileDeviceAccessOverridesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#EntityNotFoundException" + }, + { + "target": "com.amazonaws.workmail#InvalidParameterException" + }, + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all the mobile device access overrides for any given combination of WorkMail organization, user, or device.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.workmail#ListMobileDeviceAccessOverridesRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization under which to list mobile device access overrides.

", + "smithy.api#required": {} + } + }, + "UserId": { + "target": "com.amazonaws.workmail#EntityIdentifier", + "traits": { + "smithy.api#documentation": "

The WorkMail user under which you list the mobile device access overrides. Accepts the following types of user identities:

\n " + } + }, + "DeviceId": { + "target": "com.amazonaws.workmail#DeviceId", + "traits": { + "smithy.api#documentation": "

The mobile device to which the access override applies.

" + } + }, + "NextToken": { + "target": "com.amazonaws.workmail#NextToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. The first call does not require a token.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.workmail#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return in a single call.

" + } + } + } + }, + "com.amazonaws.workmail#ListMobileDeviceAccessOverridesResponse": { + "type": "structure", + "members": { + "Overrides": { + "target": "com.amazonaws.workmail#MobileDeviceAccessOverridesList", + "traits": { + "smithy.api#documentation": "

The list of mobile device access overrides that exist for the specified Amazon WorkMail organization and user.

" + } + }, + "NextToken": { + "target": "com.amazonaws.workmail#NextToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. The value is “null” when there are no more results to return.

" + } + } + } + }, "com.amazonaws.workmail#ListMobileDeviceAccessRules": { "type": "operation", "input": { @@ -3727,7 +3983,7 @@ "min": 1, "max": 1024 }, - "smithy.api#pattern": "[\\S\\s]*" + "smithy.api#pattern": "^[\\S\\s]*$" } }, "com.amazonaws.workmail#MailboxExportJob": { @@ -3799,7 +4055,7 @@ "min": 1, "max": 63 }, - "smithy.api#pattern": "[A-Za-z0-9-]+" + "smithy.api#pattern": "^[A-Za-z0-9-]+$" } }, "com.amazonaws.workmail#MailboxExportJobState": { @@ -3949,6 +4205,56 @@ } } }, + "com.amazonaws.workmail#MobileDeviceAccessOverride": { + "type": "structure", + "members": { + "UserId": { + "target": "com.amazonaws.workmail#WorkMailIdentifier", + "traits": { + "smithy.api#documentation": "

The WorkMail user to which the access override applies.

" + } + }, + "DeviceId": { + "target": "com.amazonaws.workmail#DeviceId", + "traits": { + "smithy.api#documentation": "

The device to which the override applies.

" + } + }, + "Effect": { + "target": "com.amazonaws.workmail#MobileDeviceAccessRuleEffect", + "traits": { + "smithy.api#documentation": "

The effect of the override, ALLOW or DENY.

" + } + }, + "Description": { + "target": "com.amazonaws.workmail#MobileDeviceAccessRuleDescription", + "traits": { + "smithy.api#documentation": "

A description of the override.

" + } + }, + "DateCreated": { + "target": "com.amazonaws.workmail#Timestamp", + "traits": { + "smithy.api#documentation": "

The date the override was first created.

" + } + }, + "DateModified": { + "target": "com.amazonaws.workmail#Timestamp", + "traits": { + "smithy.api#documentation": "

The date the override was last modified.

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

The override object.

" + } + }, + "com.amazonaws.workmail#MobileDeviceAccessOverridesList": { + "type": "list", + "member": { + "target": "com.amazonaws.workmail#MobileDeviceAccessOverride" + } + }, "com.amazonaws.workmail#MobileDeviceAccessRule": { "type": "structure", "members": { @@ -4048,7 +4354,7 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "[\\S\\s]+" + "smithy.api#pattern": "^[\\S\\s]+$" } }, "com.amazonaws.workmail#MobileDeviceAccessRuleEffect": { @@ -4073,7 +4379,7 @@ "min": 1, "max": 64 }, - "smithy.api#pattern": "[a-zA-Z0-9_-]+" + "smithy.api#pattern": "^[a-zA-Z0-9_-]+$" } }, "com.amazonaws.workmail#MobileDeviceAccessRuleName": { @@ -4083,7 +4389,7 @@ "min": 1, "max": 64 }, - "smithy.api#pattern": "[\\S\\s]+" + "smithy.api#pattern": "^[\\S\\s]+$" } }, "com.amazonaws.workmail#MobileDeviceAccessRulesList": { @@ -4117,7 +4423,7 @@ "min": 1, "max": 1024 }, - "smithy.api#pattern": "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}" + "smithy.api#pattern": "^[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}$" } }, "com.amazonaws.workmail#OrganizationId": { @@ -4137,7 +4443,7 @@ "min": 1, "max": 62 }, - "smithy.api#pattern": "^(?!d-)([\\da-zA-Z]+)([-][\\da-zA-Z]+)*" + "smithy.api#pattern": "^(?!d-)([\\da-zA-Z]+)([-][\\da-zA-Z]+)*$" } }, "com.amazonaws.workmail#OrganizationNotFoundException": { @@ -4215,7 +4521,7 @@ "min": 0, "max": 256 }, - "smithy.api#pattern": "[\\u0020-\\u00FF]+", + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$", "smithy.api#sensitive": {} } }, @@ -4295,7 +4601,7 @@ "min": 0, "max": 256 }, - "smithy.api#pattern": "[\\w\\d\\s\\S\\-!?=,.;:'_]+", + "smithy.api#pattern": "^[\\w\\d\\s\\S\\-!?=,.;:'_]+$", "smithy.api#sensitive": {} } }, @@ -4468,6 +4774,78 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#PutMobileDeviceAccessOverride": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#PutMobileDeviceAccessOverrideRequest" + }, + "output": { + "target": "com.amazonaws.workmail#PutMobileDeviceAccessOverrideResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#EntityNotFoundException" + }, + { + "target": "com.amazonaws.workmail#EntityStateException" + }, + { + "target": "com.amazonaws.workmail#InvalidParameterException" + }, + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates or updates a mobile device access override for the given WorkMail organization, user, and device.

" + } + }, + "com.amazonaws.workmail#PutMobileDeviceAccessOverrideRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

Identifies the Amazon WorkMail organization for which you create the override.

", + "smithy.api#required": {} + } + }, + "UserId": { + "target": "com.amazonaws.workmail#EntityIdentifier", + "traits": { + "smithy.api#documentation": "

The WorkMail user for which you create the override. Accepts the following types of user identities:

\n ", + "smithy.api#required": {} + } + }, + "DeviceId": { + "target": "com.amazonaws.workmail#DeviceId", + "traits": { + "smithy.api#documentation": "

The mobile device for which you create the override. DeviceId is case insensitive.

", + "smithy.api#required": {} + } + }, + "Effect": { + "target": "com.amazonaws.workmail#MobileDeviceAccessRuleEffect", + "traits": { + "smithy.api#documentation": "

The effect of the override, ALLOW or DENY.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "com.amazonaws.workmail#MobileDeviceAccessRuleDescription", + "traits": { + "smithy.api#documentation": "

A description of the override.

" + } + } + } + }, + "com.amazonaws.workmail#PutMobileDeviceAccessOverrideResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.workmail#PutRetentionPolicy": { "type": "operation", "input": { @@ -4772,7 +5150,7 @@ "min": 1, "max": 20 }, - "smithy.api#pattern": "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9-]{2,})?" + "smithy.api#pattern": "^[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9-]{2,})?$" } }, "com.amazonaws.workmail#ResourceNotFoundException": { @@ -4854,7 +5232,7 @@ "min": 1, "max": 63 }, - "smithy.api#pattern": "[A-Za-z0-9.-]+" + "smithy.api#pattern": "^[A-Za-z0-9.-]+$" } }, "com.amazonaws.workmail#S3ObjectKey": { @@ -4864,7 +5242,7 @@ "min": 1, "max": 1023 }, - "smithy.api#pattern": "[A-Za-z0-9!_.*'()/-]+" + "smithy.api#pattern": "^[A-Za-z0-9!_.*'()/-]+$" } }, "com.amazonaws.workmail#ShortString": { @@ -4874,7 +5252,7 @@ "min": 1, "max": 64 }, - "smithy.api#pattern": "[a-zA-Z0-9_-]+" + "smithy.api#pattern": "^[a-zA-Z0-9_-]+$" } }, "com.amazonaws.workmail#StartMailboxExportJob": { @@ -5576,7 +5954,7 @@ "min": 1, "max": 64 }, - "smithy.api#pattern": "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9-]{2,})?" + "smithy.api#pattern": "^[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9-]{2,})?$" } }, "com.amazonaws.workmail#UserRole": { @@ -5656,6 +6034,9 @@ { "target": "com.amazonaws.workmail#DeleteMailboxPermissions" }, + { + "target": "com.amazonaws.workmail#DeleteMobileDeviceAccessOverride" + }, { "target": "com.amazonaws.workmail#DeleteMobileDeviceAccessRule" }, @@ -5707,6 +6088,9 @@ { "target": "com.amazonaws.workmail#GetMobileDeviceAccessEffect" }, + { + "target": "com.amazonaws.workmail#GetMobileDeviceAccessOverride" + }, { "target": "com.amazonaws.workmail#ListAccessControlRules" }, @@ -5725,6 +6109,9 @@ { "target": "com.amazonaws.workmail#ListMailboxPermissions" }, + { + "target": "com.amazonaws.workmail#ListMobileDeviceAccessOverrides" + }, { "target": "com.amazonaws.workmail#ListMobileDeviceAccessRules" }, @@ -5749,6 +6136,9 @@ { "target": "com.amazonaws.workmail#PutMailboxPermissions" }, + { + "target": "com.amazonaws.workmail#PutMobileDeviceAccessOverride" + }, { "target": "com.amazonaws.workmail#PutRetentionPolicy" }, diff --git a/codegen/sdk-codegen/aws-models/workspaces.2015-04-08.json b/codegen/sdk-codegen/aws-models/workspaces.2015-04-08.json index 03dc71bbadd..849aacd66ee 100644 --- a/codegen/sdk-codegen/aws-models/workspaces.2015-04-08.json +++ b/codegen/sdk-codegen/aws-models/workspaces.2015-04-08.json @@ -493,7 +493,7 @@ "OwnerAccountId": { "target": "com.amazonaws.workspaces#AwsAccount", "traits": { - "smithy.api#documentation": "

The identifier of the AWS account that owns the connection alias.

" + "smithy.api#documentation": "

The identifier of the Amazon Web Services account that owns the connection alias.

" } }, "Associations": { @@ -519,7 +519,7 @@ "AssociatedAccountId": { "target": "com.amazonaws.workspaces#AwsAccount", "traits": { - "smithy.api#documentation": "

The identifier of the AWS account that associated the connection alias with a directory.

" + "smithy.api#documentation": "

The identifier of the Amazon Web Services account that associated the connection alias with a directory.

" } }, "ResourceId": { @@ -591,14 +591,14 @@ "SharedAccountId": { "target": "com.amazonaws.workspaces#AwsAccount", "traits": { - "smithy.api#documentation": "

The identifier of the AWS account that the connection alias is shared with.

", + "smithy.api#documentation": "

The identifier of the Amazon Web Services account that the connection alias is shared with.

", "smithy.api#required": {} } }, "AllowAssociation": { "target": "com.amazonaws.workspaces#BooleanObject", "traits": { - "smithy.api#documentation": "

Indicates whether the specified AWS account is allowed to associate the connection alias with a directory.

", + "smithy.api#documentation": "

Indicates whether the specified Amazon Web Services account is allowed to associate the connection alias with a directory.

", "smithy.api#required": {} } } @@ -709,7 +709,7 @@ } ], "traits": { - "smithy.api#documentation": "

Copies the specified image from the specified Region to the current Region. \n For more information about copying images, see \n \n Copy a Custom WorkSpaces Image.

\n \n \n

In the China (Ningxia) Region, you can copy images only within the same Region.

\n \n

In the AWS GovCloud (US-West) Region, to copy images to and from other AWS Regions, \n contact AWS Support.

\n
\n \n \n

Before copying a shared image, be sure to verify that it has been shared from the\n correct AWS account. To determine if an image has been shared and to see the AWS \n account ID that owns an image, use the DescribeWorkSpaceImages and DescribeWorkspaceImagePermissions API operations.

\n
" + "smithy.api#documentation": "

Copies the specified image from the specified Region to the current Region. \n For more information about copying images, see \n \n Copy a Custom WorkSpaces Image.

\n \n

In the China (Ningxia) Region, you can copy images only within the same Region.

\n \n

In Amazon Web Services GovCloud (US), to copy images to and from other Regions, contact Amazon Web Services Support.

\n \n \n

Before copying a shared image, be sure to verify that it has been shared from the\n correct Amazon Web Services account. To determine if an image has been shared and to see the \n ID of the Amazon Web Services account that owns an image, use the DescribeWorkSpaceImages and DescribeWorkspaceImagePermissions API operations.

\n
" } }, "com.amazonaws.workspaces#CopyWorkspaceImageRequest": { @@ -799,7 +799,7 @@ "ConnectionString": { "target": "com.amazonaws.workspaces#ConnectionString", "traits": { - "smithy.api#documentation": "

A connection string in the form of a fully qualified domain name (FQDN), such as www.example.com.

\n \n \n

After you create a connection string, it is always associated to your AWS account. You cannot recreate the same \n connection string with a different account, even if you delete all instances of it from the original account. The \n connection string is globally reserved for your account.

\n
", + "smithy.api#documentation": "

A connection string in the form of a fully qualified domain name (FQDN), such as www.example.com.

\n \n \n

After you create a connection string, it is always associated to your Amazon Web Services account. You cannot recreate the same \n connection string with a different account, even if you delete all instances of it from the original account. The \n connection string is globally reserved for your account.

\n
", "smithy.api#required": {} } }, @@ -938,6 +938,84 @@ "type": "structure", "members": {} }, + "com.amazonaws.workspaces#CreateUpdatedWorkspaceImage": { + "type": "operation", + "input": { + "target": "com.amazonaws.workspaces#CreateUpdatedWorkspaceImageRequest" + }, + "output": { + "target": "com.amazonaws.workspaces#CreateUpdatedWorkspaceImageResult" + }, + "errors": [ + { + "target": "com.amazonaws.workspaces#AccessDeniedException" + }, + { + "target": "com.amazonaws.workspaces#InvalidParameterValuesException" + }, + { + "target": "com.amazonaws.workspaces#InvalidResourceStateException" + }, + { + "target": "com.amazonaws.workspaces#OperationNotSupportedException" + }, + { + "target": "com.amazonaws.workspaces#ResourceAlreadyExistsException" + }, + { + "target": "com.amazonaws.workspaces#ResourceLimitExceededException" + }, + { + "target": "com.amazonaws.workspaces#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a new updated WorkSpace image based on the specified source image. The \n new updated WorkSpace image has the latest drivers and other updates required by \n the Amazon WorkSpaces components.

\n \n

To determine which WorkSpace images need to be updated with the latest Amazon \n WorkSpaces requirements, use \n \n DescribeWorkspaceImages.

\n \n \n \n " + } + }, + "com.amazonaws.workspaces#CreateUpdatedWorkspaceImageRequest": { + "type": "structure", + "members": { + "Name": { + "target": "com.amazonaws.workspaces#WorkspaceImageName", + "traits": { + "smithy.api#documentation": "

The name of the new updated WorkSpace image.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "com.amazonaws.workspaces#WorkspaceImageDescription", + "traits": { + "smithy.api#documentation": "

A description of whether updates for the WorkSpace image are available.

", + "smithy.api#required": {} + } + }, + "SourceImageId": { + "target": "com.amazonaws.workspaces#WorkspaceImageId", + "traits": { + "smithy.api#documentation": "

The identifier of the source WorkSpace image.

", + "smithy.api#required": {} + } + }, + "Tags": { + "target": "com.amazonaws.workspaces#TagList", + "traits": { + "smithy.api#documentation": "

The tags that you want to add to the new updated WorkSpace image.

\n \n \n

To add tags at the same time when you're creating the updated image, you must create \n an IAM policy that grants your IAM user permissions to use workspaces:CreateTags.

\n
" + } + } + } + }, + "com.amazonaws.workspaces#CreateUpdatedWorkspaceImageResult": { + "type": "structure", + "members": { + "ImageId": { + "target": "com.amazonaws.workspaces#WorkspaceImageId", + "traits": { + "smithy.api#documentation": "

The identifier of the new updated WorkSpace image.

" + } + } + } + }, "com.amazonaws.workspaces#CreateWorkspaceBundle": { "type": "operation", "input": { @@ -1083,7 +1161,7 @@ "com.amazonaws.workspaces#DedicatedTenancyManagementCidrRange": { "type": "string", "traits": { - "smithy.api#pattern": "(^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.0\\.0)(\\/(16$))$" + "smithy.api#pattern": "^(^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.0\\.0)(\\/(16$))$" } }, "com.amazonaws.workspaces#DedicatedTenancyModificationStateEnum": { @@ -1417,7 +1495,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deregisters the specified directory. This operation is asynchronous \n and returns before the WorkSpace directory is deregistered. If any WorkSpaces are\n registered to this directory, you must remove them before you can deregister the directory.

\n \n \n

Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. \n If there are no WorkSpaces being used with your Simple AD or AD Connector directory for 30 \n consecutive days, this directory will be automatically deregistered for use with Amazon WorkSpaces, \n and you will be charged for this directory as per the \n AWS Directory Services pricing terms.

\n \n

To delete empty directories, see \n \n Delete the Directory for Your WorkSpaces. If you delete your \n Simple AD or AD Connector directory, you can always create a new one when you want to start using \n WorkSpaces again.

\n
" + "smithy.api#documentation": "

Deregisters the specified directory. This operation is asynchronous \n and returns before the WorkSpace directory is deregistered. If any WorkSpaces are\n registered to this directory, you must remove them before you can deregister the directory.

\n \n \n

Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. \n If there are no WorkSpaces being used with your Simple AD or AD Connector directory for 30 \n consecutive days, this directory will be automatically deregistered for use with Amazon WorkSpaces, \n and you will be charged for this directory as per the \n Directory Service pricing terms.

\n \n

To delete empty directories, see \n \n Delete the Directory for Your WorkSpaces. If you delete your \n Simple AD or AD Connector directory, you can always create a new one when you want to start using \n WorkSpaces again.

\n
" } }, "com.amazonaws.workspaces#DeregisterWorkspaceDirectoryRequest": { @@ -1588,7 +1666,7 @@ } ], "traits": { - "smithy.api#documentation": "

Describes the permissions that the owner of a connection alias has granted to another AWS account for \n the specified connection alias. For more information, see \n Cross-Region Redirection for Amazon WorkSpaces.

" + "smithy.api#documentation": "

Describes the permissions that the owner of a connection alias has granted to another Amazon Web Services account for \n the specified connection alias. For more information, see \n Cross-Region Redirection for Amazon WorkSpaces.

" } }, "com.amazonaws.workspaces#DescribeConnectionAliasPermissionsRequest": { @@ -1841,7 +1919,7 @@ "Owner": { "target": "com.amazonaws.workspaces#BundleOwner", "traits": { - "smithy.api#documentation": "

The owner of the bundles. You cannot combine this parameter with any other filter.

\n

To describe the bundles provided by AWS, specify AMAZON. To describe the\n bundles that belong to your account, don't specify a value.

" + "smithy.api#documentation": "

The owner of the bundles. You cannot combine this parameter with any other filter.

\n

To describe the bundles provided by Amazon Web Services, specify AMAZON. \n To describe the bundles that belong to your account, don't specify a value.

" } }, "NextToken": { @@ -1951,7 +2029,7 @@ } ], "traits": { - "smithy.api#documentation": "

Describes the permissions that the owner of an image has granted to other \n AWS accounts for an image.

" + "smithy.api#documentation": "

Describes the permissions that the owner of an image has granted to other \n Amazon Web Services accounts for an image.

" } }, "com.amazonaws.workspaces#DescribeWorkspaceImagePermissionsRequest": { @@ -1990,7 +2068,7 @@ "ImagePermissions": { "target": "com.amazonaws.workspaces#ImagePermissions", "traits": { - "smithy.api#documentation": "

The identifiers of the AWS accounts that the image has been shared with.

" + "smithy.api#documentation": "

The identifiers of the Amazon Web Services accounts that the image has been shared with.

" } }, "NextToken": { @@ -2311,7 +2389,7 @@ } ], "traits": { - "smithy.api#documentation": "

Disassociates a connection alias from a directory. Disassociating a connection alias disables cross-Region \n redirection between two directories in different AWS Regions. For more information, see \n \n Cross-Region Redirection for Amazon WorkSpaces.

\n \n \n

Before performing this operation, call \n DescribeConnectionAliases to make sure that the current state of the connection alias is CREATED.

\n
" + "smithy.api#documentation": "

Disassociates a connection alias from a directory. Disassociating a connection alias disables cross-Region \n redirection between two directories in different Regions. For more information, see \n \n Cross-Region Redirection for Amazon WorkSpaces.

\n \n \n

Before performing this operation, call \n DescribeConnectionAliases to make sure that the current state of the connection alias is CREATED.

\n
" } }, "com.amazonaws.workspaces#DisassociateConnectionAliasRequest": { @@ -2491,12 +2569,12 @@ "SharedAccountId": { "target": "com.amazonaws.workspaces#AwsAccount", "traits": { - "smithy.api#documentation": "

The identifier of the AWS account that an image has been shared with.

" + "smithy.api#documentation": "

The identifier of the Amazon Web Services account that an image has been shared with.

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

Describes the AWS accounts that have been granted permission to use a shared image. For more \n information about sharing images, see \n \n Share or Unshare a Custom WorkSpaces Image.

" + "smithy.api#documentation": "

Describes the Amazon Web Services accounts that have been granted permission to use a shared image. \n For more information about sharing images, see \n \n Share or Unshare a Custom WorkSpaces Image.

" } }, "com.amazonaws.workspaces#ImagePermissions": { @@ -2549,7 +2627,7 @@ } ], "traits": { - "smithy.api#documentation": "

Imports the specified Windows 10 Bring Your Own License (BYOL) image into Amazon\n WorkSpaces. The image must be an already licensed Amazon EC2 image that is in your AWS\n account, and you must own the image. For more information about creating BYOL images, see\n \n Bring Your Own Windows Desktop Licenses.

" + "smithy.api#documentation": "

Imports the specified Windows 10 Bring Your Own License (BYOL) image into Amazon\n WorkSpaces. The image must be an already licensed Amazon EC2 image that is in your \n Amazon Web Services account, and you must own the image. For more information about creating BYOL images, see\n \n Bring Your Own Windows Desktop Licenses.

" } }, "com.amazonaws.workspaces#ImportWorkspaceImageRequest": { @@ -2644,7 +2722,7 @@ "com.amazonaws.workspaces#IpGroupId": { "type": "string", "traits": { - "smithy.api#pattern": "wsipg-[0-9a-z]{8,63}$" + "smithy.api#pattern": "^wsipg-[0-9a-z]{8,63}$" } }, "com.amazonaws.workspaces#IpGroupIdList": { @@ -2721,7 +2799,7 @@ } ], "traits": { - "smithy.api#documentation": "

Retrieves a list of IP address ranges, specified as IPv4 CIDR blocks, that you can use\n for the network management interface when you enable Bring Your Own License (BYOL).

\n \n

This operation can be run only by AWS accounts that are enabled for BYOL. If your account \n isn't enabled for BYOL, you'll receive an AccessDeniedException error.

\n \n

The management network interface is connected to a secure Amazon WorkSpaces management\n network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces\n clients, and to allow Amazon WorkSpaces to manage the WorkSpace.

" + "smithy.api#documentation": "

Retrieves a list of IP address ranges, specified as IPv4 CIDR blocks, that you can use\n for the network management interface when you enable Bring Your Own License (BYOL).

\n \n

This operation can be run only by Amazon Web Services accounts that are enabled for BYOL. If your account \n isn't enabled for BYOL, you'll receive an AccessDeniedException error.

\n \n

The management network interface is connected to a secure Amazon WorkSpaces management\n network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces\n clients, and to allow Amazon WorkSpaces to manage the WorkSpace.

" } }, "com.amazonaws.workspaces#ListAvailableManagementCidrRangesRequest": { @@ -3536,7 +3614,7 @@ "Tenancy": { "target": "com.amazonaws.workspaces#Tenancy", "traits": { - "smithy.api#documentation": "

Indicates whether your WorkSpace directory is dedicated or shared. To use Bring Your Own\n License (BYOL) images, this value must be set to DEDICATED and your AWS account must be \n enabled for BYOL. If your account has not been enabled for BYOL, you will receive an \n InvalidParameterValuesException error. For more information about BYOL images, see\n Bring Your Own Windows Desktop Images.

" + "smithy.api#documentation": "

Indicates whether your WorkSpace directory is dedicated or shared. To use Bring Your Own\n License (BYOL) images, this value must be set to DEDICATED and your Amazon Web Services account must be \n enabled for BYOL. If your account has not been enabled for BYOL, you will receive an \n InvalidParameterValuesException error. For more information about BYOL images, see\n Bring Your Own Windows Desktop Images.

" } }, "Tags": { @@ -4123,7 +4201,7 @@ "target": "com.amazonaws.workspaces#TerminateWorkspacesResult" }, "traits": { - "smithy.api#documentation": "

Terminates the specified WorkSpaces.

\n \n \n

Terminating a WorkSpace is a permanent action and cannot be undone. The user's data is\n destroyed. If you need to archive any user data, contact AWS Support before\n terminating the WorkSpace.

\n
\n\n

You can terminate a WorkSpace that is in any state except SUSPENDED.

\n

This operation is asynchronous and returns before the WorkSpaces have been completely\n terminated. After a WorkSpace is terminated, the TERMINATED state is returned \n only briefly before the WorkSpace directory metadata is cleaned up, so this state is rarely \n returned. To confirm that a WorkSpace is terminated, check for the WorkSpace ID by using \n \n DescribeWorkSpaces. If the WorkSpace ID isn't returned, then the WorkSpace has \n been successfully terminated.

\n \n \n

Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. \n If there are no WorkSpaces being used with your Simple AD or AD Connector directory for 30 \n consecutive days, this directory will be automatically deregistered for use with Amazon WorkSpaces, \n and you will be charged for this directory as per the \n AWS Directory Services pricing terms.

\n \n

To delete empty directories, see \n \n Delete the Directory for Your WorkSpaces. If you delete your \n Simple AD or AD Connector directory, you can always create a new one when you want to start using \n WorkSpaces again.

\n
" + "smithy.api#documentation": "

Terminates the specified WorkSpaces.

\n \n \n

Terminating a WorkSpace is a permanent action and cannot be undone. The user's data is\n destroyed. If you need to archive any user data, contact Amazon Web Services Support before\n terminating the WorkSpace.

\n
\n\n

You can terminate a WorkSpace that is in any state except SUSPENDED.

\n

This operation is asynchronous and returns before the WorkSpaces have been completely\n terminated. After a WorkSpace is terminated, the TERMINATED state is returned \n only briefly before the WorkSpace directory metadata is cleaned up, so this state is rarely \n returned. To confirm that a WorkSpace is terminated, check for the WorkSpace ID by using \n \n DescribeWorkSpaces. If the WorkSpace ID isn't returned, then the WorkSpace has \n been successfully terminated.

\n \n \n

Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. \n If there are no WorkSpaces being used with your Simple AD or AD Connector directory for 30 \n consecutive days, this directory will be automatically deregistered for use with Amazon WorkSpaces, \n and you will be charged for this directory as per the \n Directory Service pricing terms.

\n \n

To delete empty directories, see \n \n Delete the Directory for Your WorkSpaces. If you delete your \n Simple AD or AD Connector directory, you can always create a new one when you want to start using \n WorkSpaces again.

\n
" } }, "com.amazonaws.workspaces#TerminateWorkspacesRequest": { @@ -4224,7 +4302,7 @@ "ConnectionAliasPermission": { "target": "com.amazonaws.workspaces#ConnectionAliasPermission", "traits": { - "smithy.api#documentation": "

Indicates whether to share or unshare the connection alias with the specified AWS account.

", + "smithy.api#documentation": "

Indicates whether to share or unshare the connection alias with the specified Amazon Web Services account.

", "smithy.api#required": {} } } @@ -4234,6 +4312,36 @@ "type": "structure", "members": {} }, + "com.amazonaws.workspaces#UpdateDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_./() -]+$" + } + }, + "com.amazonaws.workspaces#UpdateResult": { + "type": "structure", + "members": { + "UpdateAvailable": { + "target": "com.amazonaws.workspaces#BooleanObject", + "traits": { + "smithy.api#documentation": "

Indicates whether updated drivers or other components are available for the specified WorkSpace image.

" + } + }, + "Description": { + "target": "com.amazonaws.workspaces#UpdateDescription", + "traits": { + "smithy.api#documentation": "

A description of whether updates for the WorkSpace image are pending or available.

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

Describes whether a WorkSpace image needs to be updated with the latest \n drivers and other components required by Amazon WorkSpaces.

\n \n \n

Only Windows 10 WorkSpace images can be programmatically updated at this time.

\n
" + } + }, "com.amazonaws.workspaces#UpdateRulesOfIpGroup": { "type": "operation", "input": { @@ -4359,7 +4467,7 @@ } ], "traits": { - "smithy.api#documentation": "

Shares or unshares an image with one account in the same AWS Region by specifying whether that account has \n permission to copy the image. If the copy image permission is granted, the image is shared with that account. \n If the copy image permission is revoked, the image is unshared with the account.

\n \n

After an image has been shared, the recipient account can copy the image to other AWS Regions as needed.

\n \n \n

In the China (Ningxia) Region, you can copy images only within the same Region.

\n \n

In the AWS GovCloud (US-West) Region, to copy images to and from other AWS Regions, \n contact AWS Support.

\n
\n \n

For more information about sharing images, see \n \n Share or Unshare a Custom WorkSpaces Image.

\n \n \n \n " + "smithy.api#documentation": "

Shares or unshares an image with one account in the same Amazon Web Services Region by specifying whether that account has \n permission to copy the image. If the copy image permission is granted, the image is shared with that account. \n If the copy image permission is revoked, the image is unshared with the account.

\n \n

After an image has been shared, the recipient account can copy the image to other Regions as needed.

\n \n

In the China (Ningxia) Region, you can copy images only within the same Region.

\n \n

In Amazon Web Services GovCloud (US), to copy images to and from other Regions, contact Amazon Web Services Support.

\n \n

For more information about sharing images, see \n \n Share or Unshare a Custom WorkSpaces Image.

\n \n \n \n " } }, "com.amazonaws.workspaces#UpdateWorkspaceImagePermissionRequest": { @@ -4382,7 +4490,7 @@ "SharedAccountId": { "target": "com.amazonaws.workspaces#AwsAccount", "traits": { - "smithy.api#documentation": "

The identifier of the AWS account to share or unshare the image with.

\n \n \n

Before sharing the image, confirm that you are sharing to the correct AWS account ID.

\n
", + "smithy.api#documentation": "

The identifier of the Amazon Web Services account to share or unshare the image with.

\n \n \n

Before sharing the image, confirm that you are sharing to the correct Amazon Web Services account ID.

\n
", "smithy.api#required": {} } } @@ -4436,7 +4544,7 @@ "DirectoryId": { "target": "com.amazonaws.workspaces#DirectoryId", "traits": { - "smithy.api#documentation": "

The identifier of the AWS Directory Service directory for the WorkSpace.

" + "smithy.api#documentation": "

The identifier of the Directory Service directory for the WorkSpace.

" } }, "UserName": { @@ -4490,7 +4598,7 @@ "VolumeEncryptionKey": { "target": "com.amazonaws.workspaces#VolumeEncryptionKey", "traits": { - "smithy.api#documentation": "

The symmetric AWS KMS customer master key (CMK) used to encrypt data stored on your WorkSpace. \n Amazon WorkSpaces does not support asymmetric CMKs.

" + "smithy.api#documentation": "

The symmetric KMS key used to encrypt data stored on your WorkSpace. \n Amazon WorkSpaces does not support asymmetric KMS keys.

" } }, "UserVolumeEncryptionEnabled": { @@ -4528,13 +4636,13 @@ "DeviceTypeWindows": { "target": "com.amazonaws.workspaces#AccessPropertyValue", "traits": { - "smithy.api#documentation": "

Indicates whether users can use Windows clients to access their WorkSpaces. To restrict\n WorkSpaces access to trusted devices (also known as managed devices) with valid\n certificates, specify a value of TRUST. For more information, see Restrict\n WorkSpaces Access to Trusted Devices.

" + "smithy.api#documentation": "

Indicates whether users can use Windows clients to access their WorkSpaces.

" } }, "DeviceTypeOsx": { "target": "com.amazonaws.workspaces#AccessPropertyValue", "traits": { - "smithy.api#documentation": "

Indicates whether users can use macOS clients to access their WorkSpaces. To restrict\n WorkSpaces access to trusted devices (also known as managed devices) with valid\n certificates, specify a value of TRUST. For more information, see Restrict\n WorkSpaces Access to Trusted Devices.

" + "smithy.api#documentation": "

Indicates whether users can use macOS clients to access their WorkSpaces.

" } }, "DeviceTypeWeb": { @@ -4552,7 +4660,7 @@ "DeviceTypeAndroid": { "target": "com.amazonaws.workspaces#AccessPropertyValue", "traits": { - "smithy.api#documentation": "

Indicates whether users can use Android devices to access their WorkSpaces.

" + "smithy.api#documentation": "

Indicates whether users can use Android and Android-compatible Chrome OS devices \n to access their WorkSpaces.

" } }, "DeviceTypeChromeOs": { @@ -4596,7 +4704,7 @@ "Owner": { "target": "com.amazonaws.workspaces#BundleOwner", "traits": { - "smithy.api#documentation": "

The owner of the bundle. This is the account identifier of the owner, or\n AMAZON if the bundle is provided by AWS.

" + "smithy.api#documentation": "

The owner of the bundle. This is the account identifier of the owner, or\n AMAZON if the bundle is provided by Amazon Web Services.

" } }, "Description": { @@ -4969,13 +5077,19 @@ "Created": { "target": "com.amazonaws.workspaces#Timestamp", "traits": { - "smithy.api#documentation": "

The date when the image was created. If the image has been shared, the AWS account \n that the image has been shared with sees the original creation date of the image.

" + "smithy.api#documentation": "

The date when the image was created. If the image has been shared, the Amazon Web Services account \n that the image has been shared with sees the original creation date of the image.

" } }, "OwnerAccountId": { "target": "com.amazonaws.workspaces#AwsAccount", "traits": { - "smithy.api#documentation": "

The identifier of the AWS account that owns the image.

" + "smithy.api#documentation": "

The identifier of the Amazon Web Services account that owns the image.

" + } + }, + "Updates": { + "target": "com.amazonaws.workspaces#UpdateResult", + "traits": { + "smithy.api#documentation": "

The updates (if any) that are available for the specified image.

" } } }, @@ -4999,7 +5113,7 @@ "com.amazonaws.workspaces#WorkspaceImageId": { "type": "string", "traits": { - "smithy.api#pattern": "wsi-[0-9a-z]{9,63}$" + "smithy.api#pattern": "^wsi-[0-9a-z]{9,63}$" } }, "com.amazonaws.workspaces#WorkspaceImageIdList": { @@ -5137,14 +5251,14 @@ "DirectoryId": { "target": "com.amazonaws.workspaces#DirectoryId", "traits": { - "smithy.api#documentation": "

The identifier of the AWS Directory Service directory for the WorkSpace. You can use\n DescribeWorkspaceDirectories to list the available directories.

", + "smithy.api#documentation": "

The identifier of the Directory Service directory for the WorkSpace. You can use\n DescribeWorkspaceDirectories to list the available directories.

", "smithy.api#required": {} } }, "UserName": { "target": "com.amazonaws.workspaces#UserName", "traits": { - "smithy.api#documentation": "

The user name of the user for the WorkSpace. This user name must exist in the AWS\n Directory Service directory for the WorkSpace.

", + "smithy.api#documentation": "

The user name of the user for the WorkSpace. This user name must exist in the Directory Service\n directory for the WorkSpace.

", "smithy.api#required": {} } }, @@ -5158,7 +5272,7 @@ "VolumeEncryptionKey": { "target": "com.amazonaws.workspaces#VolumeEncryptionKey", "traits": { - "smithy.api#documentation": "

The symmetric AWS KMS customer master key (CMK) used to encrypt data stored on your WorkSpace. \n Amazon WorkSpaces does not support asymmetric CMKs.

" + "smithy.api#documentation": "

The symmetric KMS key used to encrypt data stored on your WorkSpace. \n Amazon WorkSpaces does not support asymmetric KMS keys.

" } }, "UserVolumeEncryptionEnabled": { @@ -5352,6 +5466,9 @@ { "target": "com.amazonaws.workspaces#CreateTags" }, + { + "target": "com.amazonaws.workspaces#CreateUpdatedWorkspaceImage" + }, { "target": "com.amazonaws.workspaces#CreateWorkspaceBundle" }, diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoint-prefix.json b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoint-prefix.json index c18f8929ffe..7fb2cdd0d6a 100644 --- a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoint-prefix.json +++ b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoint-prefix.json @@ -3,6 +3,7 @@ "ACM PCA": "acm-pca", "API Gateway": "apigateway", "AccessAnalyzer": "access-analyzer", + "Account": "account", "Alexa For Business": "a4b", "Amp": "aps", "Amplify": "amplify", @@ -32,6 +33,7 @@ "Chime SDK Identity": "identity-chime", "Chime SDK Messaging": "messaging-chime", "Cloud9": "cloud9", + "CloudControl": "cloudcontrolapi", "CloudDirectory": "clouddirectory", "CloudFormation": "cloudformation", "CloudFront": "cloudfront", @@ -268,10 +270,12 @@ "Transcribe Streaming": "transcribestreaming", "Transfer": "transfer", "Translate": "translate", + "Voice ID": "voiceid", "WAF": "waf", "WAF Regional": "waf-regional", "WAFV2": "wafv2", "WellArchitected": "wellarchitected", + "Wisdom": "wisdom", "WorkDocs": "workdocs", "WorkLink": "worklink", "WorkMail": "workmail", diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json index b15bb7164d4..4d53bdc37f8 100644 --- a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json +++ b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json @@ -135,6 +135,18 @@ "us-west-2" : { } } }, + "account" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "account.us-east-1.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, "acm" : { "endpoints" : { "af-south-1" : { }, @@ -842,7 +854,11 @@ "protocols" : [ "https" ] }, "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, "eu-central-1" : { }, + "eu-north-1" : { }, "eu-west-1" : { }, "us-east-1" : { }, "us-east-2" : { }, @@ -1116,6 +1132,61 @@ "us-west-2" : { } } }, + "cloudcontrol" : { + "endpoints" : { + "af-south-1" : { }, + "ap-east-1" : { }, + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-northeast-3" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-south-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "fips-ca-central-1" : { + "credentialScope" : { + "region" : "ca-central-1" + }, + "hostname" : "cloudcontrolapi-fips.ca-central-1.amazonaws.com" + }, + "fips-us-east-1" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "cloudcontrolapi-fips.us-east-1.amazonaws.com" + }, + "fips-us-east-2" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "cloudcontrolapi-fips.us-east-2.amazonaws.com" + }, + "fips-us-west-1" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "cloudcontrolapi-fips.us-west-1.amazonaws.com" + }, + "fips-us-west-2" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "cloudcontrolapi-fips.us-west-2.amazonaws.com" + }, + "me-south-1" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, "clouddirectory" : { "endpoints" : { "ap-southeast-1" : { }, @@ -1216,6 +1287,7 @@ "ap-east-1" : { }, "ap-northeast-1" : { }, "ap-northeast-2" : { }, + "ap-northeast-3" : { }, "ap-south-1" : { }, "ap-southeast-1" : { }, "ap-southeast-2" : { }, @@ -7424,6 +7496,17 @@ } } }, + "voiceid" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, "waf" : { "endpoints" : { "aws-fips" : { @@ -7833,6 +7916,18 @@ "cn-northwest-1" : { } } }, + "account" : { + "endpoints" : { + "aws-cn-global" : { + "credentialScope" : { + "region" : "cn-northwest-1" + }, + "hostname" : "account.cn-northwest-1.amazonaws.com.cn" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-cn-global" + }, "acm" : { "endpoints" : { "cn-north-1" : { }, @@ -8943,6 +9038,24 @@ "us-gov-west-1" : { } } }, + "cloudcontrol" : { + "endpoints" : { + "fips-us-gov-east-1" : { + "credentialScope" : { + "region" : "us-gov-east-1" + }, + "hostname" : "cloudcontrolapi-fips.us-gov-east-1.amazonaws.com" + }, + "fips-us-gov-west-1" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "cloudcontrolapi-fips.us-gov-west-1.amazonaws.com" + }, + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, "clouddirectory" : { "endpoints" : { "us-gov-west-1" : { } diff --git a/service/account/LICENSE.txt b/service/account/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/account/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/account/api_client.go b/service/account/api_client.go new file mode 100644 index 00000000000..a43d83f886e --- /dev/null +++ b/service/account/api_client.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "Account" +const ServiceAPIVersion = "2021-02-01" + +// Client provides the API client to make operations call for AWS Account. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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 endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer aws.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "account", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/account/api_op_DeleteAlternateContact.go b/service/account/api_op_DeleteAlternateContact.go new file mode 100644 index 00000000000..a6931bee8af --- /dev/null +++ b/service/account/api_op_DeleteAlternateContact.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/account/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified alternate contact from an Amazon Web Services account. For +// complete details about how to use the alternate contact operations, see Access +// or updating the alternate contacts +// (https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html). +func (c *Client) DeleteAlternateContact(ctx context.Context, params *DeleteAlternateContactInput, optFns ...func(*Options)) (*DeleteAlternateContactOutput, error) { + if params == nil { + params = &DeleteAlternateContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAlternateContact", params, optFns, c.addOperationDeleteAlternateContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAlternateContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAlternateContactInput struct { + + // Specifies which of the alternate contacts to delete. + // + // This member is required. + AlternateContactType types.AlternateContactType + + // Specifies the 12 digit account ID number of the Amazon Web Services account that + // you want to access or modify with this operation. If you do not specify this + // parameter, it defaults to the Amazon Web Services account of the identity used + // to call the operation. To use this parameter, the caller must be an identity in + // the organization's management account + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account) + // or a delegated administrator account, and the specified account ID must be a + // member account in the same organization. The organization must have all features + // enabled + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html), + // and the organization must have trusted access + // (https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html) + // enabled for the Account Management service, and optionally a delegated admin + // (https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html) + // account assigned. The management account can't specify its own AccountId; it + // must call the operation in standalone context by not including the AccountId + // parameter. To call this operation on an account that is not a member of an + // organization, then don't specify this parameter, and call the operation using an + // identity belonging to the account whose contacts you wish to retrieve or modify. + AccountId *string + + noSmithyDocumentSerde +} + +type DeleteAlternateContactOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAlternateContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAlternateContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAlternateContact{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAlternateContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAlternateContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAlternateContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "account", + OperationName: "DeleteAlternateContact", + } +} diff --git a/service/account/api_op_GetAlternateContact.go b/service/account/api_op_GetAlternateContact.go new file mode 100644 index 00000000000..c346ca69530 --- /dev/null +++ b/service/account/api_op_GetAlternateContact.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/account/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the specified alternate contact attached to an Amazon Web Services +// account. For complete details about how to use the alternate contact operations, +// see Access or updating the alternate contacts +// (https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html). +func (c *Client) GetAlternateContact(ctx context.Context, params *GetAlternateContactInput, optFns ...func(*Options)) (*GetAlternateContactOutput, error) { + if params == nil { + params = &GetAlternateContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAlternateContact", params, optFns, c.addOperationGetAlternateContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAlternateContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAlternateContactInput struct { + + // Specifies which alternate contact you want to retrieve. + // + // This member is required. + AlternateContactType types.AlternateContactType + + // Specifies the 12 digit account ID number of the Amazon Web Services account that + // you want to access or modify with this operation. If you do not specify this + // parameter, it defaults to the Amazon Web Services account of the identity used + // to call the operation. To use this parameter, the caller must be an identity in + // the organization's management account + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account) + // or a delegated administrator account, and the specified account ID must be a + // member account in the same organization. The organization must have all features + // enabled + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html), + // and the organization must have trusted access + // (https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html) + // enabled for the Account Management service, and optionally a delegated admin + // (https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html) + // account assigned. The management account can't specify its own AccountId; it + // must call the operation in standalone context by not including the AccountId + // parameter. To call this operation on an account that is not a member of an + // organization, then don't specify this parameter, and call the operation using an + // identity belonging to the account whose contacts you wish to retrieve or modify. + AccountId *string + + noSmithyDocumentSerde +} + +type GetAlternateContactOutput struct { + + // A structure that contains the details for the specified alternate contact. + AlternateContact *types.AlternateContact + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAlternateContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAlternateContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAlternateContact{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetAlternateContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAlternateContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAlternateContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "account", + OperationName: "GetAlternateContact", + } +} diff --git a/service/account/api_op_PutAlternateContact.go b/service/account/api_op_PutAlternateContact.go new file mode 100644 index 00000000000..9c7803fda13 --- /dev/null +++ b/service/account/api_op_PutAlternateContact.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/account/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the specified alternate contact attached to an Amazon Web Services +// account. For complete details about how to use the alternate contact operations, +// see Access or updating the alternate contacts +// (https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html). +func (c *Client) PutAlternateContact(ctx context.Context, params *PutAlternateContactInput, optFns ...func(*Options)) (*PutAlternateContactOutput, error) { + if params == nil { + params = &PutAlternateContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutAlternateContact", params, optFns, c.addOperationPutAlternateContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutAlternateContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutAlternateContactInput struct { + + // Specifies which alternate contact you want to create or update. + // + // This member is required. + AlternateContactType types.AlternateContactType + + // Specifies an email address for the alternate contact. + // + // This member is required. + EmailAddress *string + + // Specifies a name for the alternate contact. + // + // This member is required. + Name *string + + // Specifies a phone number for the alternate contact. + // + // This member is required. + PhoneNumber *string + + // Specifies a title for the alternate contact. + // + // This member is required. + Title *string + + // Specifies the 12 digit account ID number of the Amazon Web Services account that + // you want to access or modify with this operation. If you do not specify this + // parameter, it defaults to the Amazon Web Services account of the identity used + // to call the operation. To use this parameter, the caller must be an identity in + // the organization's management account + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account) + // or a delegated administrator account, and the specified account ID must be a + // member account in the same organization. The organization must have all features + // enabled + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html), + // and the organization must have trusted access + // (https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-trusted-access.html) + // enabled for the Account Management service, and optionally a delegated admin + // (https://docs.aws.amazon.com/organizations/latest/userguide/using-orgs-delegated-admin.html) + // account assigned. The management account can't specify its own AccountId; it + // must call the operation in standalone context by not including the AccountId + // parameter. To call this operation on an account that is not a member of an + // organization, then don't specify this parameter, and call the operation using an + // identity belonging to the account whose contacts you wish to retrieve or modify. + AccountId *string + + noSmithyDocumentSerde +} + +type PutAlternateContactOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutAlternateContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAlternateContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAlternateContact{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutAlternateContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAlternateContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutAlternateContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "account", + OperationName: "PutAlternateContact", + } +} diff --git a/service/account/deserializers.go b/service/account/deserializers.go new file mode 100644 index 00000000000..d1db3dec466 --- /dev/null +++ b/service/account/deserializers.go @@ -0,0 +1,834 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/account/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strings" +) + +type awsRestjson1_deserializeOpDeleteAlternateContact struct { +} + +func (*awsRestjson1_deserializeOpDeleteAlternateContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteAlternateContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAlternateContact(response, &metadata) + } + output := &DeleteAlternateContactOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteAlternateContact(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetAlternateContact struct { +} + +func (*awsRestjson1_deserializeOpGetAlternateContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAlternateContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetAlternateContact(response, &metadata) + } + output := &GetAlternateContactOutput{} + 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_deserializeOpDocumentGetAlternateContactOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetAlternateContact(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetAlternateContactOutput(v **GetAlternateContactOutput, 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 *GetAlternateContactOutput + if *v == nil { + sv = &GetAlternateContactOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AlternateContact": + if err := awsRestjson1_deserializeDocumentAlternateContact(&sv.AlternateContact, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutAlternateContact struct { +} + +func (*awsRestjson1_deserializeOpPutAlternateContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutAlternateContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutAlternateContact(response, &metadata) + } + output := &PutAlternateContactOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutAlternateContact(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +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) + + 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) + + 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) + + return output +} + +func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyRequestsException{} + 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_deserializeDocumentTooManyRequestsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func 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) + + 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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAlternateContact(v **types.AlternateContact, 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.AlternateContact + if *v == nil { + sv = &types.AlternateContact{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AlternateContactType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlternateContactType to be of type string, got %T instead", value) + } + sv.AlternateContactType = types.AlternateContactType(jtv) + } + + case "EmailAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) + } + sv.EmailAddress = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + } + sv.PhoneNumber = ptr.String(jtv) + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Title to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + 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": + 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) + } + + 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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, 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.TooManyRequestsException + if *v == nil { + sv = &types.TooManyRequestsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + 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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/account/doc.go b/service/account/doc.go new file mode 100644 index 00000000000..b547c324667 --- /dev/null +++ b/service/account/doc.go @@ -0,0 +1,7 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package account provides the API client, operations, and parameter types for AWS +// Account. +// +// Operations for Amazon Web Services Account Management +package account diff --git a/service/account/endpoints.go b/service/account/endpoints.go new file mode 100644 index 00000000000..476301d0bb7 --- /dev/null +++ b/service/account/endpoints.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/account/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + if err != nil { + 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 = "account" + } + 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.EndpointResolver + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint +// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError +// error, the resolver will use the the provided fallbackResolver for resolution. +// awsResolver and fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/account/generated.json b/service/account/generated.json new file mode 100644 index 00000000000..8d2872d0619 --- /dev/null +++ b/service/account/generated.json @@ -0,0 +1,27 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_op_DeleteAlternateContact.go", + "api_op_GetAlternateContact.go", + "api_op_PutAlternateContact.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/account", + "unstable": false +} diff --git a/service/account/go.mod b/service/account/go.mod new file mode 100644 index 00000000000..978b828f4be --- /dev/null +++ b/service/account/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/account + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.9.1 + github.com/aws/smithy-go v1.8.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/account/go.sum b/service/account/go.sum new file mode 100644 index 00000000000..779915f8ab7 --- /dev/null +++ b/service/account/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/account/go_module_metadata.go b/service/account/go_module_metadata.go new file mode 100644 index 00000000000..033633d72c7 --- /dev/null +++ b/service/account/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package account + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/account/internal/endpoints/endpoints.go b/service/account/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..37c61f2885f --- /dev/null +++ b/service/account/internal/endpoints/endpoints.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver Account 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + 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 + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "account.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: false, + PartitionEndpoint: "aws-global", + Endpoints: endpoints.Endpoints{ + "aws-global": endpoints.Endpoint{ + Hostname: "account.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "account.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: false, + PartitionEndpoint: "aws-cn-global", + Endpoints: endpoints.Endpoints{ + "aws-cn-global": endpoints.Endpoint{ + Hostname: "account.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "account.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "account.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "account.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/account/internal/endpoints/endpoints_test.go b/service/account/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/account/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/account/protocol_test.go b/service/account/protocol_test.go new file mode 100644 index 00000000000..a53dc35cb55 --- /dev/null +++ b/service/account/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account diff --git a/service/account/serializers.go b/service/account/serializers.go new file mode 100644 index 00000000000..4e912f13e93 --- /dev/null +++ b/service/account/serializers.go @@ -0,0 +1,253 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "bytes" + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpDeleteAlternateContact struct { +} + +func (*awsRestjson1_serializeOpDeleteAlternateContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAlternateContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAlternateContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/deleteAlternateContact") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteAlternateContactInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAlternateContactInput(v *DeleteAlternateContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteAlternateContactInput(v *DeleteAlternateContactInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("AccountId") + ok.String(*v.AccountId) + } + + if len(v.AlternateContactType) > 0 { + ok := object.Key("AlternateContactType") + ok.String(string(v.AlternateContactType)) + } + + return nil +} + +type awsRestjson1_serializeOpGetAlternateContact struct { +} + +func (*awsRestjson1_serializeOpGetAlternateContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAlternateContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAlternateContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/getAlternateContact") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetAlternateContactInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetAlternateContactInput(v *GetAlternateContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetAlternateContactInput(v *GetAlternateContactInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("AccountId") + ok.String(*v.AccountId) + } + + if len(v.AlternateContactType) > 0 { + ok := object.Key("AlternateContactType") + ok.String(string(v.AlternateContactType)) + } + + return nil +} + +type awsRestjson1_serializeOpPutAlternateContact struct { +} + +func (*awsRestjson1_serializeOpPutAlternateContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutAlternateContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutAlternateContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/putAlternateContact") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutAlternateContactInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutAlternateContactInput(v *PutAlternateContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutAlternateContactInput(v *PutAlternateContactInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("AccountId") + ok.String(*v.AccountId) + } + + if len(v.AlternateContactType) > 0 { + ok := object.Key("AlternateContactType") + ok.String(string(v.AlternateContactType)) + } + + if v.EmailAddress != nil { + ok := object.Key("EmailAddress") + ok.String(*v.EmailAddress) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.PhoneNumber != nil { + ok := object.Key("PhoneNumber") + ok.String(*v.PhoneNumber) + } + + if v.Title != nil { + ok := object.Key("Title") + ok.String(*v.Title) + } + + return nil +} diff --git a/service/account/types/enums.go b/service/account/types/enums.go new file mode 100644 index 00000000000..30fb8f24ae0 --- /dev/null +++ b/service/account/types/enums.go @@ -0,0 +1,23 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AlternateContactType string + +// Enum values for AlternateContactType +const ( + AlternateContactTypeBilling AlternateContactType = "BILLING" + AlternateContactTypeOperations AlternateContactType = "OPERATIONS" + AlternateContactTypeSecurity AlternateContactType = "SECURITY" +) + +// Values returns all known values for AlternateContactType. 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 (AlternateContactType) Values() []AlternateContactType { + return []AlternateContactType{ + "BILLING", + "OPERATIONS", + "SECURITY", + } +} diff --git a/service/account/types/errors.go b/service/account/types/errors.go new file mode 100644 index 00000000000..1a5df49a862 --- /dev/null +++ b/service/account/types/errors.go @@ -0,0 +1,106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The operation failed because the calling identity doesn't have the minimum +// required permissions. +type AccessDeniedException struct { + Message *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 { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The operation failed because of an error internal to Amazon Web Services. Try +// your operation again later. +type InternalServerException struct { + Message *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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The operation failed because it specified a resource that can't be found. +type ResourceNotFoundException struct { + Message *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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The operation failed because it was called too frequently and exceeded a +// throttle limit. +type TooManyRequestsException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyRequestsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyRequestsException) ErrorCode() string { return "TooManyRequestsException" } +func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The operation failed because one of the input parameters was invalid. +type ValidationException struct { + Message *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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/account/types/types.go b/service/account/types/types.go new file mode 100644 index 00000000000..662c658353a --- /dev/null +++ b/service/account/types/types.go @@ -0,0 +1,31 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// A structure that contains the details of an alternate contact associated with an +// Amazon Web Services account +type AlternateContact struct { + + // The type of alternate contact. + AlternateContactType AlternateContactType + + // The email address associated with this alternate contact. + EmailAddress *string + + // The name associated with this alternate contact. + Name *string + + // The phone number associated with this alternate contact. + PhoneNumber *string + + // The title associated with this alternate contact. + Title *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/account/validators.go b/service/account/validators.go new file mode 100644 index 00000000000..ec1613b4616 --- /dev/null +++ b/service/account/validators.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpDeleteAlternateContact struct { +} + +func (*validateOpDeleteAlternateContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAlternateContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAlternateContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAlternateContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAlternateContact struct { +} + +func (*validateOpGetAlternateContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAlternateContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAlternateContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAlternateContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutAlternateContact struct { +} + +func (*validateOpPutAlternateContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutAlternateContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutAlternateContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutAlternateContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpDeleteAlternateContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAlternateContact{}, middleware.After) +} + +func addOpGetAlternateContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAlternateContact{}, middleware.After) +} + +func addOpPutAlternateContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutAlternateContact{}, middleware.After) +} + +func validateOpDeleteAlternateContactInput(v *DeleteAlternateContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAlternateContactInput"} + if len(v.AlternateContactType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AlternateContactType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAlternateContactInput(v *GetAlternateContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAlternateContactInput"} + if len(v.AlternateContactType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AlternateContactType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutAlternateContactInput(v *PutAlternateContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutAlternateContactInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Title == nil { + invalidParams.Add(smithy.NewErrParamRequired("Title")) + } + if v.EmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmailAddress")) + } + if v.PhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumber")) + } + if len(v.AlternateContactType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AlternateContactType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/amp/api_op_CreateAlertManagerDefinition.go b/service/amp/api_op_CreateAlertManagerDefinition.go new file mode 100644 index 00000000000..3c80041fa99 --- /dev/null +++ b/service/amp/api_op_CreateAlertManagerDefinition.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create an alert manager definition. +func (c *Client) CreateAlertManagerDefinition(ctx context.Context, params *CreateAlertManagerDefinitionInput, optFns ...func(*Options)) (*CreateAlertManagerDefinitionOutput, error) { + if params == nil { + params = &CreateAlertManagerDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAlertManagerDefinition", params, optFns, c.addOperationCreateAlertManagerDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAlertManagerDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a CreateAlertManagerDefinition operation. +type CreateAlertManagerDefinitionInput struct { + + // The alert manager definition data. + // + // This member is required. + Data []byte + + // The ID of the workspace in which to create the alert manager definition. + // + // This member is required. + WorkspaceId *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +// Represents the output of a CreateAlertManagerDefinition operation. +type CreateAlertManagerDefinitionOutput struct { + + // The status of alert manager definition. + // + // This member is required. + Status *types.AlertManagerDefinitionStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAlertManagerDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateAlertManagerDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAlertManagerDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateAlertManagerDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "CreateAlertManagerDefinition", + } +} diff --git a/service/amp/api_op_CreateRuleGroupsNamespace.go b/service/amp/api_op_CreateRuleGroupsNamespace.go new file mode 100644 index 00000000000..d03ebb21771 --- /dev/null +++ b/service/amp/api_op_CreateRuleGroupsNamespace.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a rule group namespace. +func (c *Client) CreateRuleGroupsNamespace(ctx context.Context, params *CreateRuleGroupsNamespaceInput, optFns ...func(*Options)) (*CreateRuleGroupsNamespaceOutput, error) { + if params == nil { + params = &CreateRuleGroupsNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRuleGroupsNamespace", params, optFns, c.addOperationCreateRuleGroupsNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRuleGroupsNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a CreateRuleGroupsNamespace operation. +type CreateRuleGroupsNamespaceInput struct { + + // The namespace data that define the rule groups. + // + // This member is required. + Data []byte + + // The rule groups namespace name. + // + // This member is required. + Name *string + + // The ID of the workspace in which to create the rule group namespace. + // + // This member is required. + WorkspaceId *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + // Optional, user-provided tags for this rule groups namespace. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Represents the output of a CreateRuleGroupsNamespace operation. +type CreateRuleGroupsNamespaceOutput struct { + + // The Amazon Resource Name (ARN) of this rule groups namespace. + // + // This member is required. + Arn *string + + // The rule groups namespace name. + // + // This member is required. + Name *string + + // The status of rule groups namespace. + // + // This member is required. + Status *types.RuleGroupsNamespaceStatus + + // The tags of this rule groups namespace. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRuleGroupsNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateRuleGroupsNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRuleGroupsNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateRuleGroupsNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "CreateRuleGroupsNamespace", + } +} diff --git a/service/amp/api_op_DeleteAlertManagerDefinition.go b/service/amp/api_op_DeleteAlertManagerDefinition.go new file mode 100644 index 00000000000..4581506be11 --- /dev/null +++ b/service/amp/api_op_DeleteAlertManagerDefinition.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an alert manager definition. +func (c *Client) DeleteAlertManagerDefinition(ctx context.Context, params *DeleteAlertManagerDefinitionInput, optFns ...func(*Options)) (*DeleteAlertManagerDefinitionOutput, error) { + if params == nil { + params = &DeleteAlertManagerDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAlertManagerDefinition", params, optFns, c.addOperationDeleteAlertManagerDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAlertManagerDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a DeleteAlertManagerDefinition operation. +type DeleteAlertManagerDefinitionInput struct { + + // The ID of the workspace in which to delete the alert manager definition. + // + // This member is required. + WorkspaceId *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +type DeleteAlertManagerDefinitionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAlertManagerDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAlertManagerDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAlertManagerDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAlertManagerDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "DeleteAlertManagerDefinition", + } +} diff --git a/service/amp/api_op_DeleteRuleGroupsNamespace.go b/service/amp/api_op_DeleteRuleGroupsNamespace.go new file mode 100644 index 00000000000..14510f7df4b --- /dev/null +++ b/service/amp/api_op_DeleteRuleGroupsNamespace.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete a rule groups namespace. +func (c *Client) DeleteRuleGroupsNamespace(ctx context.Context, params *DeleteRuleGroupsNamespaceInput, optFns ...func(*Options)) (*DeleteRuleGroupsNamespaceOutput, error) { + if params == nil { + params = &DeleteRuleGroupsNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRuleGroupsNamespace", params, optFns, c.addOperationDeleteRuleGroupsNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRuleGroupsNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a DeleteRuleGroupsNamespace operation. +type DeleteRuleGroupsNamespaceInput struct { + + // The rule groups namespace name. + // + // This member is required. + Name *string + + // The ID of the workspace to delete rule group definition. + // + // This member is required. + WorkspaceId *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +type DeleteRuleGroupsNamespaceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRuleGroupsNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteRuleGroupsNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRuleGroupsNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRuleGroupsNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "DeleteRuleGroupsNamespace", + } +} diff --git a/service/amp/api_op_DescribeAlertManagerDefinition.go b/service/amp/api_op_DescribeAlertManagerDefinition.go new file mode 100644 index 00000000000..7b9e664205a --- /dev/null +++ b/service/amp/api_op_DescribeAlertManagerDefinition.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes an alert manager definition. +func (c *Client) DescribeAlertManagerDefinition(ctx context.Context, params *DescribeAlertManagerDefinitionInput, optFns ...func(*Options)) (*DescribeAlertManagerDefinitionOutput, error) { + if params == nil { + params = &DescribeAlertManagerDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAlertManagerDefinition", params, optFns, c.addOperationDescribeAlertManagerDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAlertManagerDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a DescribeAlertManagerDefinition operation. +type DescribeAlertManagerDefinitionInput struct { + + // The ID of the workspace to describe. + // + // This member is required. + WorkspaceId *string + + noSmithyDocumentSerde +} + +// Represents the output of a DescribeAlertManagerDefinition operation. +type DescribeAlertManagerDefinitionOutput struct { + + // The properties of the selected workspace's alert manager definition. + // + // This member is required. + AlertManagerDefinition *types.AlertManagerDefinitionDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAlertManagerDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeAlertManagerDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAlertManagerDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeAlertManagerDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "DescribeAlertManagerDefinition", + } +} diff --git a/service/amp/api_op_DescribeRuleGroupsNamespace.go b/service/amp/api_op_DescribeRuleGroupsNamespace.go new file mode 100644 index 00000000000..5e129a9ba6d --- /dev/null +++ b/service/amp/api_op_DescribeRuleGroupsNamespace.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describe a rule groups namespace. +func (c *Client) DescribeRuleGroupsNamespace(ctx context.Context, params *DescribeRuleGroupsNamespaceInput, optFns ...func(*Options)) (*DescribeRuleGroupsNamespaceOutput, error) { + if params == nil { + params = &DescribeRuleGroupsNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeRuleGroupsNamespace", params, optFns, c.addOperationDescribeRuleGroupsNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeRuleGroupsNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a DescribeRuleGroupsNamespace operation. +type DescribeRuleGroupsNamespaceInput struct { + + // The rule groups namespace. + // + // This member is required. + Name *string + + // The ID of the workspace to describe. + // + // This member is required. + WorkspaceId *string + + noSmithyDocumentSerde +} + +// Represents the output of a DescribeRuleGroupsNamespace operation. +type DescribeRuleGroupsNamespaceOutput struct { + + // The selected rule groups namespace. + // + // This member is required. + RuleGroupsNamespace *types.RuleGroupsNamespaceDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeRuleGroupsNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeRuleGroupsNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRuleGroupsNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeRuleGroupsNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "DescribeRuleGroupsNamespace", + } +} diff --git a/service/amp/api_op_DescribeWorkspace.go b/service/amp/api_op_DescribeWorkspace.go index fc63046f924..3fd10e32b7a 100644 --- a/service/amp/api_op_DescribeWorkspace.go +++ b/service/amp/api_op_DescribeWorkspace.go @@ -4,11 +4,17 @@ package amp import ( "context" + "errors" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/amp/types" "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "time" ) // Describes an existing AMP workspace. @@ -115,6 +121,357 @@ func (c *Client) addOperationDescribeWorkspaceMiddlewares(stack *middleware.Stac return nil } +// DescribeWorkspaceAPIClient is a client that implements the DescribeWorkspace +// operation. +type DescribeWorkspaceAPIClient interface { + DescribeWorkspace(context.Context, *DescribeWorkspaceInput, ...func(*Options)) (*DescribeWorkspaceOutput, error) +} + +var _ DescribeWorkspaceAPIClient = (*Client)(nil) + +// WorkspaceActiveWaiterOptions are waiter options for WorkspaceActiveWaiter +type WorkspaceActiveWaiterOptions 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 + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // WorkspaceActiveWaiter will use default minimum delay of 2 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or set + // to zero, WorkspaceActiveWaiter will use default max delay of 120 seconds. Note + // that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeWorkspaceInput, *DescribeWorkspaceOutput, error) (bool, error) +} + +// WorkspaceActiveWaiter defines the waiters for WorkspaceActive +type WorkspaceActiveWaiter struct { + client DescribeWorkspaceAPIClient + + options WorkspaceActiveWaiterOptions +} + +// NewWorkspaceActiveWaiter constructs a WorkspaceActiveWaiter. +func NewWorkspaceActiveWaiter(client DescribeWorkspaceAPIClient, optFns ...func(*WorkspaceActiveWaiterOptions)) *WorkspaceActiveWaiter { + options := WorkspaceActiveWaiterOptions{} + options.MinDelay = 2 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = workspaceActiveStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &WorkspaceActiveWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for WorkspaceActive waiter. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *WorkspaceActiveWaiter) Wait(ctx context.Context, params *DescribeWorkspaceInput, maxWaitDur time.Duration, optFns ...func(*WorkspaceActiveWaiterOptions)) error { + if maxWaitDur <= 0 { + return fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeWorkspace(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return err + } + if !retryable { + return nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return fmt.Errorf("exceeded max wait time for WorkspaceActive waiter") +} + +func workspaceActiveStateRetryable(ctx context.Context, input *DescribeWorkspaceInput, output *DescribeWorkspaceOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("workspace.status.statusCode", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "ACTIVE" + value, ok := pathValue.(types.WorkspaceStatusCode) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.WorkspaceStatusCode value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("workspace.status.statusCode", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "UPDATING" + value, ok := pathValue.(types.WorkspaceStatusCode) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.WorkspaceStatusCode value, got %T", pathValue) + } + + if string(value) == expectedValue { + return true, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("workspace.status.statusCode", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "CREATING" + value, ok := pathValue.(types.WorkspaceStatusCode) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.WorkspaceStatusCode value, got %T", pathValue) + } + + if string(value) == expectedValue { + return true, nil + } + } + + return true, nil +} + +// WorkspaceDeletedWaiterOptions are waiter options for WorkspaceDeletedWaiter +type WorkspaceDeletedWaiterOptions 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 + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // WorkspaceDeletedWaiter will use default minimum delay of 2 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or set + // to zero, WorkspaceDeletedWaiter will use default max delay of 120 seconds. Note + // that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeWorkspaceInput, *DescribeWorkspaceOutput, error) (bool, error) +} + +// WorkspaceDeletedWaiter defines the waiters for WorkspaceDeleted +type WorkspaceDeletedWaiter struct { + client DescribeWorkspaceAPIClient + + options WorkspaceDeletedWaiterOptions +} + +// NewWorkspaceDeletedWaiter constructs a WorkspaceDeletedWaiter. +func NewWorkspaceDeletedWaiter(client DescribeWorkspaceAPIClient, optFns ...func(*WorkspaceDeletedWaiterOptions)) *WorkspaceDeletedWaiter { + options := WorkspaceDeletedWaiterOptions{} + options.MinDelay = 2 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = workspaceDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &WorkspaceDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for WorkspaceDeleted waiter. The maxWaitDur is +// the maximum wait duration the waiter will wait. The maxWaitDur is required and +// must be greater than zero. +func (w *WorkspaceDeletedWaiter) Wait(ctx context.Context, params *DescribeWorkspaceInput, maxWaitDur time.Duration, optFns ...func(*WorkspaceDeletedWaiterOptions)) error { + if maxWaitDur <= 0 { + return fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeWorkspace(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return err + } + if !retryable { + return nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return fmt.Errorf("exceeded max wait time for WorkspaceDeleted waiter") +} + +func workspaceDeletedStateRetryable(ctx context.Context, input *DescribeWorkspaceInput, output *DescribeWorkspaceOutput, err error) (bool, error) { + + if err != nil { + var errorType *types.ResourceNotFoundException + if errors.As(err, &errorType) { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("workspace.status.statusCode", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "DELETING" + value, ok := pathValue.(types.WorkspaceStatusCode) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.WorkspaceStatusCode value, got %T", pathValue) + } + + if string(value) == expectedValue { + return true, nil + } + } + + return true, nil +} + func newServiceMetadataMiddleware_opDescribeWorkspace(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/amp/api_op_ListRuleGroupsNamespaces.go b/service/amp/api_op_ListRuleGroupsNamespaces.go new file mode 100644 index 00000000000..e5be4d7043a --- /dev/null +++ b/service/amp/api_op_ListRuleGroupsNamespaces.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists rule groups namespaces. +func (c *Client) ListRuleGroupsNamespaces(ctx context.Context, params *ListRuleGroupsNamespacesInput, optFns ...func(*Options)) (*ListRuleGroupsNamespacesOutput, error) { + if params == nil { + params = &ListRuleGroupsNamespacesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRuleGroupsNamespaces", params, optFns, c.addOperationListRuleGroupsNamespacesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRuleGroupsNamespacesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a ListRuleGroupsNamespaces operation. +type ListRuleGroupsNamespacesInput struct { + + // The ID of the workspace. + // + // This member is required. + WorkspaceId *string + + // Maximum results to return in response (default=100, maximum=1000). + MaxResults *int32 + + // Optional filter for rule groups namespace name. Only the rule groups namespace + // that begin with this value will be returned. + Name *string + + // Pagination token to request the next page in a paginated list. This token is + // obtained from the output of the previous ListRuleGroupsNamespaces request. + NextToken *string + + noSmithyDocumentSerde +} + +// Represents the output of a ListRuleGroupsNamespaces operation. +type ListRuleGroupsNamespacesOutput struct { + + // The list of the selected rule groups namespaces. + // + // This member is required. + RuleGroupsNamespaces []types.RuleGroupsNamespaceSummary + + // Pagination token to use when requesting the next page in this list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRuleGroupsNamespacesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRuleGroupsNamespaces{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRuleGroupsNamespaces{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListRuleGroupsNamespacesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRuleGroupsNamespaces(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListRuleGroupsNamespacesAPIClient is a client that implements the +// ListRuleGroupsNamespaces operation. +type ListRuleGroupsNamespacesAPIClient interface { + ListRuleGroupsNamespaces(context.Context, *ListRuleGroupsNamespacesInput, ...func(*Options)) (*ListRuleGroupsNamespacesOutput, error) +} + +var _ ListRuleGroupsNamespacesAPIClient = (*Client)(nil) + +// ListRuleGroupsNamespacesPaginatorOptions is the paginator options for +// ListRuleGroupsNamespaces +type ListRuleGroupsNamespacesPaginatorOptions struct { + // Maximum results to return in response (default=100, maximum=1000). + 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 +} + +// ListRuleGroupsNamespacesPaginator is a paginator for ListRuleGroupsNamespaces +type ListRuleGroupsNamespacesPaginator struct { + options ListRuleGroupsNamespacesPaginatorOptions + client ListRuleGroupsNamespacesAPIClient + params *ListRuleGroupsNamespacesInput + nextToken *string + firstPage bool +} + +// NewListRuleGroupsNamespacesPaginator returns a new +// ListRuleGroupsNamespacesPaginator +func NewListRuleGroupsNamespacesPaginator(client ListRuleGroupsNamespacesAPIClient, params *ListRuleGroupsNamespacesInput, optFns ...func(*ListRuleGroupsNamespacesPaginatorOptions)) *ListRuleGroupsNamespacesPaginator { + if params == nil { + params = &ListRuleGroupsNamespacesInput{} + } + + options := ListRuleGroupsNamespacesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRuleGroupsNamespacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRuleGroupsNamespacesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRuleGroupsNamespaces page. +func (p *ListRuleGroupsNamespacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRuleGroupsNamespacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListRuleGroupsNamespaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListRuleGroupsNamespaces(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "ListRuleGroupsNamespaces", + } +} diff --git a/service/amp/api_op_PutAlertManagerDefinition.go b/service/amp/api_op_PutAlertManagerDefinition.go new file mode 100644 index 00000000000..fdc849c68e1 --- /dev/null +++ b/service/amp/api_op_PutAlertManagerDefinition.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update an alert manager definition. +func (c *Client) PutAlertManagerDefinition(ctx context.Context, params *PutAlertManagerDefinitionInput, optFns ...func(*Options)) (*PutAlertManagerDefinitionOutput, error) { + if params == nil { + params = &PutAlertManagerDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutAlertManagerDefinition", params, optFns, c.addOperationPutAlertManagerDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutAlertManagerDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a PutAlertManagerDefinition operation. +type PutAlertManagerDefinitionInput struct { + + // The alert manager definition data. + // + // This member is required. + Data []byte + + // The ID of the workspace in which to update the alert manager definition. + // + // This member is required. + WorkspaceId *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +// Represents the output of a PutAlertManagerDefinition operation. +type PutAlertManagerDefinitionOutput struct { + + // The status of alert manager definition. + // + // This member is required. + Status *types.AlertManagerDefinitionStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutAlertManagerDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAlertManagerDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutAlertManagerDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAlertManagerDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutAlertManagerDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "PutAlertManagerDefinition", + } +} diff --git a/service/amp/api_op_PutRuleGroupsNamespace.go b/service/amp/api_op_PutRuleGroupsNamespace.go new file mode 100644 index 00000000000..9af4f8f57fa --- /dev/null +++ b/service/amp/api_op_PutRuleGroupsNamespace.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/amp/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a rule groups namespace. +func (c *Client) PutRuleGroupsNamespace(ctx context.Context, params *PutRuleGroupsNamespaceInput, optFns ...func(*Options)) (*PutRuleGroupsNamespaceOutput, error) { + if params == nil { + params = &PutRuleGroupsNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutRuleGroupsNamespace", params, optFns, c.addOperationPutRuleGroupsNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutRuleGroupsNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Represents the input of a PutRuleGroupsNamespace operation. +type PutRuleGroupsNamespaceInput struct { + + // The namespace data that define the rule groups. + // + // This member is required. + Data []byte + + // The rule groups namespace name. + // + // This member is required. + Name *string + + // The ID of the workspace in which to update the rule group namespace. + // + // This member is required. + WorkspaceId *string + + // Optional, unique, case-sensitive, user-provided identifier to ensure the + // idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +// Represents the output of a PutRuleGroupsNamespace operation. +type PutRuleGroupsNamespaceOutput struct { + + // The Amazon Resource Name (ARN) of this rule groups namespace. + // + // This member is required. + Arn *string + + // The rule groups namespace name. + // + // This member is required. + Name *string + + // The status of rule groups namespace. + // + // This member is required. + Status *types.RuleGroupsNamespaceStatus + + // The tags of this rule groups namespace. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutRuleGroupsNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutRuleGroupsNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutRuleGroupsNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRuleGroupsNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutRuleGroupsNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aps", + OperationName: "PutRuleGroupsNamespace", + } +} diff --git a/service/amp/deserializers.go b/service/amp/deserializers.go index dd54db1e119..00663572d93 100644 --- a/service/amp/deserializers.go +++ b/service/amp/deserializers.go @@ -5,6 +5,7 @@ package amp import ( "bytes" "context" + "encoding/base64" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" @@ -21,14 +22,14 @@ import ( "strings" ) -type awsRestjson1_deserializeOpCreateWorkspace struct { +type awsRestjson1_deserializeOpCreateAlertManagerDefinition struct { } -func (*awsRestjson1_deserializeOpCreateWorkspace) ID() string { +func (*awsRestjson1_deserializeOpCreateAlertManagerDefinition) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAlertManagerDefinition) 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) @@ -42,9 +43,9 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAlertManagerDefinition(response, &metadata) } - output := &CreateWorkspaceOutput{} + output := &CreateAlertManagerDefinitionOutput{} out.Result = output var buff [1024]byte @@ -65,7 +66,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAlertManagerDefinitionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -78,7 +79,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAlertManagerDefinition(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)} @@ -128,6 +129,9 @@ func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Respons 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) @@ -147,7 +151,7 @@ func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAlertManagerDefinitionOutput(v **CreateAlertManagerDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -160,43 +164,20 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateWorkspaceOutput + var sv *CreateAlertManagerDefinitionOutput if *v == nil { - sv = &CreateWorkspaceOutput{} + sv = &CreateAlertManagerDefinitionOutput{} } 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 WorkspaceArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - case "status": - if err := awsRestjson1_deserializeDocumentWorkspaceStatus(&sv.Status, value); err != nil { - return err - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(&sv.Status, value); err != nil { return err } - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkspaceId to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) - } - default: _, _ = key, value @@ -206,14 +187,14 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace return nil } -type awsRestjson1_deserializeOpDeleteWorkspace struct { +type awsRestjson1_deserializeOpCreateRuleGroupsNamespace struct { } -func (*awsRestjson1_deserializeOpDeleteWorkspace) ID() string { +func (*awsRestjson1_deserializeOpCreateRuleGroupsNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateRuleGroupsNamespace) 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) @@ -227,21 +208,43 @@ func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateRuleGroupsNamespace(response, &metadata) } - output := &DeleteWorkspaceOutput{} + output := &CreateRuleGroupsNamespaceOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentCreateRuleGroupsNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateRuleGroupsNamespace(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)} @@ -285,12 +288,18 @@ func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Respons 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) @@ -307,14 +316,73 @@ func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDescribeWorkspace struct { +func awsRestjson1_deserializeOpDocumentCreateRuleGroupsNamespaceOutput(v **CreateRuleGroupsNamespaceOutput, 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 *CreateRuleGroupsNamespaceOutput + if *v == nil { + sv = &CreateRuleGroupsNamespaceOutput{} + } 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 RuleGroupsNamespaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, 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_deserializeOpDescribeWorkspace) ID() string { +type awsRestjson1_deserializeOpCreateWorkspace struct { +} + +func (*awsRestjson1_deserializeOpCreateWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateWorkspace) 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) @@ -328,9 +396,9 @@ func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkspace(response, &metadata) } - output := &DescribeWorkspaceOutput{} + output := &CreateWorkspaceOutput{} out.Result = output var buff [1024]byte @@ -351,7 +419,7 @@ func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -364,7 +432,7 @@ func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateWorkspace(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)} @@ -408,11 +476,14 @@ func awsRestjson1_deserializeOpErrorDescribeWorkspace(response *smithyhttp.Respo 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) @@ -430,7 +501,7 @@ func awsRestjson1_deserializeOpErrorDescribeWorkspace(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorkspaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -443,20 +514,43 @@ func awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorks return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeWorkspaceOutput + var sv *CreateWorkspaceOutput if *v == nil { - sv = &DescribeWorkspaceOutput{} + sv = &CreateWorkspaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "workspace": - if err := awsRestjson1_deserializeDocumentWorkspaceDescription(&sv.Workspace, value); err != nil { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentWorkspaceStatus(&sv.Status, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceId to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) + } + default: _, _ = key, value @@ -466,14 +560,14 @@ func awsRestjson1_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorks return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpDeleteAlertManagerDefinition struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpDeleteAlertManagerDefinition) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAlertManagerDefinition) 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) @@ -487,43 +581,21 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &DeleteAlertManagerDefinitionOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAlertManagerDefinition(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)} @@ -567,6 +639,9 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res 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) @@ -589,50 +664,14 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -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_deserializeOpListWorkspaces struct { +type awsRestjson1_deserializeOpDeleteRuleGroupsNamespace struct { } -func (*awsRestjson1_deserializeOpListWorkspaces) ID() string { +func (*awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRuleGroupsNamespace) 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) @@ -646,43 +685,21 @@ func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListWorkspaces(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(response, &metadata) } - output := &ListWorkspacesOutput{} + output := &DeleteRuleGroupsNamespaceOutput{} 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_deserializeOpDocumentListWorkspacesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRuleGroupsNamespace(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)} @@ -726,9 +743,15 @@ func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response 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) @@ -745,59 +768,14 @@ func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOutput, 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 *ListWorkspacesOutput - if *v == nil { - sv = &ListWorkspacesOutput{} - } 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 PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "workspaces": - if err := awsRestjson1_deserializeDocumentWorkspaceSummaryList(&sv.Workspaces, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpDeleteWorkspace struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpDeleteWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteWorkspace) 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) @@ -811,15 +789,21 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkspace(response, &metadata) } - output := &TagResourceOutput{} + output := &DeleteWorkspaceOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteWorkspace(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)} @@ -863,6 +847,9 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m 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) @@ -885,14 +872,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +type awsRestjson1_deserializeOpDescribeAlertManagerDefinition struct { } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +func (*awsRestjson1_deserializeOpDescribeAlertManagerDefinition) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAlertManagerDefinition) 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) @@ -906,15 +893,43 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(response, &metadata) } - output := &UntagResourceOutput{} + output := &DescribeAlertManagerDefinitionOutput{} 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_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAlertManagerDefinition(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)} @@ -980,14 +995,50 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateWorkspaceAlias struct { +func awsRestjson1_deserializeOpDocumentDescribeAlertManagerDefinitionOutput(v **DescribeAlertManagerDefinitionOutput, 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 *DescribeAlertManagerDefinitionOutput + if *v == nil { + sv = &DescribeAlertManagerDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "alertManagerDefinition": + if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(&sv.AlertManagerDefinition, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateWorkspaceAlias) ID() string { +type awsRestjson1_deserializeOpDescribeRuleGroupsNamespace struct { +} + +func (*awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateWorkspaceAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeRuleGroupsNamespace) 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) @@ -1001,21 +1052,43 @@ func (m *awsRestjson1_deserializeOpUpdateWorkspaceAlias) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeRuleGroupsNamespace(response, &metadata) } - output := &UpdateWorkspaceAliasOutput{} + output := &DescribeRuleGroupsNamespaceOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeRuleGroupsNamespace(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)} @@ -1059,18 +1132,12 @@ func awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response *smithyhttp.Re 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) @@ -1087,54 +1154,1391 @@ func awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpDocumentDescribeRuleGroupsNamespaceOutput(v **DescribeRuleGroupsNamespaceOutput, value interface{}) error { if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - vv, err := strconv.ParseInt(headerValues[0], 0, 32) - if err != nil { - return err - } - v.RetryAfterSeconds = ptr.Int32(int32(vv)) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - return nil -} -func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + var sv *DescribeRuleGroupsNamespaceOutput + if *v == nil { + sv = &DescribeRuleGroupsNamespaceOutput{} + } else { + sv = *v } - if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - vv, err := strconv.ParseInt(headerValues[0], 0, 32) - if err != nil { - return err + for key, value := range shape { + switch key { + case "ruleGroupsNamespace": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(&sv.RuleGroupsNamespace, value); err != nil { + return err + } + + default: + _, _ = key, value + } - v.RetryAfterSeconds = ptr.Int32(int32(vv)) } - + *v = sv 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(), - } +type awsRestjson1_deserializeOpDescribeWorkspace struct { +} + +func (*awsRestjson1_deserializeOpDescribeWorkspace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDescribeWorkspace(response, &metadata) + } + output := &DescribeWorkspaceOutput{} + 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_deserializeOpDocumentDescribeWorkspaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeWorkspace(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpDocumentDescribeWorkspaceOutput(v **DescribeWorkspaceOutput, 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 *DescribeWorkspaceOutput + if *v == nil { + sv = &DescribeWorkspaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "workspace": + if err := awsRestjson1_deserializeDocumentWorkspaceDescription(&sv.Workspace, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRuleGroupsNamespaces struct { +} + +func (*awsRestjson1_deserializeOpListRuleGroupsNamespaces) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRuleGroupsNamespaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListRuleGroupsNamespaces(response, &metadata) + } + output := &ListRuleGroupsNamespacesOutput{} + 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_deserializeOpDocumentListRuleGroupsNamespacesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListRuleGroupsNamespaces(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpDocumentListRuleGroupsNamespacesOutput(v **ListRuleGroupsNamespacesOutput, 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 *ListRuleGroupsNamespacesOutput + if *v == nil { + sv = &ListRuleGroupsNamespacesOutput{} + } 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 PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ruleGroupsNamespaces": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummaryList(&sv.RuleGroupsNamespaces, value); err != nil { + return err + } + + 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 + } + + 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(), + } + } + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpListWorkspaces struct { +} + +func (*awsRestjson1_deserializeOpListWorkspaces) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListWorkspaces(response, &metadata) + } + output := &ListWorkspacesOutput{} + 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_deserializeOpDocumentListWorkspacesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListWorkspaces(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOutput, 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 *ListWorkspacesOutput + if *v == nil { + sv = &ListWorkspacesOutput{} + } 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 PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "workspaces": + if err := awsRestjson1_deserializeDocumentWorkspaceSummaryList(&sv.Workspaces, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutAlertManagerDefinition struct { +} + +func (*awsRestjson1_deserializeOpPutAlertManagerDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutAlertManagerDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(response, &metadata) + } + output := &PutAlertManagerDefinitionOutput{} + 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_deserializeOpDocumentPutAlertManagerDefinitionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutAlertManagerDefinition(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpDocumentPutAlertManagerDefinitionOutput(v **PutAlertManagerDefinitionOutput, 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 *PutAlertManagerDefinitionOutput + if *v == nil { + sv = &PutAlertManagerDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "status": + if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutRuleGroupsNamespace struct { +} + +func (*awsRestjson1_deserializeOpPutRuleGroupsNamespace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutRuleGroupsNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(response, &metadata) + } + output := &PutRuleGroupsNamespaceOutput{} + 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_deserializeOpDocumentPutRuleGroupsNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutRuleGroupsNamespace(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpDocumentPutRuleGroupsNamespaceOutput(v **PutRuleGroupsNamespaceOutput, 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 *PutRuleGroupsNamespaceOutput + if *v == nil { + sv = &PutRuleGroupsNamespaceOutput{} + } 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 RuleGroupsNamespaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, 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 +} + +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 + } + + 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 + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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 + } + + 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 + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpUpdateWorkspaceAlias struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkspaceAlias) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkspaceAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(response, &metadata) + } + output := &UpdateWorkspaceAliasOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateWorkspaceAlias(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_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("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + 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("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + 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 } @@ -1392,22 +2796,152 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAlertManagerDefinitionDescription(v **types.AlertManagerDefinitionDescription, 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.AlertManagerDefinitionDescription + if *v == nil { + sv = &types.AlertManagerDefinitionDescription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "data": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlertManagerDefinitionData to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode AlertManagerDefinitionData, %w", err) + } + sv.Data = dv + } + + case "modifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if err := awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAlertManagerDefinitionStatus(v **types.AlertManagerDefinitionStatus, 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.AlertManagerDefinitionStatus if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.AlertManagerDefinitionStatus{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "statusCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlertManagerDefinitionStatusCode to be of type string, got %T instead", value) + } + sv.StatusCode = types.AlertManagerDefinitionStatusCode(jtv) + } + + case "statusReason": 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) + sv.StatusReason = ptr.String(jtv) } default: @@ -1588,6 +3122,284 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsRestjson1_deserializeDocumentRuleGroupsNamespaceDescription(v **types.RuleGroupsNamespaceDescription, 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.RuleGroupsNamespaceDescription + if *v == nil { + sv = &types.RuleGroupsNamespaceDescription{} + } 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 RuleGroupsNamespaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "data": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceData to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode RuleGroupsNamespaceData, %w", err) + } + sv.Data = dv + } + + case "modifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, 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_deserializeDocumentRuleGroupsNamespaceStatus(v **types.RuleGroupsNamespaceStatus, 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.RuleGroupsNamespaceStatus + if *v == nil { + sv = &types.RuleGroupsNamespaceStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "statusCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceStatusCode to be of type string, got %T instead", value) + } + sv.StatusCode = types.RuleGroupsNamespaceStatusCode(jtv) + } + + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(v **types.RuleGroupsNamespaceSummary, 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.RuleGroupsNamespaceSummary + if *v == nil { + sv = &types.RuleGroupsNamespaceSummary{} + } 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 RuleGroupsNamespaceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "modifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleGroupsNamespaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceStatus(&sv.Status, 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_deserializeDocumentRuleGroupsNamespaceSummaryList(v *[]types.RuleGroupsNamespaceSummary, 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.RuleGroupsNamespaceSummary + if *v == nil { + cv = []types.RuleGroupsNamespaceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RuleGroupsNamespaceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentRuleGroupsNamespaceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/amp/generated.json b/service/amp/generated.json index 379b3a70449..0dc2c0242b5 100644 --- a/service/amp/generated.json +++ b/service/amp/generated.json @@ -1,15 +1,25 @@ { "dependencies": { "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/smithy-go": "v1.4.0" + "github.com/aws/smithy-go": "v1.4.0", + "github.com/jmespath/go-jmespath": "v0.4.0" }, "files": [ "api_client.go", + "api_op_CreateAlertManagerDefinition.go", + "api_op_CreateRuleGroupsNamespace.go", "api_op_CreateWorkspace.go", + "api_op_DeleteAlertManagerDefinition.go", + "api_op_DeleteRuleGroupsNamespace.go", "api_op_DeleteWorkspace.go", + "api_op_DescribeAlertManagerDefinition.go", + "api_op_DescribeRuleGroupsNamespace.go", "api_op_DescribeWorkspace.go", + "api_op_ListRuleGroupsNamespaces.go", "api_op_ListTagsForResource.go", "api_op_ListWorkspaces.go", + "api_op_PutAlertManagerDefinition.go", + "api_op_PutRuleGroupsNamespace.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateWorkspaceAlias.go", diff --git a/service/amp/go.mod b/service/amp/go.mod index b9b48371ce5..96e0957cc8a 100644 --- a/service/amp/go.mod +++ b/service/amp/go.mod @@ -5,6 +5,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v1.9.1 github.com/aws/smithy-go v1.8.0 + github.com/jmespath/go-jmespath v0.4.0 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/amp/go.sum b/service/amp/go.sum index 779915f8ab7..d5bb6d9e2fb 100644 --- a/service/amp/go.sum +++ b/service/amp/go.sum @@ -1,14 +1,20 @@ github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/amp/internal/endpoints/endpoints.go b/service/amp/internal/endpoints/endpoints.go index 87cb690b200..35ed51afdf3 100644 --- a/service/amp/internal/endpoints/endpoints.go +++ b/service/amp/internal/endpoints/endpoints.go @@ -63,11 +63,15 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "eu-central-1": endpoints.Endpoint{}, - "eu-west-1": endpoints.Endpoint{}, - "us-east-1": endpoints.Endpoint{}, - "us-east-2": endpoints.Endpoint{}, - "us-west-2": endpoints.Endpoint{}, + "ap-northeast-1": endpoints.Endpoint{}, + "ap-southeast-1": endpoints.Endpoint{}, + "ap-southeast-2": endpoints.Endpoint{}, + "eu-central-1": endpoints.Endpoint{}, + "eu-north-1": endpoints.Endpoint{}, + "eu-west-1": endpoints.Endpoint{}, + "us-east-1": endpoints.Endpoint{}, + "us-east-2": endpoints.Endpoint{}, + "us-west-2": endpoints.Endpoint{}, }, }, { diff --git a/service/amp/serializers.go b/service/amp/serializers.go index acac4de45ee..5bfeb2f4bf3 100644 --- a/service/amp/serializers.go +++ b/service/amp/serializers.go @@ -13,6 +13,190 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpCreateAlertManagerDefinition struct { +} + +func (*awsRestjson1_serializeOpCreateAlertManagerDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAlertManagerDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateAlertManagerDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/alertmanager/definition") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateAlertManagerDefinitionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateAlertManagerDefinitionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateAlertManagerDefinitionInput(v *CreateAlertManagerDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAlertManagerDefinitionInput(v *CreateAlertManagerDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Data != nil { + ok := object.Key("data") + ok.Base64EncodeBytes(v.Data) + } + + return nil +} + +type awsRestjson1_serializeOpCreateRuleGroupsNamespace struct { +} + +func (*awsRestjson1_serializeOpCreateRuleGroupsNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateRuleGroupsNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateRuleGroupsNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/rulegroupsnamespaces") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateRuleGroupsNamespaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateRuleGroupsNamespaceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateRuleGroupsNamespaceInput(v *CreateRuleGroupsNamespaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateRuleGroupsNamespaceInput(v *CreateRuleGroupsNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Data != nil { + ok := object.Key("data") + ok.Base64EncodeBytes(v.Data) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateWorkspace struct { } @@ -93,14 +277,14 @@ func awsRestjson1_serializeOpDocumentCreateWorkspaceInput(v *CreateWorkspaceInpu return nil } -type awsRestjson1_serializeOpDeleteWorkspace struct { +type awsRestjson1_serializeOpDeleteAlertManagerDefinition struct { } -func (*awsRestjson1_serializeOpDeleteWorkspace) ID() string { +func (*awsRestjson1_serializeOpDeleteAlertManagerDefinition) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteWorkspace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteAlertManagerDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -108,13 +292,13 @@ func (m *awsRestjson1_serializeOpDeleteWorkspace) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteWorkspaceInput) + input, ok := in.Parameters.(*DeleteAlertManagerDefinitionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}") + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/alertmanager/definition") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" @@ -123,7 +307,7 @@ func (m *awsRestjson1_serializeOpDeleteWorkspace) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteWorkspaceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteAlertManagerDefinitionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -134,7 +318,7 @@ func (m *awsRestjson1_serializeOpDeleteWorkspace) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteWorkspaceInput(v *DeleteWorkspaceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteAlertManagerDefinitionInput(v *DeleteAlertManagerDefinitionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -155,14 +339,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteWorkspaceInput(v *DeleteWorkspace return nil } -type awsRestjson1_serializeOpDescribeWorkspace struct { +type awsRestjson1_serializeOpDeleteRuleGroupsNamespace struct { } -func (*awsRestjson1_serializeOpDescribeWorkspace) ID() string { +func (*awsRestjson1_serializeOpDeleteRuleGroupsNamespace) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeWorkspace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteRuleGroupsNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -170,22 +354,22 @@ func (m *awsRestjson1_serializeOpDescribeWorkspace) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeWorkspaceInput) + input, ok := in.Parameters.(*DeleteRuleGroupsNamespaceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}") + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/rulegroupsnamespaces/{name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDescribeWorkspaceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteRuleGroupsNamespaceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -196,11 +380,24 @@ func (m *awsRestjson1_serializeOpDescribeWorkspace) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeWorkspaceInput(v *DescribeWorkspaceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteRuleGroupsNamespaceInput(v *DeleteRuleGroupsNamespaceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} } @@ -213,14 +410,14 @@ func awsRestjson1_serializeOpHttpBindingsDescribeWorkspaceInput(v *DescribeWorks return nil } -type awsRestjson1_serializeOpListTagsForResource struct { +type awsRestjson1_serializeOpDeleteWorkspace struct { } -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { +func (*awsRestjson1_serializeOpDeleteWorkspace) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteWorkspace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -228,22 +425,22 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsForResourceInput) + input, ok := in.Parameters.(*DeleteWorkspaceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteWorkspaceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -254,16 +451,20 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteWorkspaceInput(v *DeleteWorkspaceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { return err } } @@ -271,14 +472,14 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } -type awsRestjson1_serializeOpListWorkspaces struct { +type awsRestjson1_serializeOpDescribeAlertManagerDefinition struct { } -func (*awsRestjson1_serializeOpListWorkspaces) ID() string { +func (*awsRestjson1_serializeOpDescribeAlertManagerDefinition) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListWorkspaces) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAlertManagerDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -286,13 +487,13 @@ func (m *awsRestjson1_serializeOpListWorkspaces) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListWorkspacesInput) + input, ok := in.Parameters.(*DescribeAlertManagerDefinitionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workspaces") + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/alertmanager/definition") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -301,7 +502,7 @@ func (m *awsRestjson1_serializeOpListWorkspaces) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListWorkspacesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDescribeAlertManagerDefinitionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -312,21 +513,513 @@ func (m *awsRestjson1_serializeOpListWorkspaces) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListWorkspacesInput(v *ListWorkspacesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAlertManagerDefinitionInput(v *DescribeAlertManagerDefinitionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.Alias != nil { - encoder.SetQuery("alias").String(*v.Alias) + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } } - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) + return nil +} + +type awsRestjson1_serializeOpDescribeRuleGroupsNamespace struct { +} + +func (*awsRestjson1_serializeOpDescribeRuleGroupsNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeRuleGroupsNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) + input, ok := in.Parameters.(*DescribeRuleGroupsNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/rulegroupsnamespaces/{name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeRuleGroupsNamespaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribeRuleGroupsNamespaceInput(v *DescribeRuleGroupsNamespaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribeWorkspace struct { +} + +func (*awsRestjson1_serializeOpDescribeWorkspace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeWorkspace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeWorkspaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeWorkspaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribeWorkspaceInput(v *DescribeWorkspaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListRuleGroupsNamespaces struct { +} + +func (*awsRestjson1_serializeOpListRuleGroupsNamespaces) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRuleGroupsNamespaces) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListRuleGroupsNamespacesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/rulegroupsnamespaces") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListRuleGroupsNamespacesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListRuleGroupsNamespacesInput(v *ListRuleGroupsNamespacesInput, 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.Name != nil { + encoder.SetQuery("name").String(*v.Name) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + 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, +) { + 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("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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 + + 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.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListWorkspaces struct { +} + +func (*awsRestjson1_serializeOpListWorkspaces) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWorkspaces) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWorkspacesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListWorkspacesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListWorkspacesInput(v *ListWorkspacesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Alias != nil { + encoder.SetQuery("alias").String(*v.Alias) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpPutAlertManagerDefinition struct { +} + +func (*awsRestjson1_serializeOpPutAlertManagerDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutAlertManagerDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutAlertManagerDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/alertmanager/definition") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutAlertManagerDefinitionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutAlertManagerDefinitionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutAlertManagerDefinitionInput(v *PutAlertManagerDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutAlertManagerDefinitionInput(v *PutAlertManagerDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Data != nil { + ok := object.Key("data") + ok.Base64EncodeBytes(v.Data) + } + + return nil +} + +type awsRestjson1_serializeOpPutRuleGroupsNamespace struct { +} + +func (*awsRestjson1_serializeOpPutRuleGroupsNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutRuleGroupsNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutRuleGroupsNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/rulegroupsnamespaces/{name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutRuleGroupsNamespaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutRuleGroupsNamespaceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutRuleGroupsNamespaceInput(v *PutRuleGroupsNamespaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutRuleGroupsNamespaceInput(v *PutRuleGroupsNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Data != nil { + ok := object.Key("data") + ok.Base64EncodeBytes(v.Data) } return nil diff --git a/service/amp/types/enums.go b/service/amp/types/enums.go index 3c7c02b8ff8..d0efca7df5d 100644 --- a/service/amp/types/enums.go +++ b/service/amp/types/enums.go @@ -2,6 +2,80 @@ package types +type AlertManagerDefinitionStatusCode string + +// Enum values for AlertManagerDefinitionStatusCode +const ( + // Definition is being created. Update/Deletion is disallowed until definition is + // ACTIVE and workspace status is ACTIVE. + AlertManagerDefinitionStatusCodeCreating AlertManagerDefinitionStatusCode = "CREATING" + // Definition has been created/updated. Update/Deletion is disallowed until + // definition is ACTIVE and workspace status is ACTIVE. + AlertManagerDefinitionStatusCodeActive AlertManagerDefinitionStatusCode = "ACTIVE" + // Definition is being updated. Update/Deletion is disallowed until definition is + // ACTIVE and workspace status is ACTIVE. + AlertManagerDefinitionStatusCodeUpdating AlertManagerDefinitionStatusCode = "UPDATING" + // Definition is being deleting. Update/Deletion is disallowed until definition is + // ACTIVE and workspace status is ACTIVE. + AlertManagerDefinitionStatusCodeDeleting AlertManagerDefinitionStatusCode = "DELETING" + // Definition creation failed. + AlertManagerDefinitionStatusCodeCreationFailed AlertManagerDefinitionStatusCode = "CREATION_FAILED" + // Definition update failed. + AlertManagerDefinitionStatusCodeUpdateFailed AlertManagerDefinitionStatusCode = "UPDATE_FAILED" +) + +// Values returns all known values for AlertManagerDefinitionStatusCode. 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 (AlertManagerDefinitionStatusCode) Values() []AlertManagerDefinitionStatusCode { + return []AlertManagerDefinitionStatusCode{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "CREATION_FAILED", + "UPDATE_FAILED", + } +} + +type RuleGroupsNamespaceStatusCode string + +// Enum values for RuleGroupsNamespaceStatusCode +const ( + // Namespace is being created. Update/Deletion is disallowed until namespace is + // ACTIVE and workspace status is ACTIVE. + RuleGroupsNamespaceStatusCodeCreating RuleGroupsNamespaceStatusCode = "CREATING" + // Namespace has been created/updated. Update/Deletion is disallowed until + // namespace is ACTIVE and workspace status is ACTIVE. + RuleGroupsNamespaceStatusCodeActive RuleGroupsNamespaceStatusCode = "ACTIVE" + // Namespace is being updated. Update/Deletion is disallowed until namespace is + // ACTIVE and workspace status is ACTIVE. + RuleGroupsNamespaceStatusCodeUpdating RuleGroupsNamespaceStatusCode = "UPDATING" + // Namespace is being deleting. Update/Deletion is disallowed until namespace is + // ACTIVE and workspace status is ACTIVE. + RuleGroupsNamespaceStatusCodeDeleting RuleGroupsNamespaceStatusCode = "DELETING" + // Namespace creation failed. + RuleGroupsNamespaceStatusCodeCreationFailed RuleGroupsNamespaceStatusCode = "CREATION_FAILED" + // Namespace update failed. + RuleGroupsNamespaceStatusCodeUpdateFailed RuleGroupsNamespaceStatusCode = "UPDATE_FAILED" +) + +// Values returns all known values for RuleGroupsNamespaceStatusCode. 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 (RuleGroupsNamespaceStatusCode) Values() []RuleGroupsNamespaceStatusCode { + return []RuleGroupsNamespaceStatusCode{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "CREATION_FAILED", + "UPDATE_FAILED", + } +} + type ValidationExceptionReason string // Enum values for ValidationExceptionReason diff --git a/service/amp/types/types.go b/service/amp/types/types.go index 85afb20df66..edeba2a91a2 100644 --- a/service/amp/types/types.go +++ b/service/amp/types/types.go @@ -7,6 +7,133 @@ import ( "time" ) +// Represents the properties of an alert manager definition. +type AlertManagerDefinitionDescription struct { + + // The time when the alert manager definition was created. + // + // This member is required. + CreatedAt *time.Time + + // The alert manager definition. + // + // This member is required. + Data []byte + + // The time when the alert manager definition was modified. + // + // This member is required. + ModifiedAt *time.Time + + // The status of alert manager definition. + // + // This member is required. + Status *AlertManagerDefinitionStatus + + noSmithyDocumentSerde +} + +// Represents the status of a definition. +type AlertManagerDefinitionStatus struct { + + // Status code of this definition. + // + // This member is required. + StatusCode AlertManagerDefinitionStatusCode + + // The reason for failure if any. + StatusReason *string + + noSmithyDocumentSerde +} + +// Represents a description of the rule groups namespace. +type RuleGroupsNamespaceDescription struct { + + // The Amazon Resource Name (ARN) of this rule groups namespace. + // + // This member is required. + Arn *string + + // The time when the rule groups namespace was created. + // + // This member is required. + CreatedAt *time.Time + + // The rule groups namespace data. + // + // This member is required. + Data []byte + + // The time when the rule groups namespace was modified. + // + // This member is required. + ModifiedAt *time.Time + + // The rule groups namespace name. + // + // This member is required. + Name *string + + // The status of rule groups namespace. + // + // This member is required. + Status *RuleGroupsNamespaceStatus + + // The tags of this rule groups namespace. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Represents the status of a namespace. +type RuleGroupsNamespaceStatus struct { + + // Status code of this namespace. + // + // This member is required. + StatusCode RuleGroupsNamespaceStatusCode + + // The reason for failure if any. + StatusReason *string + + noSmithyDocumentSerde +} + +// Represents a summary of the rule groups namespace. +type RuleGroupsNamespaceSummary struct { + + // The Amazon Resource Name (ARN) of this rule groups namespace. + // + // This member is required. + Arn *string + + // The time when the rule groups namespace was created. + // + // This member is required. + CreatedAt *time.Time + + // The time when the rule groups namespace was modified. + // + // This member is required. + ModifiedAt *time.Time + + // The rule groups namespace name. + // + // This member is required. + Name *string + + // The status of rule groups namespace. + // + // This member is required. + Status *RuleGroupsNamespaceStatus + + // The tags of this rule groups namespace. + Tags map[string]string + + noSmithyDocumentSerde +} + // Stores information about a field passed inside a request that resulted in an // exception. type ValidationExceptionField struct { diff --git a/service/amp/validators.go b/service/amp/validators.go index b5adb78cd8f..71c2b0290b1 100644 --- a/service/amp/validators.go +++ b/service/amp/validators.go @@ -9,6 +9,86 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpCreateAlertManagerDefinition struct { +} + +func (*validateOpCreateAlertManagerDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAlertManagerDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAlertManagerDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAlertManagerDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateRuleGroupsNamespace struct { +} + +func (*validateOpCreateRuleGroupsNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRuleGroupsNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRuleGroupsNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRuleGroupsNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAlertManagerDefinition struct { +} + +func (*validateOpDeleteAlertManagerDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAlertManagerDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAlertManagerDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAlertManagerDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteRuleGroupsNamespace struct { +} + +func (*validateOpDeleteRuleGroupsNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRuleGroupsNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRuleGroupsNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRuleGroupsNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteWorkspace struct { } @@ -29,6 +109,46 @@ func (m *validateOpDeleteWorkspace) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDescribeAlertManagerDefinition struct { +} + +func (*validateOpDescribeAlertManagerDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeAlertManagerDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeAlertManagerDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeAlertManagerDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeRuleGroupsNamespace struct { +} + +func (*validateOpDescribeRuleGroupsNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeRuleGroupsNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeRuleGroupsNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeRuleGroupsNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeWorkspace struct { } @@ -49,6 +169,26 @@ func (m *validateOpDescribeWorkspace) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpListRuleGroupsNamespaces struct { +} + +func (*validateOpListRuleGroupsNamespaces) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRuleGroupsNamespaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRuleGroupsNamespacesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRuleGroupsNamespacesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -69,6 +209,46 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpPutAlertManagerDefinition struct { +} + +func (*validateOpPutAlertManagerDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutAlertManagerDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutAlertManagerDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutAlertManagerDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutRuleGroupsNamespace struct { +} + +func (*validateOpPutRuleGroupsNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutRuleGroupsNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutRuleGroupsNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutRuleGroupsNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -129,18 +309,54 @@ func (m *validateOpUpdateWorkspaceAlias) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +func addOpCreateAlertManagerDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAlertManagerDefinition{}, middleware.After) +} + +func addOpCreateRuleGroupsNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRuleGroupsNamespace{}, middleware.After) +} + +func addOpDeleteAlertManagerDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAlertManagerDefinition{}, middleware.After) +} + +func addOpDeleteRuleGroupsNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRuleGroupsNamespace{}, middleware.After) +} + func addOpDeleteWorkspaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWorkspace{}, middleware.After) } +func addOpDescribeAlertManagerDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeAlertManagerDefinition{}, middleware.After) +} + +func addOpDescribeRuleGroupsNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeRuleGroupsNamespace{}, middleware.After) +} + func addOpDescribeWorkspaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorkspace{}, middleware.After) } +func addOpListRuleGroupsNamespacesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRuleGroupsNamespaces{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpPutAlertManagerDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutAlertManagerDefinition{}, middleware.After) +} + +func addOpPutRuleGroupsNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutRuleGroupsNamespace{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -153,6 +369,78 @@ func addOpUpdateWorkspaceAliasValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpUpdateWorkspaceAlias{}, middleware.After) } +func validateOpCreateAlertManagerDefinitionInput(v *CreateAlertManagerDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAlertManagerDefinitionInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateRuleGroupsNamespaceInput(v *CreateRuleGroupsNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRuleGroupsNamespaceInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAlertManagerDefinitionInput(v *DeleteAlertManagerDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAlertManagerDefinitionInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteRuleGroupsNamespaceInput(v *DeleteRuleGroupsNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRuleGroupsNamespaceInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteWorkspaceInput(v *DeleteWorkspaceInput) error { if v == nil { return nil @@ -168,6 +456,39 @@ func validateOpDeleteWorkspaceInput(v *DeleteWorkspaceInput) error { } } +func validateOpDescribeAlertManagerDefinitionInput(v *DescribeAlertManagerDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeAlertManagerDefinitionInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeRuleGroupsNamespaceInput(v *DescribeRuleGroupsNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeRuleGroupsNamespaceInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeWorkspaceInput(v *DescribeWorkspaceInput) error { if v == nil { return nil @@ -183,6 +504,21 @@ func validateOpDescribeWorkspaceInput(v *DescribeWorkspaceInput) error { } } +func validateOpListRuleGroupsNamespacesInput(v *ListRuleGroupsNamespacesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRuleGroupsNamespacesInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -198,6 +534,45 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpPutAlertManagerDefinitionInput(v *PutAlertManagerDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutAlertManagerDefinitionInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutRuleGroupsNamespaceInput(v *PutRuleGroupsNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutRuleGroupsNamespaceInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Data == nil { + invalidParams.Add(smithy.NewErrParamRequired("Data")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/appintegrations/api_op_CreateDataIntegration.go b/service/appintegrations/api_op_CreateDataIntegration.go new file mode 100644 index 00000000000..0afa5a692f4 --- /dev/null +++ b/service/appintegrations/api_op_CreateDataIntegration.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/appintegrations/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and persists a DataIntegration resource. You cannot create a +// DataIntegration association for a DataIntegration that has been previously +// associated. Use a different DataIntegration, or recreate the DataIntegration +// using the CreateDataIntegration API. +func (c *Client) CreateDataIntegration(ctx context.Context, params *CreateDataIntegrationInput, optFns ...func(*Options)) (*CreateDataIntegrationOutput, error) { + if params == nil { + params = &CreateDataIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDataIntegration", params, optFns, c.addOperationCreateDataIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDataIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDataIntegrationInput struct { + + // The name of the DataIntegration. + // + // This member is required. + Name *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + // A description of the DataIntegration. + Description *string + + // The KMS key for the DataIntegration. + KmsKey *string + + // The name of the data and how often it should be pulled from the source. + ScheduleConfig *types.ScheduleConfiguration + + // The URI of the data source. + SourceURI *string + + // One or more tags. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateDataIntegrationOutput struct { + + // The Amazon Resource Name (ARN) + Arn *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + // A description of the DataIntegration. + Description *string + + // A unique identifier. + Id *string + + // The KMS key for the DataIntegration. + KmsKey *string + + // The name of the DataIntegration. + Name *string + + // The name of the data and how often it should be pulled from the source. + ScheduleConfiguration *types.ScheduleConfiguration + + // The URI of the data source. + SourceURI *string + + // One or more tags. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDataIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDataIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDataIntegration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateDataIntegrationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDataIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateDataIntegration struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateDataIntegration) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateDataIntegration) 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.(*CreateDataIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDataIntegrationInput ") + } + + 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_opCreateDataIntegrationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDataIntegration{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateDataIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "CreateDataIntegration", + } +} diff --git a/service/appintegrations/api_op_DeleteDataIntegration.go b/service/appintegrations/api_op_DeleteDataIntegration.go new file mode 100644 index 00000000000..5592e798315 --- /dev/null +++ b/service/appintegrations/api_op_DeleteDataIntegration.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the DataIntegration. Only DataIntegrations that don't have any +// DataIntegrationAssociations can be deleted. Deleting a DataIntegration also +// deletes the underlying Amazon AppFlow flow and service linked role. You cannot +// create a DataIntegration association for a DataIntegration that has been +// previously associated. Use a different DataIntegration, or recreate the +// DataIntegration using the CreateDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) +// API. +func (c *Client) DeleteDataIntegration(ctx context.Context, params *DeleteDataIntegrationInput, optFns ...func(*Options)) (*DeleteDataIntegrationOutput, error) { + if params == nil { + params = &DeleteDataIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDataIntegration", params, optFns, c.addOperationDeleteDataIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDataIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDataIntegrationInput struct { + + // A unique identifier for the DataIntegration. + // + // This member is required. + DataIntegrationIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteDataIntegrationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDataIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDataIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDataIntegration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteDataIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDataIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "DeleteDataIntegration", + } +} diff --git a/service/appintegrations/api_op_GetDataIntegration.go b/service/appintegrations/api_op_GetDataIntegration.go new file mode 100644 index 00000000000..9166e3a4e3f --- /dev/null +++ b/service/appintegrations/api_op_GetDataIntegration.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/appintegrations/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about the DataIntegration. You cannot create a +// DataIntegration association for a DataIntegration that has been previously +// associated. Use a different DataIntegration, or recreate the DataIntegration +// using the CreateDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) +// API. +func (c *Client) GetDataIntegration(ctx context.Context, params *GetDataIntegrationInput, optFns ...func(*Options)) (*GetDataIntegrationOutput, error) { + if params == nil { + params = &GetDataIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDataIntegration", params, optFns, c.addOperationGetDataIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDataIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDataIntegrationInput struct { + + // A unique identifier. + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + +type GetDataIntegrationOutput struct { + + // The Amazon Resource Name (ARN) for the DataIntegration. + Arn *string + + // The KMS key for the DataIntegration. + Description *string + + // A unique identifier. + Id *string + + // The KMS key for the DataIntegration. + KmsKey *string + + // The name of the DataIntegration. + Name *string + + // The name of the data and how often it should be pulled from the source. + ScheduleConfiguration *types.ScheduleConfiguration + + // The URI of the data source. + SourceURI *string + + // One or more tags. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDataIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataIntegration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDataIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDataIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "GetDataIntegration", + } +} diff --git a/service/appintegrations/api_op_GetEventIntegration.go b/service/appintegrations/api_op_GetEventIntegration.go index cdb5fe9e35d..3ab4d954ce5 100644 --- a/service/appintegrations/api_op_GetEventIntegration.go +++ b/service/appintegrations/api_op_GetEventIntegration.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Return information about the event integration. +// Returns information about the event integration. func (c *Client) GetEventIntegration(ctx context.Context, params *GetEventIntegrationInput, optFns ...func(*Options)) (*GetEventIntegrationOutput, error) { if params == nil { params = &GetEventIntegrationInput{} diff --git a/service/appintegrations/api_op_ListDataIntegrationAssociations.go b/service/appintegrations/api_op_ListDataIntegrationAssociations.go new file mode 100644 index 00000000000..c8ba4527f14 --- /dev/null +++ b/service/appintegrations/api_op_ListDataIntegrationAssociations.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/appintegrations/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of DataIntegration associations in the account. You +// cannot create a DataIntegration association for a DataIntegration that has been +// previously associated. Use a different DataIntegration, or recreate the +// DataIntegration using the CreateDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) +// API. +func (c *Client) ListDataIntegrationAssociations(ctx context.Context, params *ListDataIntegrationAssociationsInput, optFns ...func(*Options)) (*ListDataIntegrationAssociationsOutput, error) { + if params == nil { + params = &ListDataIntegrationAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDataIntegrationAssociations", params, optFns, c.addOperationListDataIntegrationAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDataIntegrationAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDataIntegrationAssociationsInput struct { + + // A unique identifier for the DataIntegration. + // + // This member is required. + DataIntegrationIdentifier *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDataIntegrationAssociationsOutput struct { + + // The Amazon Resource Name (ARN) and unique ID of the DataIntegration association. + DataIntegrationAssociations []types.DataIntegrationAssociationSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDataIntegrationAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDataIntegrationAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDataIntegrationAssociations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListDataIntegrationAssociationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataIntegrationAssociations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListDataIntegrationAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "ListDataIntegrationAssociations", + } +} diff --git a/service/appintegrations/api_op_ListDataIntegrations.go b/service/appintegrations/api_op_ListDataIntegrations.go new file mode 100644 index 00000000000..a318c8d496e --- /dev/null +++ b/service/appintegrations/api_op_ListDataIntegrations.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/appintegrations/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of DataIntegrations in the account. You cannot create a +// DataIntegration association for a DataIntegration that has been previously +// associated. Use a different DataIntegration, or recreate the DataIntegration +// using the CreateDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) +// API. +func (c *Client) ListDataIntegrations(ctx context.Context, params *ListDataIntegrationsInput, optFns ...func(*Options)) (*ListDataIntegrationsOutput, error) { + if params == nil { + params = &ListDataIntegrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDataIntegrations", params, optFns, c.addOperationListDataIntegrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDataIntegrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDataIntegrationsInput struct { + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDataIntegrationsOutput struct { + + // The DataIntegrations associated with this account. + DataIntegrations []types.DataIntegrationSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDataIntegrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDataIntegrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDataIntegrations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataIntegrations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListDataIntegrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "ListDataIntegrations", + } +} diff --git a/service/appintegrations/api_op_UpdateDataIntegration.go b/service/appintegrations/api_op_UpdateDataIntegration.go new file mode 100644 index 00000000000..95c838d7c2f --- /dev/null +++ b/service/appintegrations/api_op_UpdateDataIntegration.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the description of a DataIntegration. You cannot create a +// DataIntegration association for a DataIntegration that has been previously +// associated. Use a different DataIntegration, or recreate the DataIntegration +// using the CreateDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) +// API. +func (c *Client) UpdateDataIntegration(ctx context.Context, params *UpdateDataIntegrationInput, optFns ...func(*Options)) (*UpdateDataIntegrationOutput, error) { + if params == nil { + params = &UpdateDataIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDataIntegration", params, optFns, c.addOperationUpdateDataIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDataIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDataIntegrationInput struct { + + // A unique identifier for the DataIntegration. + // + // This member is required. + Identifier *string + + // A description of the DataIntegration. + Description *string + + // The name of the DataIntegration. + Name *string + + noSmithyDocumentSerde +} + +type UpdateDataIntegrationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDataIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDataIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDataIntegration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateDataIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDataIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateDataIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "app-integrations", + OperationName: "UpdateDataIntegration", + } +} diff --git a/service/appintegrations/deserializers.go b/service/appintegrations/deserializers.go index 03b616d3c35..9c5dcb330f7 100644 --- a/service/appintegrations/deserializers.go +++ b/service/appintegrations/deserializers.go @@ -18,14 +18,1018 @@ import ( "strings" ) +type awsRestjson1_deserializeOpCreateDataIntegration struct { +} + +func (*awsRestjson1_deserializeOpCreateDataIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDataIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateDataIntegration(response, &metadata) + } + output := &CreateDataIntegrationOutput{} + 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_deserializeOpDocumentCreateDataIntegrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateDataIntegration(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDataIntegrationOutput(v **CreateDataIntegrationOutput, 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 *CreateDataIntegrationOutput + if *v == nil { + sv = &CreateDataIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "ClientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdempotencyToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "KmsKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.KmsKey = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ScheduleConfiguration": + if err := awsRestjson1_deserializeDocumentScheduleConfiguration(&sv.ScheduleConfiguration, value); err != nil { + return err + } + + case "SourceURI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.SourceURI = 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_deserializeOpCreateEventIntegration struct { } -func (*awsRestjson1_deserializeOpCreateEventIntegration) ID() string { +func (*awsRestjson1_deserializeOpCreateEventIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateEventIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateEventIntegration(response, &metadata) + } + output := &CreateEventIntegrationOutput{} + 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_deserializeOpDocumentCreateEventIntegrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateEventIntegration(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateEventIntegrationOutput(v **CreateEventIntegrationOutput, 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 *CreateEventIntegrationOutput + if *v == nil { + sv = &CreateEventIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EventIntegrationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.EventIntegrationArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteDataIntegration struct { +} + +func (*awsRestjson1_deserializeOpDeleteDataIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDataIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataIntegration(response, &metadata) + } + output := &DeleteDataIntegrationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDataIntegration(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteEventIntegration struct { +} + +func (*awsRestjson1_deserializeOpDeleteEventIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteEventIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteEventIntegration(response, &metadata) + } + output := &DeleteEventIntegrationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteEventIntegration(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetDataIntegration struct { +} + +func (*awsRestjson1_deserializeOpGetDataIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDataIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetDataIntegration(response, &metadata) + } + output := &GetDataIntegrationOutput{} + 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_deserializeOpDocumentGetDataIntegrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetDataIntegration(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDataIntegrationOutput(v **GetDataIntegrationOutput, 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 *GetDataIntegrationOutput + if *v == nil { + sv = &GetDataIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "KmsKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.KmsKey = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ScheduleConfiguration": + if err := awsRestjson1_deserializeDocumentScheduleConfiguration(&sv.ScheduleConfiguration, value); err != nil { + return err + } + + case "SourceURI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.SourceURI = 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_deserializeOpGetEventIntegration struct { +} + +func (*awsRestjson1_deserializeOpGetEventIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetEventIntegration(response, &metadata) + } + output := &GetEventIntegrationOutput{} + 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_deserializeOpDocumentGetEventIntegrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetEventIntegration(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventIntegrationOutput, 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 *GetEventIntegrationOutput + if *v == nil { + sv = &GetEventIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EventBridgeBus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventBridgeBus to be of type string, got %T instead", value) + } + sv.EventBridgeBus = ptr.String(jtv) + } + + case "EventFilter": + if err := awsRestjson1_deserializeDocumentEventFilter(&sv.EventFilter, value); err != nil { + return err + } + + case "EventIntegrationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.EventIntegrationArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = 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_deserializeOpListDataIntegrationAssociations struct { +} + +func (*awsRestjson1_deserializeOpListDataIntegrationAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateEventIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDataIntegrationAssociations) 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) @@ -39,9 +1043,9 @@ func (m *awsRestjson1_deserializeOpCreateEventIntegration) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateEventIntegration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDataIntegrationAssociations(response, &metadata) } - output := &CreateEventIntegrationOutput{} + output := &ListDataIntegrationAssociationsOutput{} out.Result = output var buff [1024]byte @@ -62,7 +1066,7 @@ func (m *awsRestjson1_deserializeOpCreateEventIntegration) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateEventIntegrationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDataIntegrationAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -75,7 +1079,7 @@ func (m *awsRestjson1_deserializeOpCreateEventIntegration) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateEventIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDataIntegrationAssociations(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)} @@ -119,17 +1123,14 @@ func awsRestjson1_deserializeOpErrorCreateEventIntegration(response *smithyhttp. case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("InternalServiceError", errorCode): return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceQuotaExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -144,7 +1145,7 @@ func awsRestjson1_deserializeOpErrorCreateEventIntegration(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentCreateEventIntegrationOutput(v **CreateEventIntegrationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDataIntegrationAssociationsOutput(v **ListDataIntegrationAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -157,22 +1158,27 @@ func awsRestjson1_deserializeOpDocumentCreateEventIntegrationOutput(v **CreateEv return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateEventIntegrationOutput + var sv *ListDataIntegrationAssociationsOutput if *v == nil { - sv = &CreateEventIntegrationOutput{} + sv = &ListDataIntegrationAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "EventIntegrationArn": + case "DataIntegrationAssociations": + if err := awsRestjson1_deserializeDocumentDataIntegrationAssociationsList(&sv.DataIntegrationAssociations, value); err != nil { + return err + } + + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.EventIntegrationArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -184,109 +1190,14 @@ func awsRestjson1_deserializeOpDocumentCreateEventIntegrationOutput(v **CreateEv return nil } -type awsRestjson1_deserializeOpDeleteEventIntegration struct { -} - -func (*awsRestjson1_deserializeOpDeleteEventIntegration) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteEventIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteEventIntegration(response, &metadata) - } - output := &DeleteEventIntegrationOutput{} - out.Result = output - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteEventIntegration(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 - - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - code, 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(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServiceError", errorCode): - return awsRestjson1_deserializeErrorInternalServiceError(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("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpGetEventIntegration struct { +type awsRestjson1_deserializeOpListDataIntegrations struct { } -func (*awsRestjson1_deserializeOpGetEventIntegration) ID() string { +func (*awsRestjson1_deserializeOpListDataIntegrations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDataIntegrations) 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) @@ -300,9 +1211,9 @@ func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetEventIntegration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDataIntegrations(response, &metadata) } - output := &GetEventIntegrationOutput{} + output := &ListDataIntegrationsOutput{} out.Result = output var buff [1024]byte @@ -323,7 +1234,7 @@ func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDataIntegrationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -336,7 +1247,7 @@ func (m *awsRestjson1_deserializeOpGetEventIntegration) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEventIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDataIntegrations(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)} @@ -386,9 +1297,6 @@ func awsRestjson1_deserializeOpErrorGetEventIntegration(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -402,7 +1310,7 @@ func awsRestjson1_deserializeOpErrorGetEventIntegration(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventIntegrationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDataIntegrationsOutput(v **ListDataIntegrationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -415,59 +1323,27 @@ func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventInt return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEventIntegrationOutput + var sv *ListDataIntegrationsOutput if *v == nil { - sv = &GetEventIntegrationOutput{} + sv = &ListDataIntegrationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "EventBridgeBus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EventBridgeBus to be of type string, got %T instead", value) - } - sv.EventBridgeBus = ptr.String(jtv) - } - - case "EventFilter": - if err := awsRestjson1_deserializeDocumentEventFilter(&sv.EventFilter, value); err != nil { + case "DataIntegrations": + if err := awsRestjson1_deserializeDocumentDataIntegrationsList(&sv.DataIntegrations, value); err != nil { return err } - case "EventIntegrationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.EventIntegrationArn = ptr.String(jtv) - } - - case "Name": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) - } - - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } default: @@ -952,30 +1828,122 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor sv = *v } - for key, value := range shape { - switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } + 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_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 + } + + 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 + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) - default: - _, _ = key, value + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } - *v = sv - return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpUntagResource struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -989,15 +1957,15 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } - output := &TagResourceOutput{} + output := &UntagResourceOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -1060,14 +2028,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +type awsRestjson1_deserializeOpUpdateDataIntegration struct { } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +func (*awsRestjson1_deserializeOpUpdateDataIntegration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateDataIntegration) 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) @@ -1081,15 +2049,15 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataIntegration(response, &metadata) } - output := &UntagResourceOutput{} + output := &UpdateDataIntegrationOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateDataIntegration(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)} @@ -1130,6 +2098,9 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServiceError", errorCode): return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) @@ -1575,6 +2546,190 @@ func awsRestjson1_deserializeDocumentClientAssociationMetadata(v *map[string]str return nil } +func awsRestjson1_deserializeDocumentDataIntegrationAssociationsList(v *[]types.DataIntegrationAssociationSummary, 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.DataIntegrationAssociationSummary + if *v == nil { + cv = []types.DataIntegrationAssociationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DataIntegrationAssociationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDataIntegrationAssociationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDataIntegrationAssociationSummary(v **types.DataIntegrationAssociationSummary, 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.DataIntegrationAssociationSummary + if *v == nil { + sv = &types.DataIntegrationAssociationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ClientId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientId to be of type string, got %T instead", value) + } + sv.ClientId = ptr.String(jtv) + } + + case "DataIntegrationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DataIntegrationArn = ptr.String(jtv) + } + + case "DataIntegrationAssociationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DataIntegrationAssociationArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDataIntegrationsList(v *[]types.DataIntegrationSummary, 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.DataIntegrationSummary + if *v == nil { + cv = []types.DataIntegrationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DataIntegrationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDataIntegrationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDataIntegrationSummary(v **types.DataIntegrationSummary, 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.DataIntegrationSummary + if *v == nil { + sv = &types.DataIntegrationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SourceURI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.SourceURI = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDuplicateResourceException(v **types.DuplicateResourceException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2041,6 +3196,64 @@ func awsRestjson1_deserializeDocumentResourceQuotaExceededException(v **types.Re return nil } +func awsRestjson1_deserializeDocumentScheduleConfiguration(v **types.ScheduleConfiguration, 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.ScheduleConfiguration + if *v == nil { + sv = &types.ScheduleConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FirstExecutionFrom": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonBlankString to be of type string, got %T instead", value) + } + sv.FirstExecutionFrom = ptr.String(jtv) + } + + case "Object": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Object to be of type string, got %T instead", value) + } + sv.Object = ptr.String(jtv) + } + + case "ScheduleExpression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Schedule to be of type string, got %T instead", value) + } + sv.ScheduleExpression = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/appintegrations/doc.go b/service/appintegrations/doc.go index 0c739ea5add..e8707c21ae6 100644 --- a/service/appintegrations/doc.go +++ b/service/appintegrations/doc.go @@ -6,6 +6,8 @@ // The Amazon AppIntegrations service enables you to configure and reuse // connections to external applications. For information about how you can use // external applications with Amazon Connect, see Set up pre-built integrations -// (https://docs.aws.amazon.com/connect/latest/adminguide/crm.html) in the Amazon -// Connect Administrator Guide. +// (https://docs.aws.amazon.com/connect/latest/adminguide/crm.html) and Deliver +// information to agents using Amazon Connect Wisdom +// (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-wisdom.html) +// in the Amazon Connect Administrator Guide. package appintegrations diff --git a/service/appintegrations/generated.json b/service/appintegrations/generated.json index c95cb6ada84..cf6f74f3fdf 100644 --- a/service/appintegrations/generated.json +++ b/service/appintegrations/generated.json @@ -5,14 +5,20 @@ }, "files": [ "api_client.go", + "api_op_CreateDataIntegration.go", "api_op_CreateEventIntegration.go", + "api_op_DeleteDataIntegration.go", "api_op_DeleteEventIntegration.go", + "api_op_GetDataIntegration.go", "api_op_GetEventIntegration.go", + "api_op_ListDataIntegrationAssociations.go", + "api_op_ListDataIntegrations.go", "api_op_ListEventIntegrationAssociations.go", "api_op_ListEventIntegrations.go", "api_op_ListTagsForResource.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateDataIntegration.go", "api_op_UpdateEventIntegration.go", "deserializers.go", "doc.go", diff --git a/service/appintegrations/serializers.go b/service/appintegrations/serializers.go index 93eeab52c50..f6ff605176d 100644 --- a/service/appintegrations/serializers.go +++ b/service/appintegrations/serializers.go @@ -14,6 +14,108 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpCreateDataIntegration struct { +} + +func (*awsRestjson1_serializeOpCreateDataIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDataIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDataIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/dataIntegrations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateDataIntegrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateDataIntegrationInput(v *CreateDataIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDataIntegrationInput(v *CreateDataIntegrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.KmsKey != nil { + ok := object.Key("KmsKey") + ok.String(*v.KmsKey) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.ScheduleConfig != nil { + ok := object.Key("ScheduleConfig") + if err := awsRestjson1_serializeDocumentScheduleConfiguration(v.ScheduleConfig, ok); err != nil { + return err + } + } + + if v.SourceURI != nil { + ok := object.Key("SourceURI") + ok.String(*v.SourceURI) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateEventIntegration struct { } @@ -111,6 +213,64 @@ func awsRestjson1_serializeOpDocumentCreateEventIntegrationInput(v *CreateEventI return nil } +type awsRestjson1_serializeOpDeleteDataIntegration struct { +} + +func (*awsRestjson1_serializeOpDeleteDataIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDataIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDataIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/dataIntegrations/{DataIntegrationIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteDataIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteDataIntegrationInput(v *DeleteDataIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DataIntegrationIdentifier == nil || len(*v.DataIntegrationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DataIntegrationIdentifier must not be empty")} + } + if v.DataIntegrationIdentifier != nil { + if err := encoder.SetURI("DataIntegrationIdentifier").String(*v.DataIntegrationIdentifier); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteEventIntegration struct { } @@ -169,6 +329,64 @@ func awsRestjson1_serializeOpHttpBindingsDeleteEventIntegrationInput(v *DeleteEv return nil } +type awsRestjson1_serializeOpGetDataIntegration struct { +} + +func (*awsRestjson1_serializeOpGetDataIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDataIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDataIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/dataIntegrations/{Identifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetDataIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetDataIntegrationInput(v *GetDataIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Identifier == nil || len(*v.Identifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Identifier must not be empty")} + } + if v.Identifier != nil { + if err := encoder.SetURI("Identifier").String(*v.Identifier); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetEventIntegration struct { } @@ -227,6 +445,129 @@ func awsRestjson1_serializeOpHttpBindingsGetEventIntegrationInput(v *GetEventInt return nil } +type awsRestjson1_serializeOpListDataIntegrationAssociations struct { +} + +func (*awsRestjson1_serializeOpListDataIntegrationAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDataIntegrationAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDataIntegrationAssociationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/dataIntegrations/{DataIntegrationIdentifier}/associations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListDataIntegrationAssociationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListDataIntegrationAssociationsInput(v *ListDataIntegrationAssociationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DataIntegrationIdentifier == nil || len(*v.DataIntegrationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DataIntegrationIdentifier must not be empty")} + } + if v.DataIntegrationIdentifier != nil { + if err := encoder.SetURI("DataIntegrationIdentifier").String(*v.DataIntegrationIdentifier); 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_serializeOpListDataIntegrations struct { +} + +func (*awsRestjson1_serializeOpListDataIntegrations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDataIntegrations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDataIntegrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/dataIntegrations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListDataIntegrationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListDataIntegrationsInput(v *ListDataIntegrationsInput, 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) + } + + return nil +} + type awsRestjson1_serializeOpListEventIntegrationAssociations struct { } @@ -555,6 +896,92 @@ func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInpu return nil } +type awsRestjson1_serializeOpUpdateDataIntegration struct { +} + +func (*awsRestjson1_serializeOpUpdateDataIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDataIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDataIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/dataIntegrations/{Identifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateDataIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDataIntegrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateDataIntegrationInput(v *UpdateDataIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Identifier == nil || len(*v.Identifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Identifier must not be empty")} + } + if v.Identifier != nil { + if err := encoder.SetURI("Identifier").String(*v.Identifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDataIntegrationInput(v *UpdateDataIntegrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + type awsRestjson1_serializeOpUpdateEventIntegration struct { } @@ -648,6 +1075,28 @@ func awsRestjson1_serializeDocumentEventFilter(v *types.EventFilter, value smith return nil } +func awsRestjson1_serializeDocumentScheduleConfiguration(v *types.ScheduleConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FirstExecutionFrom != nil { + ok := object.Key("FirstExecutionFrom") + ok.String(*v.FirstExecutionFrom) + } + + if v.Object != nil { + ok := object.Key("Object") + ok.String(*v.Object) + } + + if v.ScheduleExpression != nil { + ok := object.Key("ScheduleExpression") + ok.String(*v.ScheduleExpression) + } + + return nil +} + func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/appintegrations/types/types.go b/service/appintegrations/types/types.go index 1c647e5df72..1a449ea6cb7 100644 --- a/service/appintegrations/types/types.go +++ b/service/appintegrations/types/types.go @@ -6,6 +6,37 @@ import ( smithydocument "github.com/aws/smithy-go/document" ) +// Summary information about the DataIntegration association. +type DataIntegrationAssociationSummary struct { + + // The identifier for teh client that is associated with the DataIntegration + // association. + ClientId *string + + // The Amazon Resource Name (ARN)of the DataIntegration. + DataIntegrationArn *string + + // The Amazon Resource Name (ARN) of the DataIntegration association. + DataIntegrationAssociationArn *string + + noSmithyDocumentSerde +} + +// Summary information about the DataIntegration. +type DataIntegrationSummary struct { + + // The Amazon Resource Name (ARN) of the DataIntegration. + Arn *string + + // The name of the DataIntegration. + Name *string + + // The URI of the data source. + SourceURI *string + + noSmithyDocumentSerde +} + // The event filter. type EventFilter struct { @@ -65,4 +96,19 @@ type EventIntegrationAssociation struct { noSmithyDocumentSerde } +// The name of the data and how often it should be pulled from the source. +type ScheduleConfiguration struct { + + // The start date for objects to import in the first flow run. + FirstExecutionFrom *string + + // The name of the object to pull from the data source. + Object *string + + // How often the data should be pulled from data source. + ScheduleExpression *string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/appintegrations/validators.go b/service/appintegrations/validators.go index ab8267e0626..c959ed1b985 100644 --- a/service/appintegrations/validators.go +++ b/service/appintegrations/validators.go @@ -10,6 +10,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpCreateDataIntegration struct { +} + +func (*validateOpCreateDataIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDataIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDataIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDataIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateEventIntegration struct { } @@ -30,6 +50,26 @@ func (m *validateOpCreateEventIntegration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDeleteDataIntegration struct { +} + +func (*validateOpDeleteDataIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDataIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDataIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDataIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteEventIntegration struct { } @@ -50,6 +90,26 @@ func (m *validateOpDeleteEventIntegration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpGetDataIntegration struct { +} + +func (*validateOpGetDataIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDataIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDataIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDataIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetEventIntegration struct { } @@ -70,6 +130,26 @@ func (m *validateOpGetEventIntegration) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListDataIntegrationAssociations struct { +} + +func (*validateOpListDataIntegrationAssociations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListDataIntegrationAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListDataIntegrationAssociationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListDataIntegrationAssociationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListEventIntegrationAssociations struct { } @@ -150,6 +230,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateDataIntegration struct { +} + +func (*validateOpUpdateDataIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDataIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDataIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDataIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateEventIntegration struct { } @@ -170,18 +270,34 @@ func (m *validateOpUpdateEventIntegration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +func addOpCreateDataIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDataIntegration{}, middleware.After) +} + func addOpCreateEventIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateEventIntegration{}, middleware.After) } +func addOpDeleteDataIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDataIntegration{}, middleware.After) +} + func addOpDeleteEventIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteEventIntegration{}, middleware.After) } +func addOpGetDataIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDataIntegration{}, middleware.After) +} + func addOpGetEventIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEventIntegration{}, middleware.After) } +func addOpListDataIntegrationAssociationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListDataIntegrationAssociations{}, middleware.After) +} + func addOpListEventIntegrationAssociationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListEventIntegrationAssociations{}, middleware.After) } @@ -198,6 +314,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateDataIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDataIntegration{}, middleware.After) +} + func addOpUpdateEventIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateEventIntegration{}, middleware.After) } @@ -217,6 +337,21 @@ func validateEventFilter(v *types.EventFilter) error { } } +func validateOpCreateDataIntegrationInput(v *CreateDataIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDataIntegrationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateEventIntegrationInput(v *CreateEventIntegrationInput) error { if v == nil { return nil @@ -242,6 +377,21 @@ func validateOpCreateEventIntegrationInput(v *CreateEventIntegrationInput) error } } +func validateOpDeleteDataIntegrationInput(v *DeleteDataIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDataIntegrationInput"} + if v.DataIntegrationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataIntegrationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteEventIntegrationInput(v *DeleteEventIntegrationInput) error { if v == nil { return nil @@ -257,6 +407,21 @@ func validateOpDeleteEventIntegrationInput(v *DeleteEventIntegrationInput) error } } +func validateOpGetDataIntegrationInput(v *GetDataIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDataIntegrationInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetEventIntegrationInput(v *GetEventIntegrationInput) error { if v == nil { return nil @@ -272,6 +437,21 @@ func validateOpGetEventIntegrationInput(v *GetEventIntegrationInput) error { } } +func validateOpListDataIntegrationAssociationsInput(v *ListDataIntegrationAssociationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListDataIntegrationAssociationsInput"} + if v.DataIntegrationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataIntegrationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListEventIntegrationAssociationsInput(v *ListEventIntegrationAssociationsInput) error { if v == nil { return nil @@ -338,6 +518,21 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateDataIntegrationInput(v *UpdateDataIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDataIntegrationInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateEventIntegrationInput(v *UpdateEventIntegrationInput) error { if v == nil { return nil diff --git a/service/cloudcontrol/LICENSE.txt b/service/cloudcontrol/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/cloudcontrol/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/cloudcontrol/api_client.go b/service/cloudcontrol/api_client.go new file mode 100644 index 00000000000..049a9977083 --- /dev/null +++ b/service/cloudcontrol/api_client.go @@ -0,0 +1,282 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "CloudControl" +const ServiceAPIVersion = "2021-09-30" + +// Client provides the API client to make operations call for AWS Cloud Control +// API. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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 endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer aws.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "cloudcontrol", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +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 resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/cloudcontrol/api_op_CancelResourceRequest.go b/service/cloudcontrol/api_op_CancelResourceRequest.go new file mode 100644 index 00000000000..8eefdd8ef06 --- /dev/null +++ b/service/cloudcontrol/api_op_CancelResourceRequest.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Cancels the specified resource operation request. For more information, see +// Canceling resource operation requests +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-cancel) +// in the Amazon Web Services Cloud Control API User Guide. Only resource +// operations requests with a status of PENDING or IN_PROGRESS can be cancelled. +func (c *Client) CancelResourceRequest(ctx context.Context, params *CancelResourceRequestInput, optFns ...func(*Options)) (*CancelResourceRequestOutput, error) { + if params == nil { + params = &CancelResourceRequestInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelResourceRequest", params, optFns, c.addOperationCancelResourceRequestMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelResourceRequestOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelResourceRequestInput struct { + + // The RequestToken of the ProgressEvent object returned by the resource operation + // request. + // + // This member is required. + RequestToken *string + + noSmithyDocumentSerde +} + +type CancelResourceRequestOutput struct { + + // Represents the current status of a resource operation request. For more + // information, see Managing resource operation requests + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html) + // in the Amazon Web Services Cloud Control API User Guide. + ProgressEvent *types.ProgressEvent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCancelResourceRequestMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCancelResourceRequest{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCancelResourceRequest{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCancelResourceRequestValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelResourceRequest(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCancelResourceRequest(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "CancelResourceRequest", + } +} diff --git a/service/cloudcontrol/api_op_CreateResource.go b/service/cloudcontrol/api_op_CreateResource.go new file mode 100644 index 00000000000..80cf8bc2e03 --- /dev/null +++ b/service/cloudcontrol/api_op_CreateResource.go @@ -0,0 +1,222 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates the specified resource. For more information, see Creating a resource +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html) +// in the Amazon Web Services Cloud Control API User Guide. After you have +// initiated a resource creation request, you can monitor the progress of your +// request by calling GetResourceRequestStatus +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html) +// using the RequestToken of the ProgressEvent type returned by CreateResource. +func (c *Client) CreateResource(ctx context.Context, params *CreateResourceInput, optFns ...func(*Options)) (*CreateResourceOutput, error) { + if params == nil { + params = &CreateResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateResource", params, optFns, c.addOperationCreateResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateResourceInput struct { + + // Structured data format representing the desired state of the resource, + // consisting of that resource's properties and their desired values. Cloud Control + // API currently supports JSON as a structured data format. Specify the desired + // state as one of the following: + // + // * A JSON blob + // + // * A local path containing the + // desired state in JSON data format + // + // For more information, see Composing the + // desired state of the resource + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html#resource-operations-create-desiredstate) + // in the Amazon Web Services Cloud Control API User Guide. For more information + // about the properties of a specific resource, refer to the related topic for the + // resource in the Resource and property types reference + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // in the Amazon Web Services CloudFormation Users Guide. + // + // This member is required. + DesiredState *string + + // The name of the resource type. + // + // This member is required. + TypeName *string + + // A unique identifier to ensure the idempotency of the resource request. As a best + // practice, specify this token to ensure idempotency, so that Amazon Web Services + // Cloud Control API can accurately distinguish between request retries and new + // resource requests. You might retry a resource request to ensure that it was + // successfully received. A client token is valid for 36 hours once used. After + // that, a resource request with the same client token is treated as a new request. + // If you do not specify a client token, one is generated for inclusion in the + // request. For more information, see Ensuring resource operation requests are + // unique + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency) + // in the Amazon Web Services Cloud Control API User Guide. + ClientToken *string + + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for + // Cloud Control API to use when performing this resource operation. The role + // specified must have the permissions required for this operation. The necessary + // permissions for each event handler are defined in the handlers + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers) + // section of the resource type definition schema + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html). + // If you do not specify a role, Cloud Control API uses a temporary session created + // using your Amazon Web Services user credentials. For more information, see + // Specifying credentials + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions) + // in the Amazon Web Services Cloud Control API User Guide. + RoleArn *string + + // For private resource types, the type version to use in this resource operation. + // If you do not specify a resource version, CloudFormation uses the default + // version. + TypeVersionId *string + + noSmithyDocumentSerde +} + +type CreateResourceOutput struct { + + // Represents the current status of the resource creation request. After you have + // initiated a resource creation request, you can monitor the progress of your + // request by calling GetResourceRequestStatus + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html) + // using the RequestToken of the ProgressEvent returned by CreateResource. + ProgressEvent *types.ProgressEvent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateResourceMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateResource struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateResource) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateResource) 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.(*CreateResourceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateResourceInput ") + } + + 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_opCreateResourceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateResource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "CreateResource", + } +} diff --git a/service/cloudcontrol/api_op_DeleteResource.go b/service/cloudcontrol/api_op_DeleteResource.go new file mode 100644 index 00000000000..51e85e39a85 --- /dev/null +++ b/service/cloudcontrol/api_op_DeleteResource.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified resource. For details, see Deleting a resource +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-delete.html) +// in the Amazon Web Services Cloud Control API User Guide. After you have +// initiated a resource deletion request, you can monitor the progress of your +// request by calling GetResourceRequestStatus +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html) +// using the RequestToken of the ProgressEvent returned by DeleteResource. +func (c *Client) DeleteResource(ctx context.Context, params *DeleteResourceInput, optFns ...func(*Options)) (*DeleteResourceOutput, error) { + if params == nil { + params = &DeleteResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteResource", params, optFns, c.addOperationDeleteResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteResourceInput struct { + + // The identifier for the resource. You can specify the primary identifier, or any + // secondary identifier defined for the resource type in its resource schema. You + // can only specify one identifier. Primary identifiers can be specified as a + // string or JSON; secondary identifiers must be specified as JSON. For compound + // primary identifiers (that is, one that consists of multiple resource properties + // strung together), to specify the primary identifier as a string, list the + // property values in the order they are specified in the primary identifier + // definition, separated by |. For more information, see Identifying resources + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html) + // in the Amazon Web Services Cloud Control API User Guide. + // + // This member is required. + Identifier *string + + // The name of the resource type. + // + // This member is required. + TypeName *string + + // A unique identifier to ensure the idempotency of the resource request. As a best + // practice, specify this token to ensure idempotency, so that Amazon Web Services + // Cloud Control API can accurately distinguish between request retries and new + // resource requests. You might retry a resource request to ensure that it was + // successfully received. A client token is valid for 36 hours once used. After + // that, a resource request with the same client token is treated as a new request. + // If you do not specify a client token, one is generated for inclusion in the + // request. For more information, see Ensuring resource operation requests are + // unique + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency) + // in the Amazon Web Services Cloud Control API User Guide. + ClientToken *string + + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for + // Cloud Control API to use when performing this resource operation. The role + // specified must have the permissions required for this operation. The necessary + // permissions for each event handler are defined in the handlers + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers) + // section of the resource type definition schema + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html). + // If you do not specify a role, Cloud Control API uses a temporary session created + // using your Amazon Web Services user credentials. For more information, see + // Specifying credentials + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions) + // in the Amazon Web Services Cloud Control API User Guide. + RoleArn *string + + // For private resource types, the type version to use in this resource operation. + // If you do not specify a resource version, CloudFormation uses the default + // version. + TypeVersionId *string + + noSmithyDocumentSerde +} + +type DeleteResourceOutput struct { + + // Represents the current status of the resource deletion request. After you have + // initiated a resource deletion request, you can monitor the progress of your + // request by calling GetResourceRequestStatus + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html) + // using the RequestToken of the ProgressEvent returned by DeleteResource. + ProgressEvent *types.ProgressEvent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteResourceMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteResource struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteResource) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteResource) 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.(*DeleteResourceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteResourceInput ") + } + + 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_opDeleteResourceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteResource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "DeleteResource", + } +} diff --git a/service/cloudcontrol/api_op_GetResource.go b/service/cloudcontrol/api_op_GetResource.go new file mode 100644 index 00000000000..c8761dfb6e6 --- /dev/null +++ b/service/cloudcontrol/api_op_GetResource.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about the current state of the specified resource. For +// details, see Reading a resource's current state +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-read.html). +// You can use this action to return information about an existing resource in your +// account and Amazon Web Services Region, whether or not those resources were +// provisioned using Cloud Control API. +func (c *Client) GetResource(ctx context.Context, params *GetResourceInput, optFns ...func(*Options)) (*GetResourceOutput, error) { + if params == nil { + params = &GetResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResource", params, optFns, c.addOperationGetResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourceInput struct { + + // The identifier for the resource. You can specify the primary identifier, or any + // secondary identifier defined for the resource type in its resource schema. You + // can only specify one identifier. Primary identifiers can be specified as a + // string or JSON; secondary identifiers must be specified as JSON. For compound + // primary identifiers (that is, one that consists of multiple resource properties + // strung together), to specify the primary identifier as a string, list the + // property values in the order they are specified in the primary identifier + // definition, separated by |. For more information, see Identifying resources + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html) + // in the Amazon Web Services Cloud Control API User Guide. + // + // This member is required. + Identifier *string + + // The name of the resource type. + // + // This member is required. + TypeName *string + + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for + // Cloud Control API to use when performing this resource operation. The role + // specified must have the permissions required for this operation. The necessary + // permissions for each event handler are defined in the handlers + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers) + // section of the resource type definition schema + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html). + // If you do not specify a role, Cloud Control API uses a temporary session created + // using your Amazon Web Services user credentials. For more information, see + // Specifying credentials + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions) + // in the Amazon Web Services Cloud Control API User Guide. + RoleArn *string + + // For private resource types, the type version to use in this resource operation. + // If you do not specify a resource version, CloudFormation uses the default + // version. + TypeVersionId *string + + noSmithyDocumentSerde +} + +type GetResourceOutput struct { + + // Represents information about a provisioned resource. + ResourceDescription *types.ResourceDescription + + // The name of the resource type. + TypeName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "GetResource", + } +} diff --git a/service/cloudcontrol/api_op_GetResourceRequestStatus.go b/service/cloudcontrol/api_op_GetResourceRequestStatus.go new file mode 100644 index 00000000000..7de11ecc5bf --- /dev/null +++ b/service/cloudcontrol/api_op_GetResourceRequestStatus.go @@ -0,0 +1,325 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "time" +) + +// Returns the current status of a resource operation request. For more +// information, see Tracking the progress of resource operation requests +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-track) +// in the Amazon Web Services Cloud Control API User Guide. +func (c *Client) GetResourceRequestStatus(ctx context.Context, params *GetResourceRequestStatusInput, optFns ...func(*Options)) (*GetResourceRequestStatusOutput, error) { + if params == nil { + params = &GetResourceRequestStatusInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourceRequestStatus", params, optFns, c.addOperationGetResourceRequestStatusMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourceRequestStatusOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourceRequestStatusInput struct { + + // A unique token used to track the progress of the resource operation request. + // Request tokens are included in the ProgressEvent type returned by a resource + // operation request. + // + // This member is required. + RequestToken *string + + noSmithyDocumentSerde +} + +type GetResourceRequestStatusOutput struct { + + // Represents the current status of the resource operation request. + ProgressEvent *types.ProgressEvent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourceRequestStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetResourceRequestStatus{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetResourceRequestStatus{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetResourceRequestStatusValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourceRequestStatus(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// GetResourceRequestStatusAPIClient is a client that implements the +// GetResourceRequestStatus operation. +type GetResourceRequestStatusAPIClient interface { + GetResourceRequestStatus(context.Context, *GetResourceRequestStatusInput, ...func(*Options)) (*GetResourceRequestStatusOutput, error) +} + +var _ GetResourceRequestStatusAPIClient = (*Client)(nil) + +// ResourceRequestSuccessWaiterOptions are waiter options for +// ResourceRequestSuccessWaiter +type ResourceRequestSuccessWaiterOptions 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 + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // ResourceRequestSuccessWaiter will use default minimum delay of 5 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or set + // to zero, ResourceRequestSuccessWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetResourceRequestStatusInput, *GetResourceRequestStatusOutput, error) (bool, error) +} + +// ResourceRequestSuccessWaiter defines the waiters for ResourceRequestSuccess +type ResourceRequestSuccessWaiter struct { + client GetResourceRequestStatusAPIClient + + options ResourceRequestSuccessWaiterOptions +} + +// NewResourceRequestSuccessWaiter constructs a ResourceRequestSuccessWaiter. +func NewResourceRequestSuccessWaiter(client GetResourceRequestStatusAPIClient, optFns ...func(*ResourceRequestSuccessWaiterOptions)) *ResourceRequestSuccessWaiter { + options := ResourceRequestSuccessWaiterOptions{} + options.MinDelay = 5 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = resourceRequestSuccessStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &ResourceRequestSuccessWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for ResourceRequestSuccess waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *ResourceRequestSuccessWaiter) Wait(ctx context.Context, params *GetResourceRequestStatusInput, maxWaitDur time.Duration, optFns ...func(*ResourceRequestSuccessWaiterOptions)) error { + if maxWaitDur <= 0 { + return fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetResourceRequestStatus(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return err + } + if !retryable { + return nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return fmt.Errorf("exceeded max wait time for ResourceRequestSuccess waiter") +} + +func resourceRequestSuccessStateRetryable(ctx context.Context, input *GetResourceRequestStatusInput, output *GetResourceRequestStatusOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("ProgressEvent.OperationStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "SUCCESS" + value, ok := pathValue.(types.OperationStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.OperationStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("ProgressEvent.OperationStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "FAILED" + value, ok := pathValue.(types.OperationStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.OperationStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("ProgressEvent.OperationStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "CANCEL_COMPLETE" + value, ok := pathValue.(types.OperationStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.OperationStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + return true, nil +} + +func newServiceMetadataMiddleware_opGetResourceRequestStatus(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "GetResourceRequestStatus", + } +} diff --git a/service/cloudcontrol/api_op_ListResourceRequests.go b/service/cloudcontrol/api_op_ListResourceRequests.go new file mode 100644 index 00000000000..e811c2c7397 --- /dev/null +++ b/service/cloudcontrol/api_op_ListResourceRequests.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns existing resource operation requests. This includes requests of all +// status types. For more information, see Listing active resource operation +// requests +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-list) +// in the Amazon Web Services Cloud Control API User Guide. Resource operation +// requests expire after seven days. +func (c *Client) ListResourceRequests(ctx context.Context, params *ListResourceRequestsInput, optFns ...func(*Options)) (*ListResourceRequestsOutput, error) { + if params == nil { + params = &ListResourceRequestsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListResourceRequests", params, optFns, c.addOperationListResourceRequestsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListResourceRequestsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListResourceRequestsInput struct { + + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. The default is 20. + MaxResults *int32 + + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call this action again and assign that token to the + // request object's NextToken parameter. If there are no remaining results, the + // previous response object's NextToken parameter is set to null. + NextToken *string + + // The filter criteria to apply to the requests returned. + ResourceRequestStatusFilter *types.ResourceRequestStatusFilter + + noSmithyDocumentSerde +} + +type ListResourceRequestsOutput struct { + + // If the request doesn't return all of the remaining results, NextToken is set to + // a token. To retrieve the next set of results, call ListResources again and + // assign that token to the request object's NextToken parameter. If the request + // returns all results, NextToken is set to null. + NextToken *string + + // The requests that match the specified filter criteria. + ResourceRequestStatusSummaries []types.ProgressEvent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListResourceRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListResourceRequests{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListResourceRequests{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceRequests(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListResourceRequestsAPIClient is a client that implements the +// ListResourceRequests operation. +type ListResourceRequestsAPIClient interface { + ListResourceRequests(context.Context, *ListResourceRequestsInput, ...func(*Options)) (*ListResourceRequestsOutput, error) +} + +var _ ListResourceRequestsAPIClient = (*Client)(nil) + +// ListResourceRequestsPaginatorOptions is the paginator options for +// ListResourceRequests +type ListResourceRequestsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. The default is 20. + 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 +} + +// ListResourceRequestsPaginator is a paginator for ListResourceRequests +type ListResourceRequestsPaginator struct { + options ListResourceRequestsPaginatorOptions + client ListResourceRequestsAPIClient + params *ListResourceRequestsInput + nextToken *string + firstPage bool +} + +// NewListResourceRequestsPaginator returns a new ListResourceRequestsPaginator +func NewListResourceRequestsPaginator(client ListResourceRequestsAPIClient, params *ListResourceRequestsInput, optFns ...func(*ListResourceRequestsPaginatorOptions)) *ListResourceRequestsPaginator { + if params == nil { + params = &ListResourceRequestsInput{} + } + + options := ListResourceRequestsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListResourceRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceRequestsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResourceRequests page. +func (p *ListResourceRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListResourceRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListResourceRequests(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "ListResourceRequests", + } +} diff --git a/service/cloudcontrol/api_op_ListResources.go b/service/cloudcontrol/api_op_ListResources.go new file mode 100644 index 00000000000..e7c5bfa1456 --- /dev/null +++ b/service/cloudcontrol/api_op_ListResources.go @@ -0,0 +1,259 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about the specified resources. For more information, see +// Discovering resources in the Amazon Web Services Cloud Control API User Guide. +// You can use this action to return information about existing resources in your +// account and Amazon Web Services Region, whether or not those resources were +// provisioned using Cloud Control API. +func (c *Client) ListResources(ctx context.Context, params *ListResourcesInput, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if params == nil { + params = &ListResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListResources", params, optFns, c.addOperationListResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListResourcesInput struct { + + // The name of the resource type. + // + // This member is required. + TypeName *string + + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. The default is 20. + MaxResults *int32 + + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call this action again and assign that token to the + // request object's NextToken parameter. If there are no remaining results, the + // previous response object's NextToken parameter is set to null. + NextToken *string + + // The resource model to use to select the resources to return. + ResourceModel *string + + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for + // Cloud Control API to use when performing this resource operation. The role + // specified must have the permissions required for this operation. The necessary + // permissions for each event handler are defined in the handlers + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers) + // section of the resource type definition schema + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html). + // If you do not specify a role, Cloud Control API uses a temporary session created + // using your Amazon Web Services user credentials. For more information, see + // Specifying credentials + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions) + // in the Amazon Web Services Cloud Control API User Guide. + RoleArn *string + + // For private resource types, the type version to use in this resource operation. + // If you do not specify a resource version, CloudFormation uses the default + // version. + TypeVersionId *string + + noSmithyDocumentSerde +} + +type ListResourcesOutput struct { + + // If the request doesn't return all of the remaining results, NextToken is set to + // a token. To retrieve the next set of results, call ListResources again and + // assign that token to the request object's NextToken parameter. If the request + // returns all results, NextToken is set to null. + NextToken *string + + // Information about the specified resources, including primary identifier and + // resource model. + ResourceDescriptions []types.ResourceDescription + + // The name of the resource type. + TypeName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListResources{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResources(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListResourcesAPIClient is a client that implements the ListResources operation. +type ListResourcesAPIClient interface { + ListResources(context.Context, *ListResourcesInput, ...func(*Options)) (*ListResourcesOutput, error) +} + +var _ ListResourcesAPIClient = (*Client)(nil) + +// ListResourcesPaginatorOptions is the paginator options for ListResources +type ListResourcesPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. The default is 20. + 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 +} + +// ListResourcesPaginator is a paginator for ListResources +type ListResourcesPaginator struct { + options ListResourcesPaginatorOptions + client ListResourcesAPIClient + params *ListResourcesInput + nextToken *string + firstPage bool +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + if params == nil { + params = &ListResourcesInput{} + } + + options := ListResourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResources page. +func (p *ListResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "ListResources", + } +} diff --git a/service/cloudcontrol/api_op_UpdateResource.go b/service/cloudcontrol/api_op_UpdateResource.go new file mode 100644 index 00000000000..9209438fa82 --- /dev/null +++ b/service/cloudcontrol/api_op_UpdateResource.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the specified property values in the resource. You specify your resource +// property updates as a list of patch operations contained in a JSON patch +// document that adheres to the RFC 6902 - JavaScript Object Notation (JSON) Patch +// (https://datatracker.ietf.org/doc/html/rfc6902) standard. For details on how +// Cloud Control API performs resource update operations, see Updating a resource +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-update.html) +// in the Amazon Web Services Cloud Control API User Guide. After you have +// initiated a resource update request, you can monitor the progress of your +// request by calling GetResourceRequestStatus +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html) +// using the RequestToken of the ProgressEvent returned by UpdateResource. For more +// information about the properties of a specific resource, refer to the related +// topic for the resource in the Resource and property types reference +// (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) +// in the Amazon Web Services CloudFormation Users Guide. +func (c *Client) UpdateResource(ctx context.Context, params *UpdateResourceInput, optFns ...func(*Options)) (*UpdateResourceOutput, error) { + if params == nil { + params = &UpdateResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateResource", params, optFns, c.addOperationUpdateResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateResourceInput struct { + + // The identifier for the resource. You can specify the primary identifier, or any + // secondary identifier defined for the resource type in its resource schema. You + // can only specify one identifier. Primary identifiers can be specified as a + // string or JSON; secondary identifiers must be specified as JSON. For compound + // primary identifiers (that is, one that consists of multiple resource properties + // strung together), to specify the primary identifier as a string, list the + // property values in the order they are specified in the primary identifier + // definition, separated by |. For more information, see Identifying resources + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html) + // in the Amazon Web Services Cloud Control API User Guide. + // + // This member is required. + Identifier *string + + // A JavaScript Object Notation (JSON) document listing the patch operations that + // represent the updates to apply to the current resource properties. For details, + // see Composing the patch document + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-update.html#resource-operations-update-patch) + // in the Amazon Web Services Cloud Control API User Guide. + // + // This member is required. + PatchDocument *string + + // The name of the resource type. + // + // This member is required. + TypeName *string + + // A unique identifier to ensure the idempotency of the resource request. As a best + // practice, specify this token to ensure idempotency, so that Amazon Web Services + // Cloud Control API can accurately distinguish between request retries and new + // resource requests. You might retry a resource request to ensure that it was + // successfully received. A client token is valid for 36 hours once used. After + // that, a resource request with the same client token is treated as a new request. + // If you do not specify a client token, one is generated for inclusion in the + // request. For more information, see Ensuring resource operation requests are + // unique + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency) + // in the Amazon Web Services Cloud Control API User Guide. + ClientToken *string + + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) for + // Cloud Control API to use when performing this resource operation. The role + // specified must have the permissions required for this operation. The necessary + // permissions for each event handler are defined in the handlers + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers) + // section of the resource type definition schema + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html). + // If you do not specify a role, Cloud Control API uses a temporary session created + // using your Amazon Web Services user credentials. For more information, see + // Specifying credentials + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions) + // in the Amazon Web Services Cloud Control API User Guide. + RoleArn *string + + // For private resource types, the type version to use in this resource operation. + // If you do not specify a resource version, CloudFormation uses the default + // version. + TypeVersionId *string + + noSmithyDocumentSerde +} + +type UpdateResourceOutput struct { + + // Represents the current status of the resource update request. Use the + // RequestToken of the ProgressEvent with GetResourceRequestStatus + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html) + // to return the current status of a resource operation request. + ProgressEvent *types.ProgressEvent + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opUpdateResourceMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpUpdateResource struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateResource) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateResource) 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.(*UpdateResourceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateResourceInput ") + } + + 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_opUpdateResourceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateResource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudcontrolapi", + OperationName: "UpdateResource", + } +} diff --git a/service/cloudcontrol/deserializers.go b/service/cloudcontrol/deserializers.go new file mode 100644 index 00000000000..691bd07b41c --- /dev/null +++ b/service/cloudcontrol/deserializers.go @@ -0,0 +1,3317 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsAwsjson10_deserializeOpCancelResourceRequest struct { +} + +func (*awsAwsjson10_deserializeOpCancelResourceRequest) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCancelResourceRequest) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorCancelResourceRequest(response, &metadata) + } + output := &CancelResourceRequestOutput{} + 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_deserializeOpDocumentCancelResourceRequestOutput(&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_deserializeOpErrorCancelResourceRequest(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("RequestTokenNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorRequestTokenNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpCreateResource struct { +} + +func (*awsAwsjson10_deserializeOpCreateResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorCreateResource(response, &metadata) + } + output := &CreateResourceOutput{} + 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_deserializeOpDocumentCreateResourceOutput(&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_deserializeOpErrorCreateResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AlreadyExistsException", errorCode): + return awsAwsjson10_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ClientTokenConflictException", errorCode): + return awsAwsjson10_deserializeErrorClientTokenConflictException(response, errorBody) + + case strings.EqualFold("ConcurrentOperationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentOperationException(response, errorBody) + + case strings.EqualFold("GeneralServiceException", errorCode): + return awsAwsjson10_deserializeErrorGeneralServiceException(response, errorBody) + + case strings.EqualFold("HandlerFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerFailureException(response, errorBody) + + case strings.EqualFold("HandlerInternalFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidCredentialsException", errorCode): + return awsAwsjson10_deserializeErrorInvalidCredentialsException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NetworkFailureException", errorCode): + return awsAwsjson10_deserializeErrorNetworkFailureException(response, errorBody) + + case strings.EqualFold("NotStabilizedException", errorCode): + return awsAwsjson10_deserializeErrorNotStabilizedException(response, errorBody) + + case strings.EqualFold("NotUpdatableException", errorCode): + return awsAwsjson10_deserializeErrorNotUpdatableException(response, errorBody) + + case strings.EqualFold("PrivateTypeException", errorCode): + return awsAwsjson10_deserializeErrorPrivateTypeException(response, errorBody) + + case strings.EqualFold("ResourceConflictException", errorCode): + return awsAwsjson10_deserializeErrorResourceConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceInternalErrorException", errorCode): + return awsAwsjson10_deserializeErrorServiceInternalErrorException(response, errorBody) + + case strings.EqualFold("ServiceLimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceLimitExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TypeNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorTypeNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedActionException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedActionException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpDeleteResource struct { +} + +func (*awsAwsjson10_deserializeOpDeleteResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteResource(response, &metadata) + } + output := &DeleteResourceOutput{} + 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_deserializeOpDocumentDeleteResourceOutput(&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_deserializeOpErrorDeleteResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AlreadyExistsException", errorCode): + return awsAwsjson10_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ClientTokenConflictException", errorCode): + return awsAwsjson10_deserializeErrorClientTokenConflictException(response, errorBody) + + case strings.EqualFold("ConcurrentOperationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentOperationException(response, errorBody) + + case strings.EqualFold("GeneralServiceException", errorCode): + return awsAwsjson10_deserializeErrorGeneralServiceException(response, errorBody) + + case strings.EqualFold("HandlerFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerFailureException(response, errorBody) + + case strings.EqualFold("HandlerInternalFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidCredentialsException", errorCode): + return awsAwsjson10_deserializeErrorInvalidCredentialsException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NetworkFailureException", errorCode): + return awsAwsjson10_deserializeErrorNetworkFailureException(response, errorBody) + + case strings.EqualFold("NotStabilizedException", errorCode): + return awsAwsjson10_deserializeErrorNotStabilizedException(response, errorBody) + + case strings.EqualFold("NotUpdatableException", errorCode): + return awsAwsjson10_deserializeErrorNotUpdatableException(response, errorBody) + + case strings.EqualFold("PrivateTypeException", errorCode): + return awsAwsjson10_deserializeErrorPrivateTypeException(response, errorBody) + + case strings.EqualFold("ResourceConflictException", errorCode): + return awsAwsjson10_deserializeErrorResourceConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceInternalErrorException", errorCode): + return awsAwsjson10_deserializeErrorServiceInternalErrorException(response, errorBody) + + case strings.EqualFold("ServiceLimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceLimitExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TypeNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorTypeNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedActionException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedActionException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetResource struct { +} + +func (*awsAwsjson10_deserializeOpGetResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorGetResource(response, &metadata) + } + output := &GetResourceOutput{} + 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_deserializeOpDocumentGetResourceOutput(&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_deserializeOpErrorGetResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AlreadyExistsException", errorCode): + return awsAwsjson10_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("GeneralServiceException", errorCode): + return awsAwsjson10_deserializeErrorGeneralServiceException(response, errorBody) + + case strings.EqualFold("HandlerFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerFailureException(response, errorBody) + + case strings.EqualFold("HandlerInternalFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidCredentialsException", errorCode): + return awsAwsjson10_deserializeErrorInvalidCredentialsException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NetworkFailureException", errorCode): + return awsAwsjson10_deserializeErrorNetworkFailureException(response, errorBody) + + case strings.EqualFold("NotStabilizedException", errorCode): + return awsAwsjson10_deserializeErrorNotStabilizedException(response, errorBody) + + case strings.EqualFold("NotUpdatableException", errorCode): + return awsAwsjson10_deserializeErrorNotUpdatableException(response, errorBody) + + case strings.EqualFold("PrivateTypeException", errorCode): + return awsAwsjson10_deserializeErrorPrivateTypeException(response, errorBody) + + case strings.EqualFold("ResourceConflictException", errorCode): + return awsAwsjson10_deserializeErrorResourceConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceInternalErrorException", errorCode): + return awsAwsjson10_deserializeErrorServiceInternalErrorException(response, errorBody) + + case strings.EqualFold("ServiceLimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceLimitExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TypeNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorTypeNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedActionException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedActionException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetResourceRequestStatus struct { +} + +func (*awsAwsjson10_deserializeOpGetResourceRequestStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetResourceRequestStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorGetResourceRequestStatus(response, &metadata) + } + output := &GetResourceRequestStatusOutput{} + 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_deserializeOpDocumentGetResourceRequestStatusOutput(&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_deserializeOpErrorGetResourceRequestStatus(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("RequestTokenNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorRequestTokenNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListResourceRequests struct { +} + +func (*awsAwsjson10_deserializeOpListResourceRequests) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListResourceRequests) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListResourceRequests(response, &metadata) + } + output := &ListResourceRequestsOutput{} + 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_deserializeOpDocumentListResourceRequestsOutput(&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_deserializeOpErrorListResourceRequests(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListResources struct { +} + +func (*awsAwsjson10_deserializeOpListResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListResources(response, &metadata) + } + output := &ListResourcesOutput{} + 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_deserializeOpDocumentListResourcesOutput(&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_deserializeOpErrorListResources(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AlreadyExistsException", errorCode): + return awsAwsjson10_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("GeneralServiceException", errorCode): + return awsAwsjson10_deserializeErrorGeneralServiceException(response, errorBody) + + case strings.EqualFold("HandlerFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerFailureException(response, errorBody) + + case strings.EqualFold("HandlerInternalFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidCredentialsException", errorCode): + return awsAwsjson10_deserializeErrorInvalidCredentialsException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NetworkFailureException", errorCode): + return awsAwsjson10_deserializeErrorNetworkFailureException(response, errorBody) + + case strings.EqualFold("NotStabilizedException", errorCode): + return awsAwsjson10_deserializeErrorNotStabilizedException(response, errorBody) + + case strings.EqualFold("NotUpdatableException", errorCode): + return awsAwsjson10_deserializeErrorNotUpdatableException(response, errorBody) + + case strings.EqualFold("PrivateTypeException", errorCode): + return awsAwsjson10_deserializeErrorPrivateTypeException(response, errorBody) + + case strings.EqualFold("ResourceConflictException", errorCode): + return awsAwsjson10_deserializeErrorResourceConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceInternalErrorException", errorCode): + return awsAwsjson10_deserializeErrorServiceInternalErrorException(response, errorBody) + + case strings.EqualFold("ServiceLimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceLimitExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TypeNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorTypeNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedActionException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedActionException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateResource struct { +} + +func (*awsAwsjson10_deserializeOpUpdateResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateResource(response, &metadata) + } + output := &UpdateResourceOutput{} + 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_deserializeOpDocumentUpdateResourceOutput(&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_deserializeOpErrorUpdateResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AlreadyExistsException", errorCode): + return awsAwsjson10_deserializeErrorAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ClientTokenConflictException", errorCode): + return awsAwsjson10_deserializeErrorClientTokenConflictException(response, errorBody) + + case strings.EqualFold("ConcurrentOperationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentOperationException(response, errorBody) + + case strings.EqualFold("GeneralServiceException", errorCode): + return awsAwsjson10_deserializeErrorGeneralServiceException(response, errorBody) + + case strings.EqualFold("HandlerFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerFailureException(response, errorBody) + + case strings.EqualFold("HandlerInternalFailureException", errorCode): + return awsAwsjson10_deserializeErrorHandlerInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidCredentialsException", errorCode): + return awsAwsjson10_deserializeErrorInvalidCredentialsException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NetworkFailureException", errorCode): + return awsAwsjson10_deserializeErrorNetworkFailureException(response, errorBody) + + case strings.EqualFold("NotStabilizedException", errorCode): + return awsAwsjson10_deserializeErrorNotStabilizedException(response, errorBody) + + case strings.EqualFold("NotUpdatableException", errorCode): + return awsAwsjson10_deserializeErrorNotUpdatableException(response, errorBody) + + case strings.EqualFold("PrivateTypeException", errorCode): + return awsAwsjson10_deserializeErrorPrivateTypeException(response, errorBody) + + case strings.EqualFold("ResourceConflictException", errorCode): + return awsAwsjson10_deserializeErrorResourceConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceInternalErrorException", errorCode): + return awsAwsjson10_deserializeErrorServiceInternalErrorException(response, errorBody) + + case strings.EqualFold("ServiceLimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceLimitExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TypeNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorTypeNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedActionException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedActionException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson10_deserializeErrorAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AlreadyExistsException{} + err := awsAwsjson10_deserializeDocumentAlreadyExistsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorClientTokenConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ClientTokenConflictException{} + err := awsAwsjson10_deserializeDocumentClientTokenConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConcurrentModificationException{} + err := awsAwsjson10_deserializeDocumentConcurrentModificationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorConcurrentOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConcurrentOperationException{} + err := awsAwsjson10_deserializeDocumentConcurrentOperationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorGeneralServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.GeneralServiceException{} + err := awsAwsjson10_deserializeDocumentGeneralServiceException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorHandlerFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.HandlerFailureException{} + err := awsAwsjson10_deserializeDocumentHandlerFailureException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorHandlerInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.HandlerInternalFailureException{} + err := awsAwsjson10_deserializeDocumentHandlerInternalFailureException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorInvalidCredentialsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidCredentialsException{} + err := awsAwsjson10_deserializeDocumentInvalidCredentialsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidRequestException{} + err := awsAwsjson10_deserializeDocumentInvalidRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorNetworkFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.NetworkFailureException{} + err := awsAwsjson10_deserializeDocumentNetworkFailureException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorNotStabilizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.NotStabilizedException{} + err := awsAwsjson10_deserializeDocumentNotStabilizedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorNotUpdatableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.NotUpdatableException{} + err := awsAwsjson10_deserializeDocumentNotUpdatableException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorPrivateTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.PrivateTypeException{} + err := awsAwsjson10_deserializeDocumentPrivateTypeException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorRequestTokenNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.RequestTokenNotFoundException{} + err := awsAwsjson10_deserializeDocumentRequestTokenNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorResourceConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceConflictException{} + err := awsAwsjson10_deserializeDocumentResourceConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceNotFoundException{} + err := awsAwsjson10_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorServiceInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceInternalErrorException{} + err := awsAwsjson10_deserializeDocumentServiceInternalErrorException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorServiceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceLimitExceededException{} + err := awsAwsjson10_deserializeDocumentServiceLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson10_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorTypeNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.TypeNotFoundException{} + err := awsAwsjson10_deserializeDocumentTypeNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorUnsupportedActionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.UnsupportedActionException{} + err := awsAwsjson10_deserializeDocumentUnsupportedActionException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeDocumentAlreadyExistsException(v **types.AlreadyExistsException, 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.AlreadyExistsException + if *v == nil { + sv = &types.AlreadyExistsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentClientTokenConflictException(v **types.ClientTokenConflictException, 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.ClientTokenConflictException + if *v == nil { + sv = &types.ClientTokenConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, 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.ConcurrentModificationException + if *v == nil { + sv = &types.ConcurrentModificationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentConcurrentOperationException(v **types.ConcurrentOperationException, 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.ConcurrentOperationException + if *v == nil { + sv = &types.ConcurrentOperationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentGeneralServiceException(v **types.GeneralServiceException, 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.GeneralServiceException + if *v == nil { + sv = &types.GeneralServiceException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentHandlerFailureException(v **types.HandlerFailureException, 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.HandlerFailureException + if *v == nil { + sv = &types.HandlerFailureException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentHandlerInternalFailureException(v **types.HandlerInternalFailureException, 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.HandlerInternalFailureException + if *v == nil { + sv = &types.HandlerInternalFailureException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInvalidCredentialsException(v **types.InvalidCredentialsException, 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.InvalidCredentialsException + if *v == nil { + sv = &types.InvalidCredentialsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentNetworkFailureException(v **types.NetworkFailureException, 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.NetworkFailureException + if *v == nil { + sv = &types.NetworkFailureException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentNotStabilizedException(v **types.NotStabilizedException, 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.NotStabilizedException + if *v == nil { + sv = &types.NotStabilizedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentNotUpdatableException(v **types.NotUpdatableException, 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.NotUpdatableException + if *v == nil { + sv = &types.NotUpdatableException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentPrivateTypeException(v **types.PrivateTypeException, 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.PrivateTypeException + if *v == nil { + sv = &types.PrivateTypeException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentProgressEvent(v **types.ProgressEvent, 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.ProgressEvent + if *v == nil { + sv = &types.ProgressEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HandlerErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.HandlerErrorCode(jtv) + } + + case "EventTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EventTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Identifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) + } + sv.Identifier = ptr.String(jtv) + } + + case "Operation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Operation to be of type string, got %T instead", value) + } + sv.Operation = types.Operation(jtv) + } + + case "OperationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationStatus to be of type string, got %T instead", value) + } + sv.OperationStatus = types.OperationStatus(jtv) + } + + case "RequestToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestToken to be of type string, got %T instead", value) + } + sv.RequestToken = ptr.String(jtv) + } + + case "ResourceModel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Properties to be of type string, got %T instead", value) + } + sv.ResourceModel = ptr.String(jtv) + } + + case "RetryAfter": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RetryAfter = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + case "TypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeName to be of type string, got %T instead", value) + } + sv.TypeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRequestTokenNotFoundException(v **types.RequestTokenNotFoundException, 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.RequestTokenNotFoundException + if *v == nil { + sv = &types.RequestTokenNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceConflictException(v **types.ResourceConflictException, 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.ResourceConflictException + if *v == nil { + sv = &types.ResourceConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceDescription(v **types.ResourceDescription, 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.ResourceDescription + if *v == nil { + sv = &types.ResourceDescription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Identifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) + } + sv.Identifier = ptr.String(jtv) + } + + case "Properties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Properties to be of type string, got %T instead", value) + } + sv.Properties = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceDescriptions(v *[]types.ResourceDescription, 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.ResourceDescription + if *v == nil { + cv = []types.ResourceDescription{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceDescription + destAddr := &col + if err := awsAwsjson10_deserializeDocumentResourceDescription(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceRequestStatusSummaries(v *[]types.ProgressEvent, 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.ProgressEvent + if *v == nil { + cv = []types.ProgressEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProgressEvent + destAddr := &col + if err := awsAwsjson10_deserializeDocumentProgressEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentServiceInternalErrorException(v **types.ServiceInternalErrorException, 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.ServiceInternalErrorException + if *v == nil { + sv = &types.ServiceInternalErrorException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentServiceLimitExceededException(v **types.ServiceLimitExceededException, 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.ServiceLimitExceededException + if *v == nil { + sv = &types.ServiceLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentTypeNotFoundException(v **types.TypeNotFoundException, 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.TypeNotFoundException + if *v == nil { + sv = &types.TypeNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentUnsupportedActionException(v **types.UnsupportedActionException, 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.UnsupportedActionException + if *v == nil { + sv = &types.UnsupportedActionException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCancelResourceRequestOutput(v **CancelResourceRequestOutput, 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 *CancelResourceRequestOutput + if *v == nil { + sv = &CancelResourceRequestOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProgressEvent": + if err := awsAwsjson10_deserializeDocumentProgressEvent(&sv.ProgressEvent, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCreateResourceOutput(v **CreateResourceOutput, 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 *CreateResourceOutput + if *v == nil { + sv = &CreateResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProgressEvent": + if err := awsAwsjson10_deserializeDocumentProgressEvent(&sv.ProgressEvent, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDeleteResourceOutput(v **DeleteResourceOutput, 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 *DeleteResourceOutput + if *v == nil { + sv = &DeleteResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProgressEvent": + if err := awsAwsjson10_deserializeDocumentProgressEvent(&sv.ProgressEvent, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetResourceOutput(v **GetResourceOutput, 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 *GetResourceOutput + if *v == nil { + sv = &GetResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceDescription": + if err := awsAwsjson10_deserializeDocumentResourceDescription(&sv.ResourceDescription, value); err != nil { + return err + } + + case "TypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeName to be of type string, got %T instead", value) + } + sv.TypeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetResourceRequestStatusOutput(v **GetResourceRequestStatusOutput, 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 *GetResourceRequestStatusOutput + if *v == nil { + sv = &GetResourceRequestStatusOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProgressEvent": + if err := awsAwsjson10_deserializeDocumentProgressEvent(&sv.ProgressEvent, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListResourceRequestsOutput(v **ListResourceRequestsOutput, 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 *ListResourceRequestsOutput + if *v == nil { + sv = &ListResourceRequestsOutput{} + } 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 "ResourceRequestStatusSummaries": + if err := awsAwsjson10_deserializeDocumentResourceRequestStatusSummaries(&sv.ResourceRequestStatusSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListResourcesOutput(v **ListResourcesOutput, 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 *ListResourcesOutput + if *v == nil { + sv = &ListResourcesOutput{} + } 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 HandlerNextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ResourceDescriptions": + if err := awsAwsjson10_deserializeDocumentResourceDescriptions(&sv.ResourceDescriptions, value); err != nil { + return err + } + + case "TypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeName to be of type string, got %T instead", value) + } + sv.TypeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdateResourceOutput(v **UpdateResourceOutput, 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 *UpdateResourceOutput + if *v == nil { + sv = &UpdateResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProgressEvent": + if err := awsAwsjson10_deserializeDocumentProgressEvent(&sv.ProgressEvent, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/cloudcontrol/doc.go b/service/cloudcontrol/doc.go new file mode 100644 index 00000000000..a2430b3dfd2 --- /dev/null +++ b/service/cloudcontrol/doc.go @@ -0,0 +1,16 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package cloudcontrol provides the API client, operations, and parameter types +// for AWS Cloud Control API. +// +// Use Amazon Web Services Cloud Control API to create, read, update, delete, and +// list (CRUD-L) your cloud resources that belong to a wide range of services--both +// Amazon Web Services and third-party. With the Cloud Control API standardized set +// of application programming interfaces (APIs), you can perform CRUD-L operations +// on any supported resources in your Amazon Web Services account. Using Cloud +// Control API, you won't have to generate code or scripts specific to each +// individual service responsible for those resources. For more information about +// Amazon Web Services Cloud Control API, see the Amazon Web Services Cloud Control +// API User Guide +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/what-is-cloudcontrolapi.html). +package cloudcontrol diff --git a/service/cloudcontrol/endpoints.go b/service/cloudcontrol/endpoints.go new file mode 100644 index 00000000000..7307df7cbf2 --- /dev/null +++ b/service/cloudcontrol/endpoints.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + if err != nil { + 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 = "cloudcontrolapi" + } + 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.EndpointResolver + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint +// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError +// error, the resolver will use the the provided fallbackResolver for resolution. +// awsResolver and fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/cloudcontrol/generated.json b/service/cloudcontrol/generated.json new file mode 100644 index 00000000000..d127ae96faf --- /dev/null +++ b/service/cloudcontrol/generated.json @@ -0,0 +1,33 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/jmespath/go-jmespath": "v0.4.0" + }, + "files": [ + "api_client.go", + "api_op_CancelResourceRequest.go", + "api_op_CreateResource.go", + "api_op_DeleteResource.go", + "api_op_GetResource.go", + "api_op_GetResourceRequestStatus.go", + "api_op_ListResourceRequests.go", + "api_op_ListResources.go", + "api_op_UpdateResource.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/cloudcontrol", + "unstable": false +} diff --git a/service/cloudcontrol/go.mod b/service/cloudcontrol/go.mod new file mode 100644 index 00000000000..a42cac422ff --- /dev/null +++ b/service/cloudcontrol/go.mod @@ -0,0 +1,11 @@ +module github.com/aws/aws-sdk-go-v2/service/cloudcontrol + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.9.1 + github.com/aws/smithy-go v1.8.0 + github.com/jmespath/go-jmespath v0.4.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudcontrol/go.sum b/service/cloudcontrol/go.sum new file mode 100644 index 00000000000..d5bb6d9e2fb --- /dev/null +++ b/service/cloudcontrol/go.sum @@ -0,0 +1,20 @@ +github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/cloudcontrol/go_module_metadata.go b/service/cloudcontrol/go_module_metadata.go new file mode 100644 index 00000000000..62c14a09968 --- /dev/null +++ b/service/cloudcontrol/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package cloudcontrol + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/cloudcontrol/internal/endpoints/endpoints.go b/service/cloudcontrol/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..2824b3c05de --- /dev/null +++ b/service/cloudcontrol/internal/endpoints/endpoints.go @@ -0,0 +1,106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver CloudControl 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + 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 + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "cloudcontrolapi.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "cloudcontrolapi.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "cloudcontrolapi.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "cloudcontrolapi.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "cloudcontrolapi.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/cloudcontrol/internal/endpoints/endpoints_test.go b/service/cloudcontrol/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/cloudcontrol/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/cloudcontrol/protocol_test.go b/service/cloudcontrol/protocol_test.go new file mode 100644 index 00000000000..96f5a532e1b --- /dev/null +++ b/service/cloudcontrol/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol diff --git a/service/cloudcontrol/serializers.go b/service/cloudcontrol/serializers.go new file mode 100644 index 00000000000..91d5399b2a3 --- /dev/null +++ b/service/cloudcontrol/serializers.go @@ -0,0 +1,646 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsAwsjson10_serializeOpCancelResourceRequest struct { +} + +func (*awsAwsjson10_serializeOpCancelResourceRequest) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCancelResourceRequest) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CancelResourceRequestInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.CancelResourceRequest") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCancelResourceRequestInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpCreateResource struct { +} + +func (*awsAwsjson10_serializeOpCreateResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.CreateResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDeleteResource struct { +} + +func (*awsAwsjson10_serializeOpDeleteResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.DeleteResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpGetResource struct { +} + +func (*awsAwsjson10_serializeOpGetResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.GetResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpGetResourceRequestStatus struct { +} + +func (*awsAwsjson10_serializeOpGetResourceRequestStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetResourceRequestStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourceRequestStatusInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.GetResourceRequestStatus") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetResourceRequestStatusInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpListResourceRequests struct { +} + +func (*awsAwsjson10_serializeOpListResourceRequests) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListResourceRequests) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListResourceRequestsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.ListResourceRequests") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListResourceRequestsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpListResources struct { +} + +func (*awsAwsjson10_serializeOpListResources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListResourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.ListResources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListResourcesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpUpdateResource struct { +} + +func (*awsAwsjson10_serializeOpUpdateResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("CloudApiService.UpdateResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsAwsjson10_serializeDocumentOperations(v []types.Operation, 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 awsAwsjson10_serializeDocumentOperationStatuses(v []types.OperationStatus, 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 awsAwsjson10_serializeDocumentResourceRequestStatusFilter(v *types.ResourceRequestStatusFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Operations != nil { + ok := object.Key("Operations") + if err := awsAwsjson10_serializeDocumentOperations(v.Operations, ok); err != nil { + return err + } + } + + if v.OperationStatuses != nil { + ok := object.Key("OperationStatuses") + if err := awsAwsjson10_serializeDocumentOperationStatuses(v.OperationStatuses, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentCancelResourceRequestInput(v *CancelResourceRequestInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RequestToken != nil { + ok := object.Key("RequestToken") + ok.String(*v.RequestToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentCreateResourceInput(v *CreateResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DesiredState != nil { + ok := object.Key("DesiredState") + ok.String(*v.DesiredState) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.TypeName != nil { + ok := object.Key("TypeName") + ok.String(*v.TypeName) + } + + if v.TypeVersionId != nil { + ok := object.Key("TypeVersionId") + ok.String(*v.TypeVersionId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeleteResourceInput(v *DeleteResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.TypeName != nil { + ok := object.Key("TypeName") + ok.String(*v.TypeName) + } + + if v.TypeVersionId != nil { + ok := object.Key("TypeVersionId") + ok.String(*v.TypeVersionId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetResourceInput(v *GetResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.TypeName != nil { + ok := object.Key("TypeName") + ok.String(*v.TypeName) + } + + if v.TypeVersionId != nil { + ok := object.Key("TypeVersionId") + ok.String(*v.TypeVersionId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetResourceRequestStatusInput(v *GetResourceRequestStatusInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RequestToken != nil { + ok := object.Key("RequestToken") + ok.String(*v.RequestToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListResourceRequestsInput(v *ListResourceRequestsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.ResourceRequestStatusFilter != nil { + ok := object.Key("ResourceRequestStatusFilter") + if err := awsAwsjson10_serializeDocumentResourceRequestStatusFilter(v.ResourceRequestStatusFilter, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListResourcesInput(v *ListResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.ResourceModel != nil { + ok := object.Key("ResourceModel") + ok.String(*v.ResourceModel) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.TypeName != nil { + ok := object.Key("TypeName") + ok.String(*v.TypeName) + } + + if v.TypeVersionId != nil { + ok := object.Key("TypeVersionId") + ok.String(*v.TypeVersionId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdateResourceInput(v *UpdateResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + if v.PatchDocument != nil { + ok := object.Key("PatchDocument") + ok.String(*v.PatchDocument) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.TypeName != nil { + ok := object.Key("TypeName") + ok.String(*v.TypeName) + } + + if v.TypeVersionId != nil { + ok := object.Key("TypeVersionId") + ok.String(*v.TypeVersionId) + } + + return nil +} diff --git a/service/cloudcontrol/types/enums.go b/service/cloudcontrol/types/enums.go new file mode 100644 index 00000000000..3f4f3029711 --- /dev/null +++ b/service/cloudcontrol/types/enums.go @@ -0,0 +1,93 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type HandlerErrorCode string + +// Enum values for HandlerErrorCode +const ( + HandlerErrorCodeNotUpdatable HandlerErrorCode = "NotUpdatable" + HandlerErrorCodeInvalidRequest HandlerErrorCode = "InvalidRequest" + HandlerErrorCodeAccessDenied HandlerErrorCode = "AccessDenied" + HandlerErrorCodeInvalidCredentials HandlerErrorCode = "InvalidCredentials" + HandlerErrorCodeAlreadyExists HandlerErrorCode = "AlreadyExists" + HandlerErrorCodeNotFound HandlerErrorCode = "NotFound" + HandlerErrorCodeResourceConflict HandlerErrorCode = "ResourceConflict" + HandlerErrorCodeThrottling HandlerErrorCode = "Throttling" + HandlerErrorCodeServiceLimitExceeded HandlerErrorCode = "ServiceLimitExceeded" + HandlerErrorCodeNotStabilized HandlerErrorCode = "NotStabilized" + HandlerErrorCodeGeneralServiceException HandlerErrorCode = "GeneralServiceException" + HandlerErrorCodeServiceInternalError HandlerErrorCode = "ServiceInternalError" + HandlerErrorCodeServiceTimeout HandlerErrorCode = "ServiceTimeout" + HandlerErrorCodeNetworkFailure HandlerErrorCode = "NetworkFailure" + HandlerErrorCodeInternalFailure HandlerErrorCode = "InternalFailure" +) + +// Values returns all known values for HandlerErrorCode. 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 (HandlerErrorCode) Values() []HandlerErrorCode { + return []HandlerErrorCode{ + "NotUpdatable", + "InvalidRequest", + "AccessDenied", + "InvalidCredentials", + "AlreadyExists", + "NotFound", + "ResourceConflict", + "Throttling", + "ServiceLimitExceeded", + "NotStabilized", + "GeneralServiceException", + "ServiceInternalError", + "ServiceTimeout", + "NetworkFailure", + "InternalFailure", + } +} + +type Operation string + +// Enum values for Operation +const ( + OperationCreate Operation = "CREATE" + OperationDelete Operation = "DELETE" + OperationUpdate Operation = "UPDATE" +) + +// Values returns all known values for Operation. 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 (Operation) Values() []Operation { + return []Operation{ + "CREATE", + "DELETE", + "UPDATE", + } +} + +type OperationStatus string + +// Enum values for OperationStatus +const ( + OperationStatusPending OperationStatus = "PENDING" + OperationStatusInProgress OperationStatus = "IN_PROGRESS" + OperationStatusSuccess OperationStatus = "SUCCESS" + OperationStatusFailed OperationStatus = "FAILED" + OperationStatusCancelInProgress OperationStatus = "CANCEL_IN_PROGRESS" + OperationStatusCancelComplete OperationStatus = "CANCEL_COMPLETE" +) + +// Values returns all known values for OperationStatus. 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 (OperationStatus) Values() []OperationStatus { + return []OperationStatus{ + "PENDING", + "IN_PROGRESS", + "SUCCESS", + "FAILED", + "CANCEL_IN_PROGRESS", + "CANCEL_COMPLETE", + } +} diff --git a/service/cloudcontrol/types/errors.go b/service/cloudcontrol/types/errors.go new file mode 100644 index 00000000000..0f0b0eecbb6 --- /dev/null +++ b/service/cloudcontrol/types/errors.go @@ -0,0 +1,427 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The resource with the name requested already exists. +type AlreadyExistsException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *AlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AlreadyExistsException) ErrorCode() string { return "AlreadyExistsException" } +func (e *AlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified client token has already been used in another resource request. It +// is best practice for client tokens to be unique for each resource operation +// request. However, client token expire after 36 hours. +type ClientTokenConflictException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ClientTokenConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ClientTokenConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ClientTokenConflictException) ErrorCode() string { return "ClientTokenConflictException" } +func (e *ClientTokenConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource is currently being modified by another operation. +type ConcurrentModificationException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConcurrentModificationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConcurrentModificationException) ErrorCode() string { + return "ConcurrentModificationException" +} +func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Another resource operation is currently being performed on this resource. +type ConcurrentOperationException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ConcurrentOperationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConcurrentOperationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConcurrentOperationException) ErrorCode() string { return "ConcurrentOperationException" } +func (e *ConcurrentOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource handler has returned that the downstream service generated an error +// that does not map to any other handler error code. +type GeneralServiceException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *GeneralServiceException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *GeneralServiceException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *GeneralServiceException) ErrorCode() string { return "GeneralServiceException" } +func (e *GeneralServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource handler has failed without a returning a more specific error code. +// This can include timeouts. +type HandlerFailureException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *HandlerFailureException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *HandlerFailureException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *HandlerFailureException) ErrorCode() string { return "HandlerFailureException" } +func (e *HandlerFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The resource handler has returned that an unexpected error occurred within the +// resource handler. +type HandlerInternalFailureException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *HandlerInternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *HandlerInternalFailureException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *HandlerInternalFailureException) ErrorCode() string { + return "HandlerInternalFailureException" +} +func (e *HandlerInternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The resource handler has returned that the credentials provided by the user are +// invalid. +type InvalidCredentialsException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *InvalidCredentialsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidCredentialsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidCredentialsException) ErrorCode() string { return "InvalidCredentialsException" } +func (e *InvalidCredentialsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource handler has returned that invalid input from the user has generated +// a generic exception. +type InvalidRequestException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestException) ErrorCode() string { return "InvalidRequestException" } +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource handler has returned that the request could not be completed due to +// networking issues, such as a failure to receive a response from the server. +type NetworkFailureException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *NetworkFailureException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *NetworkFailureException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *NetworkFailureException) ErrorCode() string { return "NetworkFailureException" } +func (e *NetworkFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The resource handler has returned that the downstream resource failed to +// complete all of its ready-state checks. +type NotStabilizedException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *NotStabilizedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *NotStabilizedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *NotStabilizedException) ErrorCode() string { return "NotStabilizedException" } +func (e *NotStabilizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// One or more properties included in this resource operation are defined as +// create-only, and therefore cannot be updated. +type NotUpdatableException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *NotUpdatableException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *NotUpdatableException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *NotUpdatableException) ErrorCode() string { return "NotUpdatableException" } +func (e *NotUpdatableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Cloud Control API has not received a valid response from the resource handler, +// due to a configuration error. This includes issues such as the resource handler +// returning an invalid response, or timing out. +type PrivateTypeException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *PrivateTypeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PrivateTypeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PrivateTypeException) ErrorCode() string { return "PrivateTypeException" } +func (e *PrivateTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A resource operation with the specified request token cannot be found. +type RequestTokenNotFoundException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *RequestTokenNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RequestTokenNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RequestTokenNotFoundException) ErrorCode() string { return "RequestTokenNotFoundException" } +func (e *RequestTokenNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource is temporarily unavailable to be acted upon. For example, if the +// resource is currently undergoing an operation and cannot be acted upon until +// that operation is finished. +type ResourceConflictException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ResourceConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceConflictException) ErrorCode() string { return "ResourceConflictException" } +func (e *ResourceConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A resource with the specified identifier cannot be found. +type ResourceNotFoundException struct { + Message *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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource handler has returned that the downstream service returned an +// internal error, typically with a 5XX HTTP status code. +type ServiceInternalErrorException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ServiceInternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceInternalErrorException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceInternalErrorException) ErrorCode() string { return "ServiceInternalErrorException" } +func (e *ServiceInternalErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The resource handler has returned that a non-transient resource limit was +// reached on the service side. +type ServiceLimitExceededException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ServiceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceLimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceLimitExceededException) ErrorCode() string { return "ServiceLimitExceededException" } +func (e *ServiceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified extension does not exist in the CloudFormation registry. +type TypeNotFoundException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *TypeNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TypeNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TypeNotFoundException) ErrorCode() string { return "TypeNotFoundException" } +func (e *TypeNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified resource does not support this resource operation. +type UnsupportedActionException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedActionException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedActionException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedActionException) ErrorCode() string { return "UnsupportedActionException" } +func (e *UnsupportedActionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/cloudcontrol/types/types.go b/service/cloudcontrol/types/types.go new file mode 100644 index 00000000000..4015664fac9 --- /dev/null +++ b/service/cloudcontrol/types/types.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Represents the current status of a resource operation request. For more +// information, see Managing resource operation requests +// (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html) +// in the Amazon Web Services Cloud Control API User Guide. +type ProgressEvent struct { + + // For requests with a status of FAILED, the associated error code. For error code + // definitions, see Handler error codes + // (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html) + // in the CloudFormation Command Line Interface User Guide for Extension + // Development. + ErrorCode HandlerErrorCode + + // When the resource operation request was initiated. + EventTime *time.Time + + // The primary identifier for the resource. In some cases, the resource identifier + // may be available before the resource operation has reached a status of SUCCESS. + Identifier *string + + // The resource operation type. + Operation Operation + + // The current status of the resource operation request. + // + // * PENDING: The resource + // operation has not yet started. + // + // * IN_PROGRESS: The resource operation is + // currently in progress. + // + // * SUCCESS: The resource operation has successfully + // completed. + // + // * FAILED: The resource operation has failed. Refer to the error code + // and status message for more information. + // + // * CANCEL_IN_PROGRESS: The resource + // operation is in the process of being canceled. + // + // * CANCEL_COMPLETE: The resource + // operation has been canceled. + OperationStatus OperationStatus + + // The unique token representing this resource operation request. Use the + // RequestToken with GetResourceRequestStatus + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html) + // to return the current status of a resource operation request. + RequestToken *string + + // A JSON string containing the resource model, consisting of each resource + // property and its current value. + ResourceModel *string + + // When to next request the status of this resource operation request. + RetryAfter *time.Time + + // Any message explaining the current status. + StatusMessage *string + + // The name of the resource type used in the operation. + TypeName *string + + noSmithyDocumentSerde +} + +// Represents information about a provisioned resource. +type ResourceDescription struct { + + // The primary identifier for the resource. For more information, see Identifying + // resources + // (https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html) + // in the Amazon Web Services Cloud Control API User Guide. + Identifier *string + + // A list of the resource properties and their current values. + Properties *string + + noSmithyDocumentSerde +} + +// The filter criteria to use in determining the requests returned. +type ResourceRequestStatusFilter struct { + + // The operation statuses to include in the filter. + // + // * PENDING: The operation has + // been requested, but not yet initiated. + // + // * IN_PROGRESS: The operation is + // currently in progress. + // + // * SUCCESS: The operation has successfully completed. + // + // * + // FAILED: The operation has failed. + // + // * CANCEL_IN_PROGRESS: The operation is + // currently in the process of being canceled. + // + // * CANCEL_COMPLETE: The operation + // has been canceled. + OperationStatuses []OperationStatus + + // The operation types to include in the filter. + Operations []Operation + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/cloudcontrol/validators.go b/service/cloudcontrol/validators.go new file mode 100644 index 00000000000..b5351d566a5 --- /dev/null +++ b/service/cloudcontrol/validators.go @@ -0,0 +1,298 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCancelResourceRequest struct { +} + +func (*validateOpCancelResourceRequest) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelResourceRequest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelResourceRequestInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelResourceRequestInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateResource struct { +} + +func (*validateOpCreateResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteResource struct { +} + +func (*validateOpDeleteResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetResource struct { +} + +func (*validateOpGetResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetResourceRequestStatus struct { +} + +func (*validateOpGetResourceRequestStatus) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourceRequestStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourceRequestStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourceRequestStatusInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListResources struct { +} + +func (*validateOpListResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateResource struct { +} + +func (*validateOpUpdateResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCancelResourceRequestValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelResourceRequest{}, middleware.After) +} + +func addOpCreateResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateResource{}, middleware.After) +} + +func addOpDeleteResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResource{}, middleware.After) +} + +func addOpGetResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResource{}, middleware.After) +} + +func addOpGetResourceRequestStatusValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourceRequestStatus{}, middleware.After) +} + +func addOpListResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListResources{}, middleware.After) +} + +func addOpUpdateResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateResource{}, middleware.After) +} + +func validateOpCancelResourceRequestInput(v *CancelResourceRequestInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelResourceRequestInput"} + if v.RequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("RequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateResourceInput(v *CreateResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateResourceInput"} + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if v.DesiredState == nil { + invalidParams.Add(smithy.NewErrParamRequired("DesiredState")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteResourceInput(v *DeleteResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteResourceInput"} + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetResourceInput(v *GetResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourceInput"} + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetResourceRequestStatusInput(v *GetResourceRequestStatusInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourceRequestStatusInput"} + if v.RequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("RequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListResourcesInput(v *ListResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListResourcesInput"} + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateResourceInput(v *UpdateResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateResourceInput"} + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if v.PatchDocument == nil { + invalidParams.Add(smithy.NewErrParamRequired("PatchDocument")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/cloudhsmv2/internal/endpoints/endpoints.go b/service/cloudhsmv2/internal/endpoints/endpoints.go index abc838baf65..9b6bcb20238 100644 --- a/service/cloudhsmv2/internal/endpoints/endpoints.go +++ b/service/cloudhsmv2/internal/endpoints/endpoints.go @@ -70,6 +70,7 @@ var defaultPartitions = endpoints.Partitions{ "ap-east-1": endpoints.Endpoint{}, "ap-northeast-1": endpoints.Endpoint{}, "ap-northeast-2": endpoints.Endpoint{}, + "ap-northeast-3": endpoints.Endpoint{}, "ap-south-1": endpoints.Endpoint{}, "ap-southeast-1": endpoints.Endpoint{}, "ap-southeast-2": endpoints.Endpoint{}, diff --git a/service/connect/api_op_CreateIntegrationAssociation.go b/service/connect/api_op_CreateIntegrationAssociation.go index 8a4bd677e58..61742710c87 100644 --- a/service/connect/api_op_CreateIntegrationAssociation.go +++ b/service/connect/api_op_CreateIntegrationAssociation.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Create an AppIntegration association with an Amazon Connect instance. +// Creates an AWS resource association with an Amazon Connect instance. func (c *Client) CreateIntegrationAssociation(ctx context.Context, params *CreateIntegrationAssociationInput, optFns ...func(*Options)) (*CreateIntegrationAssociationOutput, error) { if params == nil { params = &CreateIntegrationAssociationInput{} @@ -45,19 +45,16 @@ type CreateIntegrationAssociationInput struct { // This member is required. IntegrationType types.IntegrationType - // The name of the external application. - // - // This member is required. + // The name of the external application. This field is only required for the EVENT + // integration type. SourceApplicationName *string - // The URL for the external application. - // - // This member is required. + // The URL for the external application. This field is only required for the EVENT + // integration type. SourceApplicationUrl *string - // The type of the data source. - // - // This member is required. + // The type of the data source. This field is only required for the EVENT + // integration type. SourceType types.SourceType // One or more tags. @@ -71,7 +68,7 @@ type CreateIntegrationAssociationOutput struct { // The Amazon Resource Name (ARN) for the association. IntegrationAssociationArn *string - // The identifier for the association. + // The identifier for the integration association. IntegrationAssociationId *string // Metadata pertaining to the operation's result. diff --git a/service/connect/api_op_CreateUseCase.go b/service/connect/api_op_CreateUseCase.go index 90bb27a449c..cd704049724 100644 --- a/service/connect/api_op_CreateUseCase.go +++ b/service/connect/api_op_CreateUseCase.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a use case for an AppIntegration association. +// Creates a use case for an integration association. func (c *Client) CreateUseCase(ctx context.Context, params *CreateUseCaseInput, optFns ...func(*Options)) (*CreateUseCaseOutput, error) { if params == nil { params = &CreateUseCaseInput{} @@ -35,13 +35,13 @@ type CreateUseCaseInput struct { // This member is required. InstanceId *string - // The identifier for the AppIntegration association. + // The identifier for the integration association. // // This member is required. IntegrationAssociationId *string - // The type of use case to associate to the AppIntegration association. Each - // AppIntegration association can have only one of each use case type. + // The type of use case to associate to the integration association. Each + // integration association can have only one of each use case type. // // This member is required. UseCaseType types.UseCaseType diff --git a/service/connect/api_op_DeleteIntegrationAssociation.go b/service/connect/api_op_DeleteIntegrationAssociation.go index 267c9c906fb..bd1e8d30473 100644 --- a/service/connect/api_op_DeleteIntegrationAssociation.go +++ b/service/connect/api_op_DeleteIntegrationAssociation.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an AppIntegration association from an Amazon Connect instance. The +// Deletes an AWS resource association from an Amazon Connect instance. The // association must not have any use cases associated with it. func (c *Client) DeleteIntegrationAssociation(ctx context.Context, params *DeleteIntegrationAssociationInput, optFns ...func(*Options)) (*DeleteIntegrationAssociationOutput, error) { if params == nil { @@ -35,7 +35,7 @@ type DeleteIntegrationAssociationInput struct { // This member is required. InstanceId *string - // The identifier for the AppIntegration association. + // The identifier for the integration association. // // This member is required. IntegrationAssociationId *string diff --git a/service/connect/api_op_DeleteUseCase.go b/service/connect/api_op_DeleteUseCase.go index b1acc359645..002a9493ba8 100644 --- a/service/connect/api_op_DeleteUseCase.go +++ b/service/connect/api_op_DeleteUseCase.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a use case from an AppIntegration association. +// Deletes a use case from an integration association. func (c *Client) DeleteUseCase(ctx context.Context, params *DeleteUseCaseInput, optFns ...func(*Options)) (*DeleteUseCaseOutput, error) { if params == nil { params = &DeleteUseCaseInput{} @@ -34,7 +34,7 @@ type DeleteUseCaseInput struct { // This member is required. InstanceId *string - // The identifier for the AppIntegration association. + // The identifier for the integration association. // // This member is required. IntegrationAssociationId *string diff --git a/service/connect/api_op_GetCurrentMetricData.go b/service/connect/api_op_GetCurrentMetricData.go index 9defdd0bfb6..51386d7dfa6 100644 --- a/service/connect/api_op_GetCurrentMetricData.go +++ b/service/connect/api_op_GetCurrentMetricData.go @@ -60,11 +60,12 @@ type GetCurrentMetricDataInput struct { // (https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#in-queue-real-time) // CONTACTS_SCHEDULED Unit: COUNT Name in real-time metrics report: Scheduled // (https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#scheduled-real-time) - // OLDEST_CONTACT_AGE Unit: SECONDS When you use groupings, Unit says SECONDS but - // the Value is returned in MILLISECONDS. For example, if you get a response like - // this: { "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": - // 24113.0 } The actual OLDEST_CONTACT_AGE is 24 seconds. Name in real-time metrics - // report: Oldest + // OLDEST_CONTACT_AGE Unit: SECONDS When you use groupings, Unit says SECONDS and + // the Value is returned in SECONDS. When you do not use groupings, Unit says + // SECONDS but the Value is returned in MILLISECONDS. For example, if you get a + // response like this: { "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": + // "SECONDS" }, "Value": 24113.0 } The actual OLDEST_CONTACT_AGE is 24 seconds. + // Name in real-time metrics report: Oldest // (https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#oldest-real-time) // SLOTS_ACTIVE Unit: COUNT Name in real-time metrics report: Active // (https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#active-real-time) diff --git a/service/connect/api_op_ListIntegrationAssociations.go b/service/connect/api_op_ListIntegrationAssociations.go index 4193b33ec39..6357f5e7ce9 100644 --- a/service/connect/api_op_ListIntegrationAssociations.go +++ b/service/connect/api_op_ListIntegrationAssociations.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Provides summary information about the AppIntegration associations for the +// Provides summary information about the AWS resource associations for the // specified Amazon Connect instance. func (c *Client) ListIntegrationAssociations(ctx context.Context, params *ListIntegrationAssociationsInput, optFns ...func(*Options)) (*ListIntegrationAssociationsOutput, error) { if params == nil { @@ -37,6 +37,9 @@ type ListIntegrationAssociationsInput struct { // This member is required. InstanceId *string + // + IntegrationType types.IntegrationType + // The maximum number of results to return per page. MaxResults int32 @@ -49,7 +52,7 @@ type ListIntegrationAssociationsInput struct { type ListIntegrationAssociationsOutput struct { - // The AppIntegration associations. + // The associations. IntegrationAssociationSummaryList []types.IntegrationAssociationSummary // If there are additional results, this is the token for the next set of results. diff --git a/service/connect/api_op_ListUseCases.go b/service/connect/api_op_ListUseCases.go index 7a879b6033d..72456aec95a 100644 --- a/service/connect/api_op_ListUseCases.go +++ b/service/connect/api_op_ListUseCases.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the use cases. +// Lists the use cases for the integration association. func (c *Client) ListUseCases(ctx context.Context, params *ListUseCasesInput, optFns ...func(*Options)) (*ListUseCasesOutput, error) { if params == nil { params = &ListUseCasesInput{} @@ -28,8 +28,8 @@ func (c *Client) ListUseCases(ctx context.Context, params *ListUseCasesInput, op return out, nil } -// Provides summary information about the use cases for the specified Amazon -// Connect AppIntegration association. +// Provides summary information about the use cases for the specified integration +// association. type ListUseCasesInput struct { // The identifier of the Amazon Connect instance. You can find the instanceId in diff --git a/service/connect/api_op_StartOutboundVoiceContact.go b/service/connect/api_op_StartOutboundVoiceContact.go index f909c7a3e65..28fb476f2f3 100644 --- a/service/connect/api_op_StartOutboundVoiceContact.go +++ b/service/connect/api_op_StartOutboundVoiceContact.go @@ -7,6 +7,7 @@ import ( "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -22,6 +23,11 @@ import ( // must submit a service quota increase request. For more information, see Amazon // Connect Service Quotas // (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) +// in the Amazon Connect Administrator Guide. Campaign calls are not allowed by +// default. Before you can make a call with TrafficType = CAMPAIGN, you must submit +// a service quota increase request. For more information, see Amazon Connect +// Service Quotas +// (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) // in the Amazon Connect Administrator Guide. func (c *Client) StartOutboundVoiceContact(ctx context.Context, params *StartOutboundVoiceContactInput, optFns ...func(*Options)) (*StartOutboundVoiceContactOutput, error) { if params == nil { @@ -61,6 +67,9 @@ type StartOutboundVoiceContactInput struct { // This member is required. InstanceId *string + // Configuration of the answering machine detection for this outbound call. + AnswerMachineDetectionConfig *types.AnswerMachineDetectionConfig + // 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. There can be up to 32,768 UTF-8 bytes across all @@ -68,6 +77,9 @@ type StartOutboundVoiceContactInput struct { // and underscore characters. Attributes map[string]string + // The campaign identifier of the outbound communication. + CampaignId *string + // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. The token is valid for 7 days after creation. If a contact is // already started, the contact ID is returned. @@ -83,6 +95,11 @@ type StartOutboundVoiceContactInput struct { // If you do not specify a source phone number, you must specify a queue. SourcePhoneNumber *string + // Denotes the class of traffic. Calls with different traffic types are handled + // differently by Amazon Connect. The default value is GENERAL. Use CAMPAIGN if + // EnableAnswerMachineDetection is set to true. For all other cases, use GENERAL. + TrafficType types.TrafficType + noSmithyDocumentSerde } diff --git a/service/connect/api_op_UpdateInstanceAttribute.go b/service/connect/api_op_UpdateInstanceAttribute.go index 6e83d686278..4e3b2a34eda 100644 --- a/service/connect/api_op_UpdateInstanceAttribute.go +++ b/service/connect/api_op_UpdateInstanceAttribute.go @@ -30,7 +30,9 @@ func (c *Client) UpdateInstanceAttribute(ctx context.Context, params *UpdateInst type UpdateInstanceAttributeInput struct { - // The type of attribute. + // The type of attribute. Only allowlisted customers can consume + // USE_CUSTOM_TTS_VOICES. To access this feature, contact AWS Support for + // allowlisting. // // This member is required. AttributeType types.InstanceAttributeType diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 911b974fccc..0d128317f23 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -4661,6 +4661,10 @@ func awsRestjson1_serializeOpHttpBindingsListIntegrationAssociationsInput(v *Lis } } + if len(v.IntegrationType) > 0 { + encoder.SetQuery("integrationType").String(string(v.IntegrationType)) + } + if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } @@ -6027,6 +6031,13 @@ func awsRestjson1_serializeOpDocumentStartOutboundVoiceContactInput(v *StartOutb 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 { @@ -6034,6 +6045,11 @@ func awsRestjson1_serializeOpDocumentStartOutboundVoiceContactInput(v *StartOutb } } + if v.CampaignId != nil { + ok := object.Key("CampaignId") + ok.String(*v.CampaignId) + } + if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) @@ -6064,6 +6080,11 @@ func awsRestjson1_serializeOpDocumentStartOutboundVoiceContactInput(v *StartOutb ok.String(*v.SourcePhoneNumber) } + if len(v.TrafficType) > 0 { + ok := object.Key("TrafficType") + ok.String(string(v.TrafficType)) + } + return nil } @@ -8860,6 +8881,23 @@ func awsRestjson1_serializeOpDocumentUpdateUserSecurityProfilesInput(v *UpdateUs return nil } +func awsRestjson1_serializeDocumentAnswerMachineDetectionConfig(v *types.AnswerMachineDetectionConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwaitAnswerMachinePrompt { + ok := object.Key("AwaitAnswerMachinePrompt") + ok.Boolean(v.AwaitAnswerMachinePrompt) + } + + if v.EnableAnswerMachineDetection { + 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() diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index b4bdacca9bc..4512854f019 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -372,7 +372,11 @@ type IntegrationType string // Enum values for IntegrationType const ( - IntegrationTypeEvent IntegrationType = "EVENT" + IntegrationTypeEvent IntegrationType = "EVENT" + IntegrationTypeVoiceId IntegrationType = "VOICE_ID" + IntegrationTypePinpointApp IntegrationType = "PINPOINT_APP" + IntegrationTypeWisdomAssistant IntegrationType = "WISDOM_ASSISTANT" + IntegrationTypeWisdomKnowledgeBase IntegrationType = "WISDOM_KNOWLEDGE_BASE" ) // Values returns all known values for IntegrationType. Note that this can be @@ -381,6 +385,10 @@ const ( func (IntegrationType) Values() []IntegrationType { return []IntegrationType{ "EVENT", + "VOICE_ID", + "PINPOINT_APP", + "WISDOM_ASSISTANT", + "WISDOM_KNOWLEDGE_BASE", } } @@ -1086,6 +1094,24 @@ func (StorageType) Values() []StorageType { } } +type TrafficType string + +// Enum values for TrafficType +const ( + TrafficTypeGeneral TrafficType = "GENERAL" + TrafficTypeCampaign TrafficType = "CAMPAIGN" +) + +// Values returns all known values for TrafficType. 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 (TrafficType) Values() []TrafficType { + return []TrafficType{ + "GENERAL", + "CAMPAIGN", + } +} + type Unit string // Enum values for Unit @@ -1110,7 +1136,8 @@ type UseCaseType string // Enum values for UseCaseType const ( - UseCaseTypeRulesEvaluation UseCaseType = "RULES_EVALUATION" + UseCaseTypeRulesEvaluation UseCaseType = "RULES_EVALUATION" + UseCaseTypeConnectCampaigns UseCaseType = "CONNECT_CAMPAIGNS" ) // Values returns all known values for UseCaseType. Note that this can be expanded @@ -1119,6 +1146,7 @@ const ( func (UseCaseType) Values() []UseCaseType { return []UseCaseType{ "RULES_EVALUATION", + "CONNECT_CAMPAIGNS", } } diff --git a/service/connect/types/types.go b/service/connect/types/types.go index 8bc8cbf1d07..279f2837ea1 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -55,6 +55,19 @@ type AgentStatusSummary struct { noSmithyDocumentSerde } +// Configuration of the answering machine detection. +type AnswerMachineDetectionConfig struct { + + // Wait for the answering machine prompt. + AwaitAnswerMachinePrompt bool + + // The flag to indicate if answer machine detection analysis needs to be performed + // for a voice call. If set to true, TrafficType must be set as CAMPAIGN. + EnableAnswerMachineDetection bool + + noSmithyDocumentSerde +} + // A toggle for an individual feature at the instance level. type Attribute struct { @@ -211,7 +224,8 @@ type EncryptionConfig struct { // This member is required. EncryptionType EncryptionType - // The identifier of the encryption key. + // The full ARN of the encryption key. Be sure to provide the full ARN of the + // encryption key, not just the ID. // // This member is required. KeyId *string @@ -1167,8 +1181,8 @@ type UseCase struct { // The identifier for the use case. UseCaseId *string - // The type of use case to associate to the AppIntegration association. Each - // AppIntegration association can have only one of each use case type. + // The type of use case to associate to the integration association. Each + // integration association can have only one of each use case type. UseCaseType UseCaseType noSmithyDocumentSerde diff --git a/service/connect/validators.go b/service/connect/validators.go index 8799dcc6462..5ca4cc38d9b 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -3374,15 +3374,6 @@ func validateOpCreateIntegrationAssociationInput(v *CreateIntegrationAssociation if v.IntegrationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("IntegrationArn")) } - if v.SourceApplicationUrl == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceApplicationUrl")) - } - if v.SourceApplicationName == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceApplicationName")) - } - if len(v.SourceType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("SourceType")) - } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/dataexchange/api_op_CreateEventAction.go b/service/dataexchange/api_op_CreateEventAction.go new file mode 100644 index 00000000000..275650d99bd --- /dev/null +++ b/service/dataexchange/api_op_CreateEventAction.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dataexchange + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// This operation creates an event action. +func (c *Client) CreateEventAction(ctx context.Context, params *CreateEventActionInput, optFns ...func(*Options)) (*CreateEventActionOutput, error) { + if params == nil { + params = &CreateEventActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateEventAction", params, optFns, c.addOperationCreateEventActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateEventActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request body for CreateEventAction. +type CreateEventActionInput struct { + + // What occurs after a certain event. + // + // This member is required. + Action *types.Action + + // What occurs to start an action. + // + // This member is required. + Event *types.Event + + noSmithyDocumentSerde +} + +type CreateEventActionOutput struct { + + // What occurs after a certain event. + Action *types.Action + + // The ARN for the event action. + Arn *string + + // The date and time that the event action was created, in ISO 8601 format. + CreatedAt *time.Time + + // What occurs to start an action. + Event *types.Event + + // The unique identifier for the event action. + Id *string + + // The date and time that the event action was last updated, in ISO 8601 format. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateEventActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEventAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEventAction{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateEventActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEventAction(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateEventAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dataexchange", + OperationName: "CreateEventAction", + } +} diff --git a/service/dataexchange/api_op_DeleteEventAction.go b/service/dataexchange/api_op_DeleteEventAction.go new file mode 100644 index 00000000000..ee1ab9cc616 --- /dev/null +++ b/service/dataexchange/api_op_DeleteEventAction.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dataexchange + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This operation deletes the event action. +func (c *Client) DeleteEventAction(ctx context.Context, params *DeleteEventActionInput, optFns ...func(*Options)) (*DeleteEventActionOutput, error) { + if params == nil { + params = &DeleteEventActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteEventAction", params, optFns, c.addOperationDeleteEventActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteEventActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteEventActionInput struct { + + // The unique identifier for the event action. + // + // This member is required. + EventActionId *string + + noSmithyDocumentSerde +} + +type DeleteEventActionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteEventActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEventAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEventAction{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteEventActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEventAction(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteEventAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dataexchange", + OperationName: "DeleteEventAction", + } +} diff --git a/service/dataexchange/api_op_GetEventAction.go b/service/dataexchange/api_op_GetEventAction.go new file mode 100644 index 00000000000..6c9ee4005a0 --- /dev/null +++ b/service/dataexchange/api_op_GetEventAction.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dataexchange + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// This operation retrieves information about an event action. +func (c *Client) GetEventAction(ctx context.Context, params *GetEventActionInput, optFns ...func(*Options)) (*GetEventActionOutput, error) { + if params == nil { + params = &GetEventActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetEventAction", params, optFns, c.addOperationGetEventActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetEventActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetEventActionInput struct { + + // The unique identifier for the event action. + // + // This member is required. + EventActionId *string + + noSmithyDocumentSerde +} + +type GetEventActionOutput struct { + + // What occurs after a certain event. + Action *types.Action + + // The ARN for the event action. + Arn *string + + // The date and time that the event action was created, in ISO 8601 format. + CreatedAt *time.Time + + // What occurs to start an action. + Event *types.Event + + // The unique identifier for the event action. + Id *string + + // The date and time that the event action was last updated, in ISO 8601 format. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetEventActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEventAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEventAction{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetEventActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEventAction(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetEventAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dataexchange", + OperationName: "GetEventAction", + } +} diff --git a/service/dataexchange/api_op_ListEventActions.go b/service/dataexchange/api_op_ListEventActions.go new file mode 100644 index 00000000000..6a89498d9c2 --- /dev/null +++ b/service/dataexchange/api_op_ListEventActions.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dataexchange + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This operation lists your event actions. +func (c *Client) ListEventActions(ctx context.Context, params *ListEventActionsInput, optFns ...func(*Options)) (*ListEventActionsOutput, error) { + if params == nil { + params = &ListEventActionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEventActions", params, optFns, c.addOperationListEventActionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEventActionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEventActionsInput struct { + + // The unique identifier for the event source. + EventSourceId *string + + // The maximum number of results returned by a single call. + MaxResults int32 + + // The token value retrieved from a previous call to access the next page of + // results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListEventActionsOutput struct { + + // The event action objects listed by the request. + EventActions []types.EventActionEntry + + // The token value retrieved from a previous call to access the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEventActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListEventActions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEventActions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEventActions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListEventActionsAPIClient is a client that implements the ListEventActions +// operation. +type ListEventActionsAPIClient interface { + ListEventActions(context.Context, *ListEventActionsInput, ...func(*Options)) (*ListEventActionsOutput, error) +} + +var _ ListEventActionsAPIClient = (*Client)(nil) + +// ListEventActionsPaginatorOptions is the paginator options for ListEventActions +type ListEventActionsPaginatorOptions struct { + // The maximum number of results returned by a single call. + 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 +} + +// ListEventActionsPaginator is a paginator for ListEventActions +type ListEventActionsPaginator struct { + options ListEventActionsPaginatorOptions + client ListEventActionsAPIClient + params *ListEventActionsInput + nextToken *string + firstPage bool +} + +// NewListEventActionsPaginator returns a new ListEventActionsPaginator +func NewListEventActionsPaginator(client ListEventActionsAPIClient, params *ListEventActionsInput, optFns ...func(*ListEventActionsPaginatorOptions)) *ListEventActionsPaginator { + if params == nil { + params = &ListEventActionsInput{} + } + + options := ListEventActionsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEventActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEventActions page. +func (p *ListEventActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListEventActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListEventActions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dataexchange", + OperationName: "ListEventActions", + } +} diff --git a/service/dataexchange/api_op_UpdateEventAction.go b/service/dataexchange/api_op_UpdateEventAction.go new file mode 100644 index 00000000000..da67d4b2446 --- /dev/null +++ b/service/dataexchange/api_op_UpdateEventAction.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dataexchange + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// This operation updates the event action. +func (c *Client) UpdateEventAction(ctx context.Context, params *UpdateEventActionInput, optFns ...func(*Options)) (*UpdateEventActionOutput, error) { + if params == nil { + params = &UpdateEventActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateEventAction", params, optFns, c.addOperationUpdateEventActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateEventActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// The request body for UpdateEventAction. +type UpdateEventActionInput struct { + + // The unique identifier for the event action. + // + // This member is required. + EventActionId *string + + // What occurs after a certain event. + Action *types.Action + + noSmithyDocumentSerde +} + +type UpdateEventActionOutput struct { + + // What occurs after a certain event. + Action *types.Action + + // The ARN for the event action. + Arn *string + + // The date and time that the event action was created, in ISO 8601 format. + CreatedAt *time.Time + + // What occurs to start an action. + Event *types.Event + + // The unique identifier for the event action. + Id *string + + // The date and time that the event action was last updated, in ISO 8601 format. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateEventActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEventAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEventAction{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateEventActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEventAction(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateEventAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dataexchange", + OperationName: "UpdateEventAction", + } +} diff --git a/service/dataexchange/deserializers.go b/service/dataexchange/deserializers.go index 829aa0ec7a4..40cd0325d53 100644 --- a/service/dataexchange/deserializers.go +++ b/service/dataexchange/deserializers.go @@ -375,6 +375,214 @@ func awsRestjson1_deserializeOpDocumentCreateDataSetOutput(v **CreateDataSetOutp return nil } +type awsRestjson1_deserializeOpCreateEventAction struct { +} + +func (*awsRestjson1_deserializeOpCreateEventAction) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateEventAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateEventAction(response, &metadata) + } + output := &CreateEventActionOutput{} + 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_deserializeOpDocumentCreateEventActionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateEventAction(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ServiceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceLimitExceededException(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_deserializeOpDocumentCreateEventActionOutput(v **CreateEventActionOutput, 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 *CreateEventActionOutput + if *v == nil { + sv = &CreateEventActionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if err := awsRestjson1_deserializeDocumentAction(&sv.Action, value); err != nil { + return err + } + + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreatedAt": + 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.CreatedAt = ptr.Time(t) + } + + case "Event": + if err := awsRestjson1_deserializeDocumentEvent(&sv.Event, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "UpdatedAt": + 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.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateJob struct { } @@ -1048,14 +1256,14 @@ func awsRestjson1_deserializeOpErrorDeleteDataSet(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeleteRevision struct { +type awsRestjson1_deserializeOpDeleteEventAction struct { } -func (*awsRestjson1_deserializeOpDeleteRevision) ID() string { +func (*awsRestjson1_deserializeOpDeleteEventAction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRevision) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteEventAction) 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) @@ -1069,9 +1277,9 @@ func (m *awsRestjson1_deserializeOpDeleteRevision) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRevision(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteEventAction(response, &metadata) } - output := &DeleteRevisionOutput{} + output := &DeleteEventActionOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1083,7 +1291,7 @@ func (m *awsRestjson1_deserializeOpDeleteRevision) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteRevision(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteEventAction(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)} @@ -1124,12 +1332,6 @@ func awsRestjson1_deserializeOpErrorDeleteRevision(response *smithyhttp.Response } 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) @@ -1152,14 +1354,14 @@ func awsRestjson1_deserializeOpErrorDeleteRevision(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpGetAsset struct { +type awsRestjson1_deserializeOpDeleteRevision struct { } -func (*awsRestjson1_deserializeOpGetAsset) ID() string { +func (*awsRestjson1_deserializeOpDeleteRevision) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAsset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRevision) 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) @@ -1173,43 +1375,21 @@ func (m *awsRestjson1_deserializeOpGetAsset) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAsset(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRevision(response, &metadata) } - output := &GetAssetOutput{} + output := &DeleteRevisionOutput{} 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_deserializeOpDocumentGetAssetOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAsset(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRevision(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)} @@ -1250,6 +1430,12 @@ func awsRestjson1_deserializeOpErrorGetAsset(response *smithyhttp.Response, meta } 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) @@ -1272,12 +1458,132 @@ func awsRestjson1_deserializeOpErrorGetAsset(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentGetAssetOutput(v **GetAssetOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil +type awsRestjson1_deserializeOpGetAsset struct { +} + +func (*awsRestjson1_deserializeOpGetAsset) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAsset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetAsset(response, &metadata) + } + output := &GetAssetOutput{} + 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_deserializeOpDocumentGetAssetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetAsset(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentGetAssetOutput(v **GetAssetOutput, 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{}) @@ -1330,13 +1636,253 @@ func awsRestjson1_deserializeOpDocumentGetAssetOutput(v **GetAssetOutput, value sv.CreatedAt = ptr.Time(t) } - case "DataSetId": + case "DataSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.DataSetId = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id 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 AssetName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RevisionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.RevisionId = ptr.String(jtv) + } + + case "SourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.SourceId = ptr.String(jtv) + } + + case "UpdatedAt": + 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.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDataSet struct { +} + +func (*awsRestjson1_deserializeOpGetDataSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetDataSet(response, &metadata) + } + output := &GetDataSetOutput{} + 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_deserializeOpDocumentGetDataSetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetDataSet(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentGetDataSetOutput(v **GetDataSetOutput, 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 *GetDataSetOutput + if *v == nil { + sv = &GetDataSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "AssetType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetType to be of type string, got %T instead", value) + } + sv.AssetType = types.AssetType(jtv) + } + + case "CreatedAt": + 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.CreatedAt = ptr.Time(t) + } + + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.DataSetId = ptr.String(jtv) + sv.Description = ptr.String(jtv) } case "Id": @@ -1352,18 +1898,23 @@ func awsRestjson1_deserializeOpDocumentGetAssetOutput(v **GetAssetOutput, value if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssetName to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } - case "RevisionId": + case "Origin": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected Origin to be of type string, got %T instead", value) } - sv.RevisionId = ptr.String(jtv) + sv.Origin = types.Origin(jtv) + } + + case "OriginDetails": + if err := awsRestjson1_deserializeDocumentOriginDetails(&sv.OriginDetails, value); err != nil { + return err } case "SourceId": @@ -1375,6 +1926,11 @@ func awsRestjson1_deserializeOpDocumentGetAssetOutput(v **GetAssetOutput, value sv.SourceId = ptr.String(jtv) } + case "Tags": + if err := awsRestjson1_deserializeDocumentMapOf__string(&sv.Tags, value); err != nil { + return err + } + case "UpdatedAt": if value != nil { jtv, ok := value.(string) @@ -1397,14 +1953,14 @@ func awsRestjson1_deserializeOpDocumentGetAssetOutput(v **GetAssetOutput, value return nil } -type awsRestjson1_deserializeOpGetDataSet struct { +type awsRestjson1_deserializeOpGetEventAction struct { } -func (*awsRestjson1_deserializeOpGetDataSet) ID() string { +func (*awsRestjson1_deserializeOpGetEventAction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetEventAction) 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) @@ -1418,9 +1974,9 @@ func (m *awsRestjson1_deserializeOpGetDataSet) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDataSet(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetEventAction(response, &metadata) } - output := &GetDataSetOutput{} + output := &GetEventActionOutput{} out.Result = output var buff [1024]byte @@ -1441,7 +1997,7 @@ func (m *awsRestjson1_deserializeOpGetDataSet) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDataSetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetEventActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1454,7 +2010,7 @@ func (m *awsRestjson1_deserializeOpGetDataSet) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDataSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetEventAction(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)} @@ -1517,7 +2073,7 @@ func awsRestjson1_deserializeOpErrorGetDataSet(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetDataSetOutput(v **GetDataSetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetEventActionOutput(v **GetEventActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1530,15 +2086,20 @@ func awsRestjson1_deserializeOpDocumentGetDataSetOutput(v **GetDataSetOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDataSetOutput + var sv *GetEventActionOutput if *v == nil { - sv = &GetDataSetOutput{} + sv = &GetEventActionOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "Action": + if err := awsRestjson1_deserializeDocumentAction(&sv.Action, value); err != nil { + return err + } + case "Arn": if value != nil { jtv, ok := value.(string) @@ -1548,15 +2109,6 @@ func awsRestjson1_deserializeOpDocumentGetDataSetOutput(v **GetDataSetOutput, va sv.Arn = ptr.String(jtv) } - case "AssetType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AssetType to be of type string, got %T instead", value) - } - sv.AssetType = types.AssetType(jtv) - } - case "CreatedAt": if value != nil { jtv, ok := value.(string) @@ -1570,13 +2122,9 @@ func awsRestjson1_deserializeOpDocumentGetDataSetOutput(v **GetDataSetOutput, va sv.CreatedAt = ptr.Time(t) } - case "Description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) + case "Event": + if err := awsRestjson1_deserializeDocumentEvent(&sv.Event, value); err != nil { + return err } case "Id": @@ -1588,43 +2136,6 @@ func awsRestjson1_deserializeOpDocumentGetDataSetOutput(v **GetDataSetOutput, va sv.Id = ptr.String(jtv) } - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Origin": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Origin to be of type string, got %T instead", value) - } - sv.Origin = types.Origin(jtv) - } - - case "OriginDetails": - if err := awsRestjson1_deserializeDocumentOriginDetails(&sv.OriginDetails, value); err != nil { - return err - } - - case "SourceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.SourceId = ptr.String(jtv) - } - - case "Tags": - if err := awsRestjson1_deserializeDocumentMapOf__string(&sv.Tags, value); err != nil { - return err - } - case "UpdatedAt": if value != nil { jtv, ok := value.(string) @@ -2278,7 +2789,172 @@ func (*awsRestjson1_deserializeOpListDataSets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDataSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDataSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListDataSets(response, &metadata) + } + output := &ListDataSetsOutput{} + 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_deserializeOpDocumentListDataSetsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListDataSets(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentListDataSetsOutput(v **ListDataSetsOutput, 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 *ListDataSetsOutput + if *v == nil { + sv = &ListDataSetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataSets": + if err := awsRestjson1_deserializeDocumentListOfDataSetEntry(&sv.DataSets, 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_deserializeOpListEventActions struct { +} + +func (*awsRestjson1_deserializeOpListEventActions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListEventActions) 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) @@ -2292,9 +2968,9 @@ func (m *awsRestjson1_deserializeOpListDataSets) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDataSets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListEventActions(response, &metadata) } - output := &ListDataSetsOutput{} + output := &ListEventActionsOutput{} out.Result = output var buff [1024]byte @@ -2315,7 +2991,7 @@ func (m *awsRestjson1_deserializeOpListDataSets) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDataSetsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListEventActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2328,7 +3004,7 @@ func (m *awsRestjson1_deserializeOpListDataSets) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDataSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListEventActions(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)} @@ -2391,7 +3067,7 @@ func awsRestjson1_deserializeOpErrorListDataSets(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListDataSetsOutput(v **ListDataSetsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListEventActionsOutput(v **ListEventActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2404,17 +3080,17 @@ func awsRestjson1_deserializeOpDocumentListDataSetsOutput(v **ListDataSetsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDataSetsOutput + var sv *ListEventActionsOutput if *v == nil { - sv = &ListDataSetsOutput{} + sv = &ListEventActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DataSets": - if err := awsRestjson1_deserializeDocumentListOfDataSetEntry(&sv.DataSets, value); err != nil { + case "EventActions": + if err := awsRestjson1_deserializeDocumentListOfEventActionEntry(&sv.EventActions, value); err != nil { return err } @@ -3144,50 +3820,301 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, errorCode = restjson.SanitizeErrorCode(code) } - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateAsset struct { +} + +func (*awsRestjson1_deserializeOpUpdateAsset) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAsset(response, &metadata) + } + output := &UpdateAssetOutput{} + 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_deserializeOpDocumentUpdateAssetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAsset(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, 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 *UpdateAssetOutput + if *v == nil { + sv = &UpdateAssetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "AssetDetails": + if err := awsRestjson1_deserializeDocumentAssetDetails(&sv.AssetDetails, value); err != nil { + return err + } + + case "AssetType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetType to be of type string, got %T instead", value) + } + sv.AssetType = types.AssetType(jtv) + } + + case "CreatedAt": + 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.CreatedAt = ptr.Time(t) + } + + case "DataSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.DataSetId = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id 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 AssetName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RevisionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.RevisionId = ptr.String(jtv) + } - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - code, 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 - } + case "SourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.SourceId = ptr.String(jtv) + } - errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - if len(message) != 0 { - errorMessage = message - } + case "UpdatedAt": + 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.UpdatedAt = ptr.Time(t) + } - switch { - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError + default: + _, _ = key, value + } } + *v = sv + return nil } -type awsRestjson1_deserializeOpUpdateAsset struct { +type awsRestjson1_deserializeOpUpdateDataSet struct { } -func (*awsRestjson1_deserializeOpUpdateAsset) ID() string { +func (*awsRestjson1_deserializeOpUpdateDataSet) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateDataSet) 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) @@ -3201,9 +4128,9 @@ func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAsset(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSet(response, &metadata) } - output := &UpdateAssetOutput{} + output := &UpdateDataSetOutput{} out.Result = output var buff [1024]byte @@ -3224,7 +4151,7 @@ func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAssetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3237,7 +4164,7 @@ func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAsset(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateDataSet(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)} @@ -3281,9 +4208,6 @@ func awsRestjson1_deserializeOpErrorUpdateAsset(response *smithyhttp.Response, m 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) @@ -3306,7 +4230,7 @@ func awsRestjson1_deserializeOpErrorUpdateAsset(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3319,9 +4243,9 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAssetOutput + var sv *UpdateDataSetOutput if *v == nil { - sv = &UpdateAssetOutput{} + sv = &UpdateDataSetOutput{} } else { sv = *v } @@ -3337,11 +4261,6 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, sv.Arn = ptr.String(jtv) } - case "AssetDetails": - if err := awsRestjson1_deserializeDocumentAssetDetails(&sv.AssetDetails, value); err != nil { - return err - } - case "AssetType": if value != nil { jtv, ok := value.(string) @@ -3364,13 +4283,13 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, sv.CreatedAt = ptr.Time(t) } - case "DataSetId": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.DataSetId = ptr.String(jtv) + sv.Description = ptr.String(jtv) } case "Id": @@ -3386,18 +4305,23 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssetName to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } - case "RevisionId": + case "Origin": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected Origin to be of type string, got %T instead", value) } - sv.RevisionId = ptr.String(jtv) + sv.Origin = types.Origin(jtv) + } + + case "OriginDetails": + if err := awsRestjson1_deserializeDocumentOriginDetails(&sv.OriginDetails, value); err != nil { + return err } case "SourceId": @@ -3431,14 +4355,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, return nil } -type awsRestjson1_deserializeOpUpdateDataSet struct { +type awsRestjson1_deserializeOpUpdateEventAction struct { } -func (*awsRestjson1_deserializeOpUpdateDataSet) ID() string { +func (*awsRestjson1_deserializeOpUpdateEventAction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDataSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateEventAction) 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) @@ -3452,9 +4376,9 @@ func (m *awsRestjson1_deserializeOpUpdateDataSet) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataSet(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateEventAction(response, &metadata) } - output := &UpdateDataSetOutput{} + output := &UpdateEventActionOutput{} out.Result = output var buff [1024]byte @@ -3475,7 +4399,7 @@ func (m *awsRestjson1_deserializeOpUpdateDataSet) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateEventActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3488,7 +4412,7 @@ func (m *awsRestjson1_deserializeOpUpdateDataSet) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDataSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateEventAction(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)} @@ -3554,7 +4478,7 @@ func awsRestjson1_deserializeOpErrorUpdateDataSet(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateEventActionOutput(v **UpdateEventActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3567,15 +4491,20 @@ func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateDataSetOutput + var sv *UpdateEventActionOutput if *v == nil { - sv = &UpdateDataSetOutput{} + sv = &UpdateEventActionOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "Action": + if err := awsRestjson1_deserializeDocumentAction(&sv.Action, value); err != nil { + return err + } + case "Arn": if value != nil { jtv, ok := value.(string) @@ -3585,15 +4514,6 @@ func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutp sv.Arn = ptr.String(jtv) } - case "AssetType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AssetType to be of type string, got %T instead", value) - } - sv.AssetType = types.AssetType(jtv) - } - case "CreatedAt": if value != nil { jtv, ok := value.(string) @@ -3607,13 +4527,9 @@ func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutp sv.CreatedAt = ptr.Time(t) } - case "Description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) + case "Event": + if err := awsRestjson1_deserializeDocumentEvent(&sv.Event, value); err != nil { + return err } case "Id": @@ -3625,38 +4541,6 @@ func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutp sv.Id = ptr.String(jtv) } - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Origin": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Origin to be of type string, got %T instead", value) - } - sv.Origin = types.Origin(jtv) - } - - case "OriginDetails": - if err := awsRestjson1_deserializeDocumentOriginDetails(&sv.OriginDetails, value); err != nil { - return err - } - - case "SourceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.SourceId = ptr.String(jtv) - } - case "UpdatedAt": if value != nil { jtv, ok := value.(string) @@ -4208,6 +5092,42 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } +func awsRestjson1_deserializeDocumentAction(v **types.Action, 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.Action + if *v == nil { + sv = &types.Action{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExportRevisionToS3": + if err := awsRestjson1_deserializeDocumentAutoExportRevisionToS3RequestDetails(&sv.ExportRevisionToS3, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAssetDestinationEntry(v **types.AssetDestinationEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4387,35 +5307,84 @@ func awsRestjson1_deserializeDocumentAssetEntry(v **types.AssetEntry, value inte sv.Name = ptr.String(jtv) } - case "RevisionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.RevisionId = ptr.String(jtv) - } + case "RevisionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.RevisionId = ptr.String(jtv) + } + + case "SourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.SourceId = ptr.String(jtv) + } + + case "UpdatedAt": + 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.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetSourceEntry(v **types.AssetSourceEntry, 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.AssetSourceEntry + if *v == nil { + sv = &types.AssetSourceEntry{} + } else { + sv = *v + } - case "SourceId": + for key, value := range shape { + switch key { + case "Bucket": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected __string to be of type string, got %T instead", value) } - sv.SourceId = ptr.String(jtv) + sv.Bucket = ptr.String(jtv) } - case "UpdatedAt": + case "Key": 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 + return fmt.Errorf("expected __string to be of type string, got %T instead", value) } - sv.UpdatedAt = ptr.Time(t) + sv.Key = ptr.String(jtv) } default: @@ -4427,7 +5396,7 @@ func awsRestjson1_deserializeDocumentAssetEntry(v **types.AssetEntry, value inte return nil } -func awsRestjson1_deserializeDocumentAssetSourceEntry(v **types.AssetSourceEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentAutoExportRevisionDestinationEntry(v **types.AutoExportRevisionDestinationEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4440,9 +5409,9 @@ func awsRestjson1_deserializeDocumentAssetSourceEntry(v **types.AssetSourceEntry return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetSourceEntry + var sv *types.AutoExportRevisionDestinationEntry if *v == nil { - sv = &types.AssetSourceEntry{} + sv = &types.AutoExportRevisionDestinationEntry{} } else { sv = *v } @@ -4458,13 +5427,54 @@ func awsRestjson1_deserializeDocumentAssetSourceEntry(v **types.AssetSourceEntry sv.Bucket = ptr.String(jtv) } - case "Key": + case "KeyPattern": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } - sv.Key = ptr.String(jtv) + sv.KeyPattern = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutoExportRevisionToS3RequestDetails(v **types.AutoExportRevisionToS3RequestDetails, 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.AutoExportRevisionToS3RequestDetails + if *v == nil { + sv = &types.AutoExportRevisionToS3RequestDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Encryption": + if err := awsRestjson1_deserializeDocumentExportServerSideEncryption(&sv.Encryption, value); err != nil { + return err + } + + case "RevisionDestination": + if err := awsRestjson1_deserializeDocumentAutoExportRevisionDestinationEntry(&sv.RevisionDestination, value); err != nil { + return err } default: @@ -4700,6 +5710,127 @@ func awsRestjson1_deserializeDocumentDetails(v **types.Details, value interface{ return nil } +func awsRestjson1_deserializeDocumentEvent(v **types.Event, 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.Event + if *v == nil { + sv = &types.Event{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RevisionPublished": + if err := awsRestjson1_deserializeDocumentRevisionPublished(&sv.RevisionPublished, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventActionEntry(v **types.EventActionEntry, 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.EventActionEntry + if *v == nil { + sv = &types.EventActionEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if err := awsRestjson1_deserializeDocumentAction(&sv.Action, value); err != nil { + return err + } + + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreatedAt": + 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.CreatedAt = ptr.Time(t) + } + + case "Event": + if err := awsRestjson1_deserializeDocumentEvent(&sv.Event, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "UpdatedAt": + 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.UpdatedAt = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentExportAssetsToS3ResponseDetails(v **types.ExportAssetsToS3ResponseDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5515,6 +6646,40 @@ func awsRestjson1_deserializeDocumentListOfDataSetEntry(v *[]types.DataSetEntry, return nil } +func awsRestjson1_deserializeDocumentListOfEventActionEntry(v *[]types.EventActionEntry, 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.EventActionEntry + if *v == nil { + cv = []types.EventActionEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EventActionEntry + destAddr := &col + if err := awsRestjson1_deserializeDocumentEventActionEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentListOfJobEntry(v *[]types.JobEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6010,6 +7175,46 @@ func awsRestjson1_deserializeDocumentRevisionEntry(v **types.RevisionEntry, valu return nil } +func awsRestjson1_deserializeDocumentRevisionPublished(v **types.RevisionPublished, 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.RevisionPublished + if *v == nil { + sv = &types.RevisionPublished{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.DataSetId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentS3SnapshotAsset(v **types.S3SnapshotAsset, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6220,6 +7425,15 @@ func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationExc for key, value := range shape { switch key { + case "ExceptionCause": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionCause to be of type string, got %T instead", value) + } + sv.ExceptionCause = types.ExceptionCause(jtv) + } + case "Message": if value != nil { jtv, ok := value.(string) diff --git a/service/dataexchange/generated.json b/service/dataexchange/generated.json index edb8d0e25ba..573c9d6c8bd 100644 --- a/service/dataexchange/generated.json +++ b/service/dataexchange/generated.json @@ -7,17 +7,21 @@ "api_client.go", "api_op_CancelJob.go", "api_op_CreateDataSet.go", + "api_op_CreateEventAction.go", "api_op_CreateJob.go", "api_op_CreateRevision.go", "api_op_DeleteAsset.go", "api_op_DeleteDataSet.go", + "api_op_DeleteEventAction.go", "api_op_DeleteRevision.go", "api_op_GetAsset.go", "api_op_GetDataSet.go", + "api_op_GetEventAction.go", "api_op_GetJob.go", "api_op_GetRevision.go", "api_op_ListDataSetRevisions.go", "api_op_ListDataSets.go", + "api_op_ListEventActions.go", "api_op_ListJobs.go", "api_op_ListRevisionAssets.go", "api_op_ListTagsForResource.go", @@ -26,6 +30,7 @@ "api_op_UntagResource.go", "api_op_UpdateAsset.go", "api_op_UpdateDataSet.go", + "api_op_UpdateEventAction.go", "api_op_UpdateRevision.go", "deserializers.go", "doc.go", diff --git a/service/dataexchange/serializers.go b/service/dataexchange/serializers.go index 76702809d4e..d7cf03dcc77 100644 --- a/service/dataexchange/serializers.go +++ b/service/dataexchange/serializers.go @@ -157,6 +157,83 @@ func awsRestjson1_serializeOpDocumentCreateDataSetInput(v *CreateDataSetInput, v return nil } +type awsRestjson1_serializeOpCreateEventAction struct { +} + +func (*awsRestjson1_serializeOpCreateEventAction) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateEventAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateEventActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/event-actions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateEventActionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateEventActionInput(v *CreateEventActionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateEventActionInput(v *CreateEventActionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + if err := awsRestjson1_serializeDocumentAction(v.Action, ok); err != nil { + return err + } + } + + if v.Event != nil { + ok := object.Key("Event") + if err := awsRestjson1_serializeDocumentEvent(v.Event, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateJob struct { } @@ -454,6 +531,64 @@ func awsRestjson1_serializeOpHttpBindingsDeleteDataSetInput(v *DeleteDataSetInpu return nil } +type awsRestjson1_serializeOpDeleteEventAction struct { +} + +func (*awsRestjson1_serializeOpDeleteEventAction) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteEventAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteEventActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/event-actions/{EventActionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteEventActionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteEventActionInput(v *DeleteEventActionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.EventActionId == nil || len(*v.EventActionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member EventActionId must not be empty")} + } + if v.EventActionId != nil { + if err := encoder.SetURI("EventActionId").String(*v.EventActionId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteRevision struct { } @@ -655,6 +790,64 @@ func awsRestjson1_serializeOpHttpBindingsGetDataSetInput(v *GetDataSetInput, enc return nil } +type awsRestjson1_serializeOpGetEventAction struct { +} + +func (*awsRestjson1_serializeOpGetEventAction) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEventAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetEventActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/event-actions/{EventActionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetEventActionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetEventActionInput(v *GetEventActionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.EventActionId == nil || len(*v.EventActionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member EventActionId must not be empty")} + } + if v.EventActionId != nil { + if err := encoder.SetURI("EventActionId").String(*v.EventActionId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetJob struct { } @@ -907,6 +1100,67 @@ func awsRestjson1_serializeOpHttpBindingsListDataSetsInput(v *ListDataSetsInput, return nil } +type awsRestjson1_serializeOpListEventActions struct { +} + +func (*awsRestjson1_serializeOpListEventActions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListEventActions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEventActionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/event-actions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListEventActionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListEventActionsInput(v *ListEventActionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.EventSourceId != nil { + encoder.SetQuery("eventSourceId").String(*v.EventSourceId) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListJobs struct { } @@ -1495,6 +1749,89 @@ func awsRestjson1_serializeOpDocumentUpdateDataSetInput(v *UpdateDataSetInput, v return nil } +type awsRestjson1_serializeOpUpdateEventAction struct { +} + +func (*awsRestjson1_serializeOpUpdateEventAction) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateEventAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateEventActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/event-actions/{EventActionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateEventActionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateEventActionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateEventActionInput(v *UpdateEventActionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.EventActionId == nil || len(*v.EventActionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member EventActionId must not be empty")} + } + if v.EventActionId != nil { + if err := encoder.SetURI("EventActionId").String(*v.EventActionId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateEventActionInput(v *UpdateEventActionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + if err := awsRestjson1_serializeDocumentAction(v.Action, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateRevision struct { } @@ -1590,6 +1927,20 @@ func awsRestjson1_serializeOpDocumentUpdateRevisionInput(v *UpdateRevisionInput, return nil } +func awsRestjson1_serializeDocumentAction(v *types.Action, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExportRevisionToS3 != nil { + ok := object.Key("ExportRevisionToS3") + if err := awsRestjson1_serializeDocumentAutoExportRevisionToS3RequestDetails(v.ExportRevisionToS3, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentAssetDestinationEntry(v *types.AssetDestinationEntry, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1629,6 +1980,58 @@ func awsRestjson1_serializeDocumentAssetSourceEntry(v *types.AssetSourceEntry, v return nil } +func awsRestjson1_serializeDocumentAutoExportRevisionDestinationEntry(v *types.AutoExportRevisionDestinationEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Bucket != nil { + ok := object.Key("Bucket") + ok.String(*v.Bucket) + } + + if v.KeyPattern != nil { + ok := object.Key("KeyPattern") + ok.String(*v.KeyPattern) + } + + return nil +} + +func awsRestjson1_serializeDocumentAutoExportRevisionToS3RequestDetails(v *types.AutoExportRevisionToS3RequestDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Encryption != nil { + ok := object.Key("Encryption") + if err := awsRestjson1_serializeDocumentExportServerSideEncryption(v.Encryption, ok); err != nil { + return err + } + } + + if v.RevisionDestination != nil { + ok := object.Key("RevisionDestination") + if err := awsRestjson1_serializeDocumentAutoExportRevisionDestinationEntry(v.RevisionDestination, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEvent(v *types.Event, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RevisionPublished != nil { + ok := object.Key("RevisionPublished") + if err := awsRestjson1_serializeDocumentRevisionPublished(v.RevisionPublished, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentExportAssetsToS3RequestDetails(v *types.ExportAssetsToS3RequestDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1889,3 +2292,15 @@ func awsRestjson1_serializeDocumentRevisionDestinationEntry(v *types.RevisionDes return nil } + +func awsRestjson1_serializeDocumentRevisionPublished(v *types.RevisionPublished, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataSetId != nil { + ok := object.Key("DataSetId") + ok.String(*v.DataSetId) + } + + return nil +} diff --git a/service/dataexchange/types/enums.go b/service/dataexchange/types/enums.go index a0a02681bd8..cd6dd6d62d7 100644 --- a/service/dataexchange/types/enums.go +++ b/service/dataexchange/types/enums.go @@ -46,6 +46,24 @@ func (Code) Values() []Code { } } +type ExceptionCause string + +// Enum values for ExceptionCause +const ( + ExceptionCauseInsufficientS3BucketPolicy ExceptionCause = "InsufficientS3BucketPolicy" + ExceptionCauseS3AccessDenied ExceptionCause = "S3AccessDenied" +) + +// Values returns all known values for ExceptionCause. 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 (ExceptionCause) Values() []ExceptionCause { + return []ExceptionCause{ + "InsufficientS3BucketPolicy", + "S3AccessDenied", + } +} + type JobErrorLimitName string // Enum values for JobErrorLimitName @@ -70,6 +88,7 @@ type JobErrorResourceTypes string const ( JobErrorResourceTypesRevision JobErrorResourceTypes = "REVISION" JobErrorResourceTypesAsset JobErrorResourceTypes = "ASSET" + JobErrorResourceTypesDataSet JobErrorResourceTypes = "DATA_SET" ) // Values returns all known values for JobErrorResourceTypes. Note that this can be @@ -79,6 +98,7 @@ func (JobErrorResourceTypes) Values() []JobErrorResourceTypes { return []JobErrorResourceTypes{ "REVISION", "ASSET", + "DATA_SET", } } @@ -98,6 +118,9 @@ const ( LimitNameConcurrentInProgressJobsToImportAssetsFromASignedUrl LimitName = "Concurrent in progress jobs to import assets from a signed URL" LimitNameConcurrentInProgressJobsToExportAssetsToAmazonS3 LimitName = "Concurrent in progress jobs to export assets to Amazon S3" LimitNameConcurrentInProgressJobsToExportAssetsToASignedUrl LimitName = "Concurrent in progress jobs to export assets to a signed URL" + LimitNameConcurrentInProgressJobsToExportRevisionsToAmazonS3 LimitName = "Concurrent in progress jobs to export revisions to Amazon S3" + LimitNameEventActionsPerAccount LimitName = "Event actions per account" + LimitNameAutoExportEventActionsPerDataSet LimitName = "Auto export event actions per data set" ) // Values returns all known values for LimitName. Note that this can be expanded in @@ -117,6 +140,9 @@ func (LimitName) Values() []LimitName { "Concurrent in progress jobs to import assets from a signed URL", "Concurrent in progress jobs to export assets to Amazon S3", "Concurrent in progress jobs to export assets to a signed URL", + "Concurrent in progress jobs to export revisions to Amazon S3", + "Event actions per account", + "Auto export event actions per data set", } } @@ -142,10 +168,11 @@ type ResourceType string // Enum values for ResourceType const ( - ResourceTypeDataSet ResourceType = "DATA_SET" - ResourceTypeRevision ResourceType = "REVISION" - ResourceTypeAsset ResourceType = "ASSET" - ResourceTypeJob ResourceType = "JOB" + ResourceTypeDataSet ResourceType = "DATA_SET" + ResourceTypeRevision ResourceType = "REVISION" + ResourceTypeAsset ResourceType = "ASSET" + ResourceTypeJob ResourceType = "JOB" + ResourceTypeEventAction ResourceType = "EVENT_ACTION" ) // Values returns all known values for ResourceType. Note that this can be expanded @@ -157,6 +184,7 @@ func (ResourceType) Values() []ResourceType { "REVISION", "ASSET", "JOB", + "EVENT_ACTION", } } diff --git a/service/dataexchange/types/errors.go b/service/dataexchange/types/errors.go index 0855effa607..4baea69936d 100644 --- a/service/dataexchange/types/errors.go +++ b/service/dataexchange/types/errors.go @@ -135,6 +135,8 @@ func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.Fau type ValidationException struct { Message *string + ExceptionCause ExceptionCause + noSmithyDocumentSerde } diff --git a/service/dataexchange/types/types.go b/service/dataexchange/types/types.go index 45c2f88fcf3..e8a83360ad4 100644 --- a/service/dataexchange/types/types.go +++ b/service/dataexchange/types/types.go @@ -7,6 +7,14 @@ import ( "time" ) +type Action struct { + + // Details of the operation to be performed by the job. + ExportRevisionToS3 *AutoExportRevisionToS3RequestDetails + + noSmithyDocumentSerde +} + // The destination for the asset. type AssetDestinationEntry struct { @@ -112,6 +120,41 @@ type AssetSourceEntry struct { noSmithyDocumentSerde } +// A revision destination is the Amazon S3 bucket folder destination to where the +// export will be sent. +type AutoExportRevisionDestinationEntry struct { + + // The S3 bucket that is the destination for the event action. + // + // This member is required. + Bucket *string + + // A string representing the pattern for generated names of the individual assets + // in the revision. For more information about key patterns, see Key patterns when + // exporting revisions + // (https://docs.aws.amazon.com/data-exchange/latest/userguide/jobs.html#revision-export-keypatterns). + KeyPattern *string + + noSmithyDocumentSerde +} + +// Details of the operation to be performed by the job. +type AutoExportRevisionToS3RequestDetails struct { + + // A revision destination is the Amazon S3 bucket folder destination to where the + // export will be sent. + // + // This member is required. + RevisionDestination *AutoExportRevisionDestinationEntry + + // Encryption configuration of the export job. Includes the encryption type in + // addition to the AWS KMS key. The KMS key is only necessary if you chose the KMS + // encryption. type. + Encryption *ExportServerSideEncryption + + noSmithyDocumentSerde +} + // A data set is an AWS resource with one or more revisions. type DataSetEntry struct { @@ -178,6 +221,49 @@ type Details struct { noSmithyDocumentSerde } +type Event struct { + RevisionPublished *RevisionPublished + + noSmithyDocumentSerde +} + +// An event action is an object that defines the relationship between a specific +// event and an automated action that will be taken on behalf of the customer. +type EventActionEntry struct { + + // What occurs after a certain event. + // + // This member is required. + Action *Action + + // The ARN for the event action. + // + // This member is required. + Arn *string + + // The date and time that the event action was created, in ISO 8601 format. + // + // This member is required. + CreatedAt *time.Time + + // What occurs to start an action. + // + // This member is required. + Event *Event + + // The unique identifier for the event action. + // + // This member is required. + Id *string + + // The date and time that the event action was last updated, in ISO 8601 format. + // + // This member is required. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + // Details of the operation to be performed by the job. type ExportAssetsToS3RequestDetails struct { @@ -312,9 +398,9 @@ type ExportRevisionsToS3ResponseDetails struct { noSmithyDocumentSerde } -// Encryption configuration of the export job. Includes the encryption type as well -// as the AWS KMS key. The KMS key is only necessary if you chose the KMS -// encryption type. +// Encryption configuration of the export job. Includes the encryption type in +// addition to the AWS KMS key. The KMS key is only necessary if you chose the KMS +// encryption. type. type ExportServerSideEncryption struct { // The type of server side encryption used for encrypting the objects in Amazon S3. @@ -322,8 +408,8 @@ type ExportServerSideEncryption struct { // This member is required. Type ServerSideEncryptionTypes - // The Amazon Resource Name (ARN) of the the AWS KMS key you want to use to encrypt - // the Amazon S3 objects. This parameter is required if you choose aws:kms as an + // The Amazon Resource Name (ARN) of the AWS KMS key you want to use to encrypt the + // Amazon S3 objects. This parameter is required if you choose aws:kms as an // encryption type. KmsKeyArn *string @@ -642,6 +728,16 @@ type RevisionEntry struct { noSmithyDocumentSerde } +type RevisionPublished struct { + + // A unique identifier. + // + // This member is required. + DataSetId *string + + noSmithyDocumentSerde +} + // The S3 object that is the asset. type S3SnapshotAsset struct { diff --git a/service/dataexchange/validators.go b/service/dataexchange/validators.go index aa363a18f51..a45b3d032b0 100644 --- a/service/dataexchange/validators.go +++ b/service/dataexchange/validators.go @@ -50,6 +50,26 @@ func (m *validateOpCreateDataSet) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpCreateEventAction struct { +} + +func (*validateOpCreateEventAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateEventAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateEventActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateEventActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateJob struct { } @@ -130,6 +150,26 @@ func (m *validateOpDeleteDataSet) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteEventAction struct { +} + +func (*validateOpDeleteEventAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteEventAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteEventActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteEventActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteRevision struct { } @@ -190,6 +230,26 @@ func (m *validateOpGetDataSet) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpGetEventAction struct { +} + +func (*validateOpGetEventAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetEventAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetEventActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetEventActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetJob struct { } @@ -390,6 +450,26 @@ func (m *validateOpUpdateDataSet) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateEventAction struct { +} + +func (*validateOpUpdateEventAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateEventAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateEventActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateEventActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateRevision struct { } @@ -418,6 +498,10 @@ func addOpCreateDataSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataSet{}, middleware.After) } +func addOpCreateEventActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateEventAction{}, middleware.After) +} + func addOpCreateJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateJob{}, middleware.After) } @@ -434,6 +518,10 @@ func addOpDeleteDataSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataSet{}, middleware.After) } +func addOpDeleteEventActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteEventAction{}, middleware.After) +} + func addOpDeleteRevisionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRevision{}, middleware.After) } @@ -446,6 +534,10 @@ func addOpGetDataSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataSet{}, middleware.After) } +func addOpGetEventActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetEventAction{}, middleware.After) +} + func addOpGetJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetJob{}, middleware.After) } @@ -486,10 +578,31 @@ func addOpUpdateDataSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDataSet{}, middleware.After) } +func addOpUpdateEventActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateEventAction{}, middleware.After) +} + func addOpUpdateRevisionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRevision{}, middleware.After) } +func validateAction(v *types.Action) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Action"} + if v.ExportRevisionToS3 != nil { + if err := validateAutoExportRevisionToS3RequestDetails(v.ExportRevisionToS3); err != nil { + invalidParams.AddNested("ExportRevisionToS3", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAssetDestinationEntry(v *types.AssetDestinationEntry) error { if v == nil { return nil @@ -526,6 +639,62 @@ func validateAssetSourceEntry(v *types.AssetSourceEntry) error { } } +func validateAutoExportRevisionDestinationEntry(v *types.AutoExportRevisionDestinationEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AutoExportRevisionDestinationEntry"} + if v.Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAutoExportRevisionToS3RequestDetails(v *types.AutoExportRevisionToS3RequestDetails) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AutoExportRevisionToS3RequestDetails"} + if v.Encryption != nil { + if err := validateExportServerSideEncryption(v.Encryption); err != nil { + invalidParams.AddNested("Encryption", err.(smithy.InvalidParamsError)) + } + } + if v.RevisionDestination == nil { + invalidParams.Add(smithy.NewErrParamRequired("RevisionDestination")) + } else if v.RevisionDestination != nil { + if err := validateAutoExportRevisionDestinationEntry(v.RevisionDestination); err != nil { + invalidParams.AddNested("RevisionDestination", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEvent(v *types.Event) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Event"} + if v.RevisionPublished != nil { + if err := validateRevisionPublished(v.RevisionPublished); err != nil { + invalidParams.AddNested("RevisionPublished", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateExportAssetsToS3RequestDetails(v *types.ExportAssetsToS3RequestDetails) error { if v == nil { return nil @@ -774,6 +943,21 @@ func validateRevisionDestinationEntry(v *types.RevisionDestinationEntry) error { } } +func validateRevisionPublished(v *types.RevisionPublished) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RevisionPublished"} + if v.DataSetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataSetId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCancelJobInput(v *CancelJobInput) error { if v == nil { return nil @@ -810,6 +994,32 @@ func validateOpCreateDataSetInput(v *CreateDataSetInput) error { } } +func validateOpCreateEventActionInput(v *CreateEventActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateEventActionInput"} + if v.Action == nil { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } else if v.Action != nil { + if err := validateAction(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if v.Event == nil { + invalidParams.Add(smithy.NewErrParamRequired("Event")) + } else if v.Event != nil { + if err := validateEvent(v.Event); err != nil { + invalidParams.AddNested("Event", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateJobInput(v *CreateJobInput) error { if v == nil { return nil @@ -883,6 +1093,21 @@ func validateOpDeleteDataSetInput(v *DeleteDataSetInput) error { } } +func validateOpDeleteEventActionInput(v *DeleteEventActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteEventActionInput"} + if v.EventActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventActionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteRevisionInput(v *DeleteRevisionInput) error { if v == nil { return nil @@ -937,6 +1162,21 @@ func validateOpGetDataSetInput(v *GetDataSetInput) error { } } +func validateOpGetEventActionInput(v *GetEventActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetEventActionInput"} + if v.EventActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventActionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetJobInput(v *GetJobInput) error { if v == nil { return nil @@ -1108,6 +1348,26 @@ func validateOpUpdateDataSetInput(v *UpdateDataSetInput) error { } } +func validateOpUpdateEventActionInput(v *UpdateEventActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateEventActionInput"} + if v.Action != nil { + if err := validateAction(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if v.EventActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventActionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateRevisionInput(v *UpdateRevisionInput) error { if v == nil { return nil diff --git a/service/elasticloadbalancingv2/api_op_CreateTargetGroup.go b/service/elasticloadbalancingv2/api_op_CreateTargetGroup.go index 01c37232ab1..083c0b5f976 100644 --- a/service/elasticloadbalancingv2/api_op_CreateTargetGroup.go +++ b/service/elasticloadbalancingv2/api_op_CreateTargetGroup.go @@ -55,7 +55,7 @@ type CreateTargetGroupInput struct { // Indicates whether health checks are enabled. If the target type is lambda, // health checks are disabled by default but can be enabled. If the target type is - // instance or ip, health checks are always enabled and cannot be disabled. + // instance, ip, or alb, health checks are always enabled and cannot be disabled. HealthCheckEnabled *bool // The approximate amount of time, in seconds, between health checks of an @@ -139,6 +139,9 @@ type CreateTargetGroupInput struct { // // * // lambda - Register a single Lambda function as a target. + // + // * alb - Register a + // single Application Load Balancer as a target. TargetType types.TargetTypeEnum // The number of consecutive health check failures required before considering a diff --git a/service/elasticloadbalancingv2/deserializers.go b/service/elasticloadbalancingv2/deserializers.go index 4906069dbfe..c51718e241a 100644 --- a/service/elasticloadbalancingv2/deserializers.go +++ b/service/elasticloadbalancingv2/deserializers.go @@ -234,9 +234,15 @@ func awsAwsquery_deserializeOpErrorAddTags(response *smithyhttp.Response, metada case strings.EqualFold("DuplicateTagKeys", errorCode): return awsAwsquery_deserializeErrorDuplicateTagKeysException(response, errorBody) + case strings.EqualFold("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + case strings.EqualFold("LoadBalancerNotFound", errorCode): return awsAwsquery_deserializeErrorLoadBalancerNotFoundException(response, errorBody) + case strings.EqualFold("RuleNotFound", errorCode): + return awsAwsquery_deserializeErrorRuleNotFoundException(response, errorBody) + case strings.EqualFold("TargetGroupNotFound", errorCode): return awsAwsquery_deserializeErrorTargetGroupNotFoundException(response, errorBody) @@ -921,6 +927,9 @@ func awsAwsquery_deserializeOpErrorDeleteListener(response *smithyhttp.Response, case strings.EqualFold("ListenerNotFound", errorCode): return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + case strings.EqualFold("ResourceInUse", errorCode): + return awsAwsquery_deserializeErrorResourceInUseException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, diff --git a/service/elasticloadbalancingv2/types/enums.go b/service/elasticloadbalancingv2/types/enums.go index c842fcc67ba..9169ce741c4 100644 --- a/service/elasticloadbalancingv2/types/enums.go +++ b/service/elasticloadbalancingv2/types/enums.go @@ -263,6 +263,7 @@ const ( TargetTypeEnumInstance TargetTypeEnum = "instance" TargetTypeEnumIp TargetTypeEnum = "ip" TargetTypeEnumLambda TargetTypeEnum = "lambda" + TargetTypeEnumAlb TargetTypeEnum = "alb" ) // Values returns all known values for TargetTypeEnum. Note that this can be @@ -273,5 +274,6 @@ func (TargetTypeEnum) Values() []TargetTypeEnum { "instance", "ip", "lambda", + "alb", } } diff --git a/service/elasticloadbalancingv2/types/types.go b/service/elasticloadbalancingv2/types/types.go index 595f1874f2e..b7069712c83 100644 --- a/service/elasticloadbalancingv2/types/types.go +++ b/service/elasticloadbalancingv2/types/types.go @@ -895,7 +895,8 @@ type TargetDescription struct { // The ID of the target. If the target type of the target group is instance, // specify an instance ID. If the target type is ip, specify an IP address. If the - // target type is lambda, specify the ARN of the Lambda function. + // target type is lambda, specify the ARN of the Lambda function. If the target + // type is alb, specify the ARN of the Application Load Balancer target. // // This member is required. Id *string @@ -903,18 +904,20 @@ type TargetDescription struct { // An Availability Zone or all. This determines whether the target receives traffic // from the load balancer nodes in the specified Availability Zone or from all // enabled Availability Zones for the load balancer. This parameter is not - // supported if the target type of the target group is instance. If the target type - // is ip and the IP address is in a subnet of the VPC for the target group, the - // Availability Zone is automatically detected and this parameter is optional. If - // the IP address is outside the VPC, this parameter is required. With an - // Application Load Balancer, if the target type is ip and the IP address is + // supported if the target type of the target group is instance or alb. If the + // target type is ip and the IP address is in a subnet of the VPC for the target + // group, the Availability Zone is automatically detected and this parameter is + // optional. If the IP address is outside the VPC, this parameter is required. With + // an Application Load Balancer, if the target type is ip and the IP address is // outside the VPC for the target group, the only supported value is all. If the // target type is lambda, this parameter is optional and the only supported value // is all. AvailabilityZone *string // The port on which the target is listening. If the target group protocol is - // GENEVE, the supported port is 6081. Not used if the target is a Lambda function. + // GENEVE, the supported port is 6081. If the target type is alb, the targeted + // Application Load Balancer must have at least one listener whose port matches the + // target group port. Not used if the target is a Lambda function. Port *int32 noSmithyDocumentSerde @@ -975,8 +978,9 @@ type TargetGroup struct { // The type of target that you must specify when registering targets with this // target group. The possible values are instance (register targets by instance - // ID), ip (register targets by IP address), or lambda (register a single Lambda - // function as a target). + // ID), ip (register targets by IP address), lambda (register a single Lambda + // function as a target), or alb (register a single Application Load Balancer as a + // target). TargetType TargetTypeEnum // The number of consecutive health check failures required before considering the diff --git a/service/imagebuilder/api_op_CreateComponent.go b/service/imagebuilder/api_op_CreateComponent.go index 2211e2d7e1f..7b3a5c0c57b 100644 --- a/service/imagebuilder/api_op_CreateComponent.go +++ b/service/imagebuilder/api_op_CreateComponent.go @@ -75,8 +75,8 @@ type CreateComponentInput struct { KmsKeyId *string // The operating system (OS) version supported by the component. If the OS - // information is available, a prefix match is performed against the parent image - // OS version during image recipe creation. + // information is available, a prefix match is performed against the base image OS + // version during image recipe creation. SupportedOsVersions []string // The tags of the component. diff --git a/service/imagebuilder/api_op_CreateContainerRecipe.go b/service/imagebuilder/api_op_CreateContainerRecipe.go index 9bcc011bd1c..537b9628cfc 100644 --- a/service/imagebuilder/api_op_CreateContainerRecipe.go +++ b/service/imagebuilder/api_op_CreateContainerRecipe.go @@ -51,7 +51,7 @@ type CreateContainerRecipeInput struct { // This member is required. Name *string - // The source image for the container recipe. + // The base image for the container recipe. // // This member is required. ParentImage *string @@ -84,7 +84,7 @@ type CreateContainerRecipeInput struct { // image. DockerfileTemplateUri *string - // Specifies the operating system version for the source image. + // Specifies the operating system version for the base image. ImageOsVersionOverride *string // A group of options that can be used to configure an instance for building and @@ -94,7 +94,7 @@ type CreateContainerRecipeInput struct { // Identifies which KMS key is used to encrypt the container image. KmsKeyId *string - // Specifies the operating system platform when you use a custom source image. + // Specifies the operating system platform when you use a custom base image. PlatformOverride types.Platform // Tags that are attached to the container recipe. diff --git a/service/imagebuilder/api_op_CreateImageRecipe.go b/service/imagebuilder/api_op_CreateImageRecipe.go index 282b4a7ecea..e7a9be9657b 100644 --- a/service/imagebuilder/api_op_CreateImageRecipe.go +++ b/service/imagebuilder/api_op_CreateImageRecipe.go @@ -46,8 +46,8 @@ type CreateImageRecipeInput struct { // This member is required. Name *string - // The parent image of the image recipe. The value of the string can be the ARN of - // the parent image or an AMI ID. The format for the ARN follows this example: + // The base image of the image recipe. The value of the string can be the ARN of + // the base image or an AMI ID. The format for the ARN follows this example: // arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x. // You can provide the specific version that you want to use, or you can use a // wildcard in all of the fields. If you enter an AMI ID for the string value, you diff --git a/service/imagebuilder/api_op_CreateInfrastructureConfiguration.go b/service/imagebuilder/api_op_CreateInfrastructureConfiguration.go index f504e6c1139..e8dd2967760 100644 --- a/service/imagebuilder/api_op_CreateInfrastructureConfiguration.go +++ b/service/imagebuilder/api_op_CreateInfrastructureConfiguration.go @@ -54,19 +54,9 @@ type CreateInfrastructureConfigurationInput struct { // pipeline builds use to launch EC2 build and test instances. InstanceMetadataOptions *types.InstanceMetadataOptions - // The instance metadata options that you can set for the HTTP requests that - // pipeline builds use to launch EC2 build and test instances. For more information - // about instance metadata options, see one of the following links: - // - // * Configure - // the instance metadata options - // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html) - // in the Amazon EC2 User Guide for Linux instances. - // - // * Configure the instance - // metadata options - // (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html) - // in the Amazon EC2 Windows Guide for Windows instances. + // The instance types of the infrastructure configuration. You can specify one or + // more instance types to use for this build. The service will pick one of these + // instance types based on availability. InstanceTypes []string // The key pair of the infrastructure configuration. You can use this to log on to diff --git a/service/imagebuilder/api_op_ImportComponent.go b/service/imagebuilder/api_op_ImportComponent.go index d7525a5fd36..e571021cb24 100644 --- a/service/imagebuilder/api_op_ImportComponent.go +++ b/service/imagebuilder/api_op_ImportComponent.go @@ -54,7 +54,7 @@ type ImportComponentInput struct { // syntax. The semantic version has four nodes: ../. You can assign values for the // first three, and can filter on all of them. Filtering: With semantic versioning, // you have the flexibility to use wildcards (x) to specify the most recent - // versions or nodes when selecting the source image or components for your recipe. + // versions or nodes when selecting the base image or components for your recipe. // When you use a wildcard in any node, all nodes to the right of the first // wildcard must also be wildcards. // diff --git a/service/imagebuilder/api_op_ListComponentBuildVersions.go b/service/imagebuilder/api_op_ListComponentBuildVersions.go index e714774c668..d405c1fa102 100644 --- a/service/imagebuilder/api_op_ListComponentBuildVersions.go +++ b/service/imagebuilder/api_op_ListComponentBuildVersions.go @@ -16,9 +16,9 @@ import ( // The semantic version has four nodes: ../. You can assign values for the first // three, and can filter on all of them. Filtering: With semantic versioning, you // have the flexibility to use wildcards (x) to specify the most recent versions or -// nodes when selecting the source image or components for your recipe. When you -// use a wildcard in any node, all nodes to the right of the first wildcard must -// also be wildcards. +// nodes when selecting the base image or components for your recipe. When you use +// a wildcard in any node, all nodes to the right of the first wildcard must also +// be wildcards. func (c *Client) ListComponentBuildVersions(ctx context.Context, params *ListComponentBuildVersionsInput, optFns ...func(*Options)) (*ListComponentBuildVersionsOutput, error) { if params == nil { params = &ListComponentBuildVersionsInput{} diff --git a/service/imagebuilder/api_op_ListComponents.go b/service/imagebuilder/api_op_ListComponents.go index c7b65565c10..03c95a42ae8 100644 --- a/service/imagebuilder/api_op_ListComponents.go +++ b/service/imagebuilder/api_op_ListComponents.go @@ -16,9 +16,9 @@ import ( // The semantic version has four nodes: ../. You can assign values for the first // three, and can filter on all of them. Filtering: With semantic versioning, you // have the flexibility to use wildcards (x) to specify the most recent versions or -// nodes when selecting the source image or components for your recipe. When you -// use a wildcard in any node, all nodes to the right of the first wildcard must -// also be wildcards. +// nodes when selecting the base image or components for your recipe. When you use +// a wildcard in any node, all nodes to the right of the first wildcard must also +// be wildcards. func (c *Client) ListComponents(ctx context.Context, params *ListComponentsInput, optFns ...func(*Options)) (*ListComponentsOutput, error) { if params == nil { params = &ListComponentsInput{} diff --git a/service/imagebuilder/api_op_ListImages.go b/service/imagebuilder/api_op_ListImages.go index 4e1678f6070..c28186f933d 100644 --- a/service/imagebuilder/api_op_ListImages.go +++ b/service/imagebuilder/api_op_ListImages.go @@ -71,7 +71,7 @@ type ListImagesOutput struct { // The list of image semantic versions. The semantic version has four nodes: ../. // You can assign values for the first three, and can filter on all of them. // Filtering: With semantic versioning, you have the flexibility to use wildcards - // (x) to specify the most recent versions or nodes when selecting the source image + // (x) to specify the most recent versions or nodes when selecting the base image // or components for your recipe. When you use a wildcard in any node, all nodes to // the right of the first wildcard must also be wildcards. ImageVersionList []types.ImageVersion diff --git a/service/imagebuilder/types/types.go b/service/imagebuilder/types/types.go index 09fd8babee9..aee9e62d08c 100644 --- a/service/imagebuilder/types/types.go +++ b/service/imagebuilder/types/types.go @@ -20,7 +20,7 @@ type AdditionalInstanceConfiguration struct { // your build instance. The userDataOverride property replaces any commands that // Image Builder might have added to ensure that Systems Manager is installed on // your Linux build instance. If you override the user data, make sure that you add - // commands to install Systems Manager, if it is not pre-installed on your source + // commands to install Systems Manager, if it is not pre-installed on your base // image. UserDataOverride *string @@ -69,7 +69,7 @@ type AmiDistributionConfiguration struct { // can use the AMI to launch instances. LaunchPermission *LaunchPermissionConfiguration - // The name of the distribution configuration. + // The name of the output AMI. Name *string // The ID of an account to which you want to distribute an image. @@ -120,8 +120,8 @@ type Component struct { State *ComponentState // The operating system (OS) version supported by the component. If the OS - // information is available, a prefix match is performed against the parent image - // OS version during image recipe creation. + // information is available, a prefix match is performed against the base image OS + // version during image recipe creation. SupportedOsVersions []string // The tags associated with the component. @@ -233,8 +233,8 @@ type ComponentSummary struct { State *ComponentState // The operating system (OS) version supported by the component. If the OS - // information is available, a prefix match is performed against the parent image - // OS version during image recipe creation. + // information is available, a prefix match is performed against the base image OS + // version during image recipe creation. SupportedOsVersions []string // The tags associated with the component. @@ -285,8 +285,8 @@ type ComponentVersion struct { Platform Platform // he operating system (OS) version supported by the component. If the OS - // information is available, a prefix match is performed against the parent image - // OS version during image recipe creation. + // information is available, a prefix match is performed against the base image OS + // version during image recipe creation. SupportedOsVersions []string // The type of the component denotes whether the component is used to build the @@ -302,7 +302,7 @@ type ComponentVersion struct { // requirements for the nodes that you can assign. For example, you might choose a // software version pattern, such as 1.0.0, or a date, such as 2021.01.01. // Filtering: With semantic versioning, you have the flexibility to use wildcards - // (x) to specify the most recent versions or nodes when selecting the source image + // (x) to specify the most recent versions or nodes when selecting the base image // or components for your recipe. When you use a wildcard in any node, all nodes to // the right of the first wildcard must also be wildcards. Version *string @@ -394,7 +394,7 @@ type ContainerRecipe struct { // The owner of the container recipe. Owner *string - // The source image for the container recipe. + // The base image for the container recipe. ParentImage *string // The system platform for the container, such as Windows or Linux. @@ -415,7 +415,7 @@ type ContainerRecipe struct { // requirements for the nodes that you can assign. For example, you might choose a // software version pattern, such as 1.0.0, or a date, such as 2021.01.01. // Filtering: With semantic versioning, you have the flexibility to use wildcards - // (x) to specify the most recent versions or nodes when selecting the source image + // (x) to specify the most recent versions or nodes when selecting the base image // or components for your recipe. When you use a wildcard in any node, all nodes to // the right of the first wildcard must also be wildcards. Version *string @@ -444,7 +444,7 @@ type ContainerRecipeSummary struct { // The owner of the container recipe. Owner *string - // The source image for the container recipe. + // The base image for the container recipe. ParentImage *string // The system platform for the container, such as Windows or Linux. @@ -666,7 +666,7 @@ type Image struct { // requirements for the nodes that you can assign. For example, you might choose a // software version pattern, such as 1.0.0, or a date, such as 2021.01.01. // Filtering: With semantic versioning, you have the flexibility to use wildcards - // (x) to specify the most recent versions or nodes when selecting the source image + // (x) to specify the most recent versions or nodes when selecting the base image // or components for your recipe. When you use a wildcard in any node, all nodes to // the right of the first wildcard must also be wildcards. Version *string @@ -779,7 +779,7 @@ type ImageRecipe struct { // The owner of the image recipe. Owner *string - // The parent image of the image recipe. + // The base image of the image recipe. ParentImage *string // The platform of the image recipe. @@ -816,7 +816,7 @@ type ImageRecipeSummary struct { // The owner of the image recipe. Owner *string - // The parent image of the image recipe. + // The base image of the image recipe. ParentImage *string // The platform of the image recipe. @@ -939,7 +939,7 @@ type ImageVersion struct { // that you can assign. For example, you might choose a software version pattern, // such as 1.0.0, or a date, such as 2021.01.01. Filtering: With semantic // versioning, you have the flexibility to use wildcards (x) to specify the most - // recent versions or nodes when selecting the source image or components for your + // recent versions or nodes when selecting the base image or components for your // recipe. When you use a wildcard in any node, all nodes to the right of the first // wildcard must also be wildcards. Version *string @@ -1044,7 +1044,7 @@ type InstanceBlockDeviceMapping struct { // Use to manage Amazon EBS-specific configuration for this mapping. Ebs *EbsInstanceBlockDeviceSpecification - // Use to remove a mapping from the parent image. + // Use to remove a mapping from the base image. NoDevice *string // Use to manage instance ephemeral devices. @@ -1053,8 +1053,8 @@ type InstanceBlockDeviceMapping struct { noSmithyDocumentSerde } -// Defines a custom source AMI and block device mapping configurations of an -// instance used for building and testing container images. +// Defines a custom base AMI and block device mapping configurations of an instance +// used for building and testing container images. type InstanceConfiguration struct { // Defines the block devices to attach for building an instance from this Image @@ -1179,8 +1179,8 @@ type Schedule struct { // The condition configures when the pipeline should trigger a new image build. // When the pipelineExecutionStartCondition is set to // EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE, and you use semantic version - // filters on the source image or components in your image recipe, EC2 Image - // Builder will build a new image only when there are new versions of the image or + // filters on the base image or components in your image recipe, EC2 Image Builder + // will build a new image only when there are new versions of the image or // components in your recipe that match the semantic version filter. When it is set // to EXPRESSION_MATCH_ONLY, it will build a new image every time the CRON // expression matches the current time. For semantic version syntax, see diff --git a/service/lambda/api_op_AddPermission.go b/service/lambda/api_op_AddPermission.go index 31a381ef023..1d00a335109 100644 --- a/service/lambda/api_op_AddPermission.go +++ b/service/lambda/api_op_AddPermission.go @@ -14,16 +14,16 @@ import ( // function. You can apply the policy at the function level, or specify a qualifier // to restrict access to a single version or alias. If you use a qualifier, the // invoker must use the full Amazon Resource Name (ARN) of that version or alias to -// invoke the function. To grant permission to another account, specify the account -// ID as the Principal. For Amazon Web Services services, the principal is a -// domain-style identifier defined by the service, like s3.amazonaws.com or -// sns.amazonaws.com. For Amazon Web Services services, you can also specify the -// ARN of the associated resource as the SourceArn. If you grant permission to a -// service principal without specifying the source, other accounts could -// potentially configure resources in their account to invoke your Lambda function. -// This action adds a statement to a resource-based permissions policy for the -// function. For more information about function policies, see Lambda Function -// Policies +// invoke the function. Note: Lambda does not support adding policies to version +// $LATEST. To grant permission to another account, specify the account ID as the +// Principal. For Amazon Web Services services, the principal is a domain-style +// identifier defined by the service, like s3.amazonaws.com or sns.amazonaws.com. +// For Amazon Web Services services, you can also specify the ARN of the associated +// resource as the SourceArn. If you grant permission to a service principal +// without specifying the source, other accounts could potentially configure +// resources in their account to invoke your Lambda function. This action adds a +// statement to a resource-based permissions policy for the function. For more +// information about function policies, see Lambda Function Policies // (https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html). func (c *Client) AddPermission(ctx context.Context, params *AddPermissionInput, optFns ...func(*Options)) (*AddPermissionOutput, error) { if params == nil { @@ -98,6 +98,7 @@ type AddPermissionInput struct { // For Amazon Web Services services, the ARN of the Amazon Web Services resource // that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic. + // Note that Lambda configures the comparison using the StringLike operator. SourceArn *string noSmithyDocumentSerde diff --git a/service/lambda/api_op_CreateEventSourceMapping.go b/service/lambda/api_op_CreateEventSourceMapping.go index f515f5de69a..df55675597d 100644 --- a/service/lambda/api_op_CreateEventSourceMapping.go +++ b/service/lambda/api_op_CreateEventSourceMapping.go @@ -14,11 +14,10 @@ import ( // Creates a mapping between an event source and an Lambda function. Lambda reads // items from the event source and triggers the function. For details about each -// event source type, see the following topics. In particular, each of the topics -// describes the required and optional parameters for the specific event source. +// event source type, see the following topics. // -// * -// Configuring a Dynamo DB stream as an event source +// * Configuring a Dynamo DB stream +// as an event source // (https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) // // * @@ -26,7 +25,7 @@ import ( // (https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) // // * -// Configuring an SQS queue as an event source +// Configuring an Amazon SQS queue as an event source // (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) // // * @@ -100,21 +99,24 @@ type CreateEventSourceMappingInput struct { // This member is required. FunctionName *string - // The maximum number of items to retrieve in a single batch. + // The maximum number of records in each batch that Lambda pulls from your stream + // or queue and sends to your function. Lambda passes all of the records in the + // batch to the function in a single call, up to the payload limit for synchronous + // invocation (6 MB). // - // * Amazon Kinesis - - // Default 100. Max 10,000. + // * Amazon Kinesis - Default 100. Max 10,000. // - // * Amazon DynamoDB Streams - Default 100. Max 1,000. + // * Amazon + // DynamoDB Streams - Default 100. Max 1,000. // - // * - // Amazon Simple Queue Service - Default 10. For standard queues the max is 10,000. - // For FIFO queues the max is 10. + // * Amazon Simple Queue Service - + // Default 10. For standard queues the max is 10,000. For FIFO queues the max is + // 10. // - // * Amazon Managed Streaming for Apache Kafka - - // Default 100. Max 10,000. + // * Amazon Managed Streaming for Apache Kafka - Default 100. Max 10,000. // - // * Self-Managed Apache Kafka - Default 100. Max 10,000. + // * + // Self-Managed Apache Kafka - Default 100. Max 10,000. BatchSize *int32 // (Streams only) If the function returns an error, split the batch in two and @@ -125,8 +127,8 @@ type CreateEventSourceMappingInput struct { // records. DestinationConfig *types.DestinationConfig - // If true, the event source mapping is active. Set to false to pause polling and - // invocation. + // When true, the event source mapping is active. When false, Lambda pauses polling + // and invocation. Default: True Enabled *bool // The Amazon Resource Name (ARN) of the event source. @@ -147,8 +149,10 @@ type CreateEventSourceMappingInput struct { // mapping. FunctionResponseTypes []types.FunctionResponseType - // (Streams and SQS standard queues) The maximum amount of time to gather records - // before invoking the function, in seconds. + // (Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, + // that Lambda spends gathering records before invoking the function. Default: 0 + // Related setting: When you set BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. MaximumBatchingWindowInSeconds *int32 // (Streams only) Discard records older than the specified age. The default value @@ -195,7 +199,13 @@ type CreateEventSourceMappingInput struct { // details, see CreateEventSourceMapping. type CreateEventSourceMappingOutput struct { - // The maximum number of items to retrieve in a single batch. + // The maximum number of records in each batch that Lambda pulls from your stream + // or queue and sends to your function. Lambda passes all of the records in the + // batch to the function in a single call, up to the payload limit for synchronous + // invocation (6 MB). Default value: Varies by service. For Amazon SQS, the default + // is 10. For all other services, the default is 100. Related setting: When you set + // BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. BatchSize *int32 // (Streams only) If the function returns an error, split the batch in two and @@ -223,8 +233,10 @@ type CreateEventSourceMappingOutput struct { // The result of the last Lambda invocation of your function. LastProcessingResult *string - // (Streams and Amazon SQS standard queues) The maximum amount of time to gather - // records before invoking the function, in seconds. The default value is zero. + // (Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, + // that Lambda spends gathering records before invoking the function. Default: 0 + // Related setting: When you set BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. MaximumBatchingWindowInSeconds *int32 // (Streams only) Discard records older than the specified age. The default value diff --git a/service/lambda/api_op_CreateFunction.go b/service/lambda/api_op_CreateFunction.go index af983e4e253..6a52bdc3515 100644 --- a/service/lambda/api_op_CreateFunction.go +++ b/service/lambda/api_op_CreateFunction.go @@ -27,13 +27,15 @@ import ( // file archive // (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip). // For a .zip file archive, the code property specifies the location of the .zip -// file. You must also specify the handler and runtime properties. When you create -// a function, Lambda provisions an instance of the function and its supporting -// resources. If your function connects to a VPC, this process can take a minute or -// so. During this time, you can't invoke or modify the function. The State, -// StateReason, and StateReasonCode fields in the response from -// GetFunctionConfiguration indicate when the function is ready to invoke. For more -// information, see Function States +// file. You must also specify the handler and runtime properties. The code in the +// deployment package must be compatible with the target instruction set +// architecture of the function (x86-64 or arm64). If you do not specify the +// architecture, the default value is x86-64. When you create a function, Lambda +// provisions an instance of the function and its supporting resources. If your +// function connects to a VPC, this process can take a minute or so. During this +// time, you can't invoke or modify the function. The State, StateReason, and +// StateReasonCode fields in the response from GetFunctionConfiguration indicate +// when the function is ready to invoke. For more information, see Function States // (https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html). A function // has an unpublished version, and can have published versions and aliases. The // unpublished version changes when you update your function's code and @@ -104,6 +106,10 @@ type CreateFunctionInput struct { // This member is required. Role *string + // The instruction set architecture that the function supports. Enter a string + // array with one of the valid values. The default value is x86_64. + Architectures []types.Architecture + // To enable code signing for this function, specify the ARN of a code-signing // configuration. A code-signing configuration includes a set of signing profiles, // which define the trusted publishers for this function. @@ -191,6 +197,11 @@ type CreateFunctionInput struct { // Details about a function's configuration. type CreateFunctionOutput struct { + // The instruction set architecture that the function supports. Architecture is a + // string array with one of the valid values. The default architecture value is + // x86_64. + Architectures []types.Architecture + // The SHA256 hash of the function's deployment package. CodeSha256 *string diff --git a/service/lambda/api_op_DeleteEventSourceMapping.go b/service/lambda/api_op_DeleteEventSourceMapping.go index 5dbedb77753..23eda5c7f44 100644 --- a/service/lambda/api_op_DeleteEventSourceMapping.go +++ b/service/lambda/api_op_DeleteEventSourceMapping.go @@ -46,7 +46,13 @@ type DeleteEventSourceMappingInput struct { // details, see CreateEventSourceMapping. type DeleteEventSourceMappingOutput struct { - // The maximum number of items to retrieve in a single batch. + // The maximum number of records in each batch that Lambda pulls from your stream + // or queue and sends to your function. Lambda passes all of the records in the + // batch to the function in a single call, up to the payload limit for synchronous + // invocation (6 MB). Default value: Varies by service. For Amazon SQS, the default + // is 10. For all other services, the default is 100. Related setting: When you set + // BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. BatchSize *int32 // (Streams only) If the function returns an error, split the batch in two and @@ -74,8 +80,10 @@ type DeleteEventSourceMappingOutput struct { // The result of the last Lambda invocation of your function. LastProcessingResult *string - // (Streams and Amazon SQS standard queues) The maximum amount of time to gather - // records before invoking the function, in seconds. The default value is zero. + // (Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, + // that Lambda spends gathering records before invoking the function. Default: 0 + // Related setting: When you set BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. MaximumBatchingWindowInSeconds *int32 // (Streams only) Discard records older than the specified age. The default value diff --git a/service/lambda/api_op_GetEventSourceMapping.go b/service/lambda/api_op_GetEventSourceMapping.go index 0f771aa2ba7..ed4886e8a73 100644 --- a/service/lambda/api_op_GetEventSourceMapping.go +++ b/service/lambda/api_op_GetEventSourceMapping.go @@ -43,7 +43,13 @@ type GetEventSourceMappingInput struct { // details, see CreateEventSourceMapping. type GetEventSourceMappingOutput struct { - // The maximum number of items to retrieve in a single batch. + // The maximum number of records in each batch that Lambda pulls from your stream + // or queue and sends to your function. Lambda passes all of the records in the + // batch to the function in a single call, up to the payload limit for synchronous + // invocation (6 MB). Default value: Varies by service. For Amazon SQS, the default + // is 10. For all other services, the default is 100. Related setting: When you set + // BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. BatchSize *int32 // (Streams only) If the function returns an error, split the batch in two and @@ -71,8 +77,10 @@ type GetEventSourceMappingOutput struct { // The result of the last Lambda invocation of your function. LastProcessingResult *string - // (Streams and Amazon SQS standard queues) The maximum amount of time to gather - // records before invoking the function, in seconds. The default value is zero. + // (Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, + // that Lambda spends gathering records before invoking the function. Default: 0 + // Related setting: When you set BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. MaximumBatchingWindowInSeconds *int32 // (Streams only) Discard records older than the specified age. The default value diff --git a/service/lambda/api_op_GetFunctionConfiguration.go b/service/lambda/api_op_GetFunctionConfiguration.go index 38698a6eed1..5df7dc69693 100644 --- a/service/lambda/api_op_GetFunctionConfiguration.go +++ b/service/lambda/api_op_GetFunctionConfiguration.go @@ -65,6 +65,11 @@ type GetFunctionConfigurationInput struct { // Details about a function's configuration. type GetFunctionConfigurationOutput struct { + // The instruction set architecture that the function supports. Architecture is a + // string array with one of the valid values. The default architecture value is + // x86_64. + Architectures []types.Architecture + // The SHA256 hash of the function's deployment package. CodeSha256 *string diff --git a/service/lambda/api_op_GetLayerVersion.go b/service/lambda/api_op_GetLayerVersion.go index 37c10d2d63f..49f7e959882 100644 --- a/service/lambda/api_op_GetLayerVersion.go +++ b/service/lambda/api_op_GetLayerVersion.go @@ -46,6 +46,10 @@ type GetLayerVersionInput struct { type GetLayerVersionOutput struct { + // A list of compatible instruction set architectures + // (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + CompatibleArchitectures []types.Architecture + // The layer's compatible runtimes. CompatibleRuntimes []types.Runtime diff --git a/service/lambda/api_op_GetLayerVersionByArn.go b/service/lambda/api_op_GetLayerVersionByArn.go index 820d4e6c40c..43529ce142b 100644 --- a/service/lambda/api_op_GetLayerVersionByArn.go +++ b/service/lambda/api_op_GetLayerVersionByArn.go @@ -41,6 +41,10 @@ type GetLayerVersionByArnInput struct { type GetLayerVersionByArnOutput struct { + // A list of compatible instruction set architectures + // (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + CompatibleArchitectures []types.Architecture + // The layer's compatible runtimes. CompatibleRuntimes []types.Runtime diff --git a/service/lambda/api_op_Invoke.go b/service/lambda/api_op_Invoke.go index 5fd9a6f6c30..d7b155225d2 100644 --- a/service/lambda/api_op_Invoke.go +++ b/service/lambda/api_op_Invoke.go @@ -101,7 +101,8 @@ type InvokeInput struct { // values and verify that the user or role has permission to invoke the function. InvocationType types.InvocationType - // Set to Tail to include the execution log in the response. + // Set to Tail to include the execution log in the response. Applies to + // synchronously invoked functions only. LogType types.LogType // The JSON that you want to provide to your Lambda function as input. diff --git a/service/lambda/api_op_ListLayerVersions.go b/service/lambda/api_op_ListLayerVersions.go index c8b311b7e8c..61d980bbf4b 100644 --- a/service/lambda/api_op_ListLayerVersions.go +++ b/service/lambda/api_op_ListLayerVersions.go @@ -16,7 +16,9 @@ import ( // (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). // Versions that have been deleted aren't listed. Specify a runtime identifier // (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only -// versions that indicate that they're compatible with that runtime. +// versions that indicate that they're compatible with that runtime. Specify a +// compatible architecture to include only layer versions that are compatible with +// that architecture. func (c *Client) ListLayerVersions(ctx context.Context, params *ListLayerVersionsInput, optFns ...func(*Options)) (*ListLayerVersionsOutput, error) { if params == nil { params = &ListLayerVersionsInput{} @@ -39,6 +41,10 @@ type ListLayerVersionsInput struct { // This member is required. LayerName *string + // The compatible instruction set architecture + // (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + CompatibleArchitecture types.Architecture + // A runtime identifier. For example, go1.x. CompatibleRuntime types.Runtime diff --git a/service/lambda/api_op_ListLayers.go b/service/lambda/api_op_ListLayers.go index 0e2c9a82ebf..34da61f254a 100644 --- a/service/lambda/api_op_ListLayers.go +++ b/service/lambda/api_op_ListLayers.go @@ -13,10 +13,13 @@ import ( ) // Lists Lambda layers -// (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) and -// shows information about the latest version of each. Specify a runtime identifier +// (https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows +// information about the latest version of each. Specify a runtime identifier // (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only -// layers that indicate that they're compatible with that runtime. +// layers that indicate that they're compatible with that runtime. Specify a +// compatible architecture to include only layers that are compatible with that +// instruction set architecture +// (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). func (c *Client) ListLayers(ctx context.Context, params *ListLayersInput, optFns ...func(*Options)) (*ListLayersOutput, error) { if params == nil { params = &ListLayersInput{} @@ -34,6 +37,10 @@ func (c *Client) ListLayers(ctx context.Context, params *ListLayersInput, optFns type ListLayersInput struct { + // The compatible instruction set architecture + // (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + CompatibleArchitecture types.Architecture + // A runtime identifier. For example, go1.x. CompatibleRuntime types.Runtime diff --git a/service/lambda/api_op_ListTags.go b/service/lambda/api_op_ListTags.go index aca8287c47a..7bfad35262f 100644 --- a/service/lambda/api_op_ListTags.go +++ b/service/lambda/api_op_ListTags.go @@ -30,7 +30,8 @@ func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ... type ListTagsInput struct { - // The function's Amazon Resource Name (ARN). + // The function's Amazon Resource Name (ARN). Note: Lambda does not support adding + // tags to aliases or versions. // // This member is required. Resource *string diff --git a/service/lambda/api_op_PublishLayerVersion.go b/service/lambda/api_op_PublishLayerVersion.go index 05d04f7ef92..af3bcaf16a9 100644 --- a/service/lambda/api_op_PublishLayerVersion.go +++ b/service/lambda/api_op_PublishLayerVersion.go @@ -43,6 +43,10 @@ type PublishLayerVersionInput struct { // This member is required. LayerName *string + // A list of compatible instruction set architectures + // (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + CompatibleArchitectures []types.Architecture + // A list of compatible function runtimes // (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). Used for // filtering with ListLayers and ListLayerVersions. @@ -68,6 +72,10 @@ type PublishLayerVersionInput struct { type PublishLayerVersionOutput struct { + // A list of compatible instruction set architectures + // (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + CompatibleArchitectures []types.Architecture + // The layer's compatible runtimes. CompatibleRuntimes []types.Runtime diff --git a/service/lambda/api_op_PublishVersion.go b/service/lambda/api_op_PublishVersion.go index 79ed52dbca1..ec22e50232b 100644 --- a/service/lambda/api_op_PublishVersion.go +++ b/service/lambda/api_op_PublishVersion.go @@ -74,6 +74,11 @@ type PublishVersionInput struct { // Details about a function's configuration. type PublishVersionOutput struct { + // The instruction set architecture that the function supports. Architecture is a + // string array with one of the valid values. The default architecture value is + // x86_64. + Architectures []types.Architecture + // The SHA256 hash of the function's deployment package. CodeSha256 *string diff --git a/service/lambda/api_op_PutFunctionConcurrency.go b/service/lambda/api_op_PutFunctionConcurrency.go index d49b5dd7f74..798406152ab 100644 --- a/service/lambda/api_op_PutFunctionConcurrency.go +++ b/service/lambda/api_op_PutFunctionConcurrency.go @@ -67,7 +67,7 @@ type PutFunctionConcurrencyOutput struct { // The number of concurrent executions that are reserved for this function. For // more information, see Managing Concurrency - // (https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html). + // (https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html). ReservedConcurrentExecutions *int32 // Metadata pertaining to the operation's result. diff --git a/service/lambda/api_op_UpdateEventSourceMapping.go b/service/lambda/api_op_UpdateEventSourceMapping.go index 778c51d96a3..7ffbb446496 100644 --- a/service/lambda/api_op_UpdateEventSourceMapping.go +++ b/service/lambda/api_op_UpdateEventSourceMapping.go @@ -56,21 +56,24 @@ type UpdateEventSourceMappingInput struct { // This member is required. UUID *string - // The maximum number of items to retrieve in a single batch. + // The maximum number of records in each batch that Lambda pulls from your stream + // or queue and sends to your function. Lambda passes all of the records in the + // batch to the function in a single call, up to the payload limit for synchronous + // invocation (6 MB). // - // * Amazon Kinesis - - // Default 100. Max 10,000. + // * Amazon Kinesis - Default 100. Max 10,000. // - // * Amazon DynamoDB Streams - Default 100. Max 1,000. + // * Amazon + // DynamoDB Streams - Default 100. Max 1,000. // - // * - // Amazon Simple Queue Service - Default 10. For standard queues the max is 10,000. - // For FIFO queues the max is 10. + // * Amazon Simple Queue Service - + // Default 10. For standard queues the max is 10,000. For FIFO queues the max is + // 10. // - // * Amazon Managed Streaming for Apache Kafka - - // Default 100. Max 10,000. + // * Amazon Managed Streaming for Apache Kafka - Default 100. Max 10,000. // - // * Self-Managed Apache Kafka - Default 100. Max 10,000. + // * + // Self-Managed Apache Kafka - Default 100. Max 10,000. BatchSize *int32 // (Streams only) If the function returns an error, split the batch in two and @@ -81,8 +84,8 @@ type UpdateEventSourceMappingInput struct { // records. DestinationConfig *types.DestinationConfig - // If true, the event source mapping is active. Set to false to pause polling and - // invocation. + // When true, the event source mapping is active. When false, Lambda pauses polling + // and invocation. Default: True Enabled *bool // The name of the Lambda function. Name formats @@ -108,8 +111,10 @@ type UpdateEventSourceMappingInput struct { // mapping. FunctionResponseTypes []types.FunctionResponseType - // (Streams and SQS standard queues) The maximum amount of time to gather records - // before invoking the function, in seconds. + // (Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, + // that Lambda spends gathering records before invoking the function. Default: 0 + // Related setting: When you set BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. MaximumBatchingWindowInSeconds *int32 // (Streams only) Discard records older than the specified age. The default value @@ -139,7 +144,13 @@ type UpdateEventSourceMappingInput struct { // details, see CreateEventSourceMapping. type UpdateEventSourceMappingOutput struct { - // The maximum number of items to retrieve in a single batch. + // The maximum number of records in each batch that Lambda pulls from your stream + // or queue and sends to your function. Lambda passes all of the records in the + // batch to the function in a single call, up to the payload limit for synchronous + // invocation (6 MB). Default value: Varies by service. For Amazon SQS, the default + // is 10. For all other services, the default is 100. Related setting: When you set + // BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. BatchSize *int32 // (Streams only) If the function returns an error, split the batch in two and @@ -167,8 +178,10 @@ type UpdateEventSourceMappingOutput struct { // The result of the last Lambda invocation of your function. LastProcessingResult *string - // (Streams and Amazon SQS standard queues) The maximum amount of time to gather - // records before invoking the function, in seconds. The default value is zero. + // (Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, + // that Lambda spends gathering records before invoking the function. Default: 0 + // Related setting: When you set BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. MaximumBatchingWindowInSeconds *int32 // (Streams only) Discard records older than the specified age. The default value diff --git a/service/lambda/api_op_UpdateFunctionCode.go b/service/lambda/api_op_UpdateFunctionCode.go index ed703d7e920..f14ffa9c234 100644 --- a/service/lambda/api_op_UpdateFunctionCode.go +++ b/service/lambda/api_op_UpdateFunctionCode.go @@ -54,6 +54,10 @@ type UpdateFunctionCodeInput struct { // This member is required. FunctionName *string + // The instruction set architecture that the function supports. Enter a string + // array with one of the valid values. The default value is x86_64. + Architectures []types.Architecture + // Set to true to validate the request parameters and access permissions without // modifying the function code. DryRun bool @@ -90,6 +94,11 @@ type UpdateFunctionCodeInput struct { // Details about a function's configuration. type UpdateFunctionCodeOutput struct { + // The instruction set architecture that the function supports. Architecture is a + // string array with one of the valid values. The default architecture value is + // x86_64. + Architectures []types.Architecture + // The SHA256 hash of the function's deployment package. CodeSha256 *string diff --git a/service/lambda/api_op_UpdateFunctionConfiguration.go b/service/lambda/api_op_UpdateFunctionConfiguration.go index edfca44bdec..1313fdc17c8 100644 --- a/service/lambda/api_op_UpdateFunctionConfiguration.go +++ b/service/lambda/api_op_UpdateFunctionConfiguration.go @@ -83,7 +83,7 @@ type UpdateFunctionConfigurationInput struct { // Container image configuration values // (https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override - // the values in the container image Dockerfile. + // the values in the container image Docker file. ImageConfig *types.ImageConfig // The ARN of the Amazon Web Services Key Management Service (KMS) key that's used @@ -138,6 +138,11 @@ type UpdateFunctionConfigurationInput struct { // Details about a function's configuration. type UpdateFunctionConfigurationOutput struct { + // The instruction set architecture that the function supports. Architecture is a + // string array with one of the valid values. The default architecture value is + // x86_64. + Architectures []types.Architecture + // The SHA256 hash of the function's deployment package. CodeSha256 *string diff --git a/service/lambda/deserializers.go b/service/lambda/deserializers.go index 42ba87684e2..16b857e2960 100644 --- a/service/lambda/deserializers.go +++ b/service/lambda/deserializers.go @@ -1245,6 +1245,11 @@ func awsRestjson1_deserializeOpDocumentCreateFunctionOutput(v **CreateFunctionOu for key, value := range shape { switch key { + case "Architectures": + if err := awsRestjson1_deserializeDocumentArchitecturesList(&sv.Architectures, value); err != nil { + return err + } + case "CodeSha256": if value != nil { jtv, ok := value.(string) @@ -4191,6 +4196,11 @@ func awsRestjson1_deserializeOpDocumentGetFunctionConfigurationOutput(v **GetFun for key, value := range shape { switch key { + case "Architectures": + if err := awsRestjson1_deserializeDocumentArchitecturesList(&sv.Architectures, value); err != nil { + return err + } + case "CodeSha256": if value != nil { jtv, ok := value.(string) @@ -4812,6 +4822,11 @@ func awsRestjson1_deserializeOpDocumentGetLayerVersionOutput(v **GetLayerVersion for key, value := range shape { switch key { + case "CompatibleArchitectures": + if err := awsRestjson1_deserializeDocumentCompatibleArchitectures(&sv.CompatibleArchitectures, value); err != nil { + return err + } + case "CompatibleRuntimes": if err := awsRestjson1_deserializeDocumentCompatibleRuntimes(&sv.CompatibleRuntimes, value); err != nil { return err @@ -5031,6 +5046,11 @@ func awsRestjson1_deserializeOpDocumentGetLayerVersionByArnOutput(v **GetLayerVe for key, value := range shape { switch key { + case "CompatibleArchitectures": + if err := awsRestjson1_deserializeDocumentCompatibleArchitectures(&sv.CompatibleArchitectures, value); err != nil { + return err + } + case "CompatibleRuntimes": if err := awsRestjson1_deserializeDocumentCompatibleRuntimes(&sv.CompatibleRuntimes, value); err != nil { return err @@ -7919,6 +7939,11 @@ func awsRestjson1_deserializeOpDocumentPublishLayerVersionOutput(v **PublishLaye for key, value := range shape { switch key { + case "CompatibleArchitectures": + if err := awsRestjson1_deserializeDocumentCompatibleArchitectures(&sv.CompatibleArchitectures, value); err != nil { + return err + } + case "CompatibleRuntimes": if err := awsRestjson1_deserializeDocumentCompatibleRuntimes(&sv.CompatibleRuntimes, value); err != nil { return err @@ -8147,6 +8172,11 @@ func awsRestjson1_deserializeOpDocumentPublishVersionOutput(v **PublishVersionOu for key, value := range shape { switch key { + case "Architectures": + if err := awsRestjson1_deserializeDocumentArchitecturesList(&sv.Architectures, value); err != nil { + return err + } + case "CodeSha256": if value != nil { jtv, ok := value.(string) @@ -10484,6 +10514,11 @@ func awsRestjson1_deserializeOpDocumentUpdateFunctionCodeOutput(v **UpdateFuncti for key, value := range shape { switch key { + case "Architectures": + if err := awsRestjson1_deserializeDocumentArchitecturesList(&sv.Architectures, value); err != nil { + return err + } + case "CodeSha256": if value != nil { jtv, ok := value.(string) @@ -10913,6 +10948,11 @@ func awsRestjson1_deserializeOpDocumentUpdateFunctionConfigurationOutput(v **Upd for key, value := range shape { switch key { + case "Architectures": + if err := awsRestjson1_deserializeDocumentArchitecturesList(&sv.Architectures, value); err != nil { + return err + } + case "CodeSha256": if value != nil { jtv, ok := value.(string) @@ -13036,6 +13076,42 @@ func awsRestjson1_deserializeDocumentAllowedPublishers(v **types.AllowedPublishe return nil } +func awsRestjson1_deserializeDocumentArchitecturesList(v *[]types.Architecture, 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.Architecture + if *v == nil { + cv = []types.Architecture{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Architecture + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) + } + col = types.Architecture(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCodeSigningConfig(v **types.CodeSigningConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13334,6 +13410,42 @@ func awsRestjson1_deserializeDocumentCodeVerificationFailedException(v **types.C return nil } +func awsRestjson1_deserializeDocumentCompatibleArchitectures(v *[]types.Architecture, 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.Architecture + if *v == nil { + cv = []types.Architecture{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Architecture + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) + } + col = types.Architecture(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCompatibleRuntimes(v *[]types.Runtime, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14577,6 +14689,11 @@ func awsRestjson1_deserializeDocumentFunctionConfiguration(v **types.FunctionCon for key, value := range shape { switch key { + case "Architectures": + if err := awsRestjson1_deserializeDocumentArchitecturesList(&sv.Architectures, value); err != nil { + return err + } + case "CodeSha256": if value != nil { jtv, ok := value.(string) @@ -16048,6 +16165,11 @@ func awsRestjson1_deserializeDocumentLayerVersionsListItem(v **types.LayerVersio for key, value := range shape { switch key { + case "CompatibleArchitectures": + if err := awsRestjson1_deserializeDocumentCompatibleArchitectures(&sv.CompatibleArchitectures, value); err != nil { + return err + } + case "CompatibleRuntimes": if err := awsRestjson1_deserializeDocumentCompatibleRuntimes(&sv.CompatibleRuntimes, value); err != nil { return err diff --git a/service/lambda/serializers.go b/service/lambda/serializers.go index 038554d80fb..a76188f9563 100644 --- a/service/lambda/serializers.go +++ b/service/lambda/serializers.go @@ -642,6 +642,13 @@ func awsRestjson1_serializeOpDocumentCreateFunctionInput(v *CreateFunctionInput, object := value.Object() defer object.Close() + if v.Architectures != nil { + ok := object.Key("Architectures") + if err := awsRestjson1_serializeDocumentArchitecturesList(v.Architectures, ok); err != nil { + return err + } + } + if v.Code != nil { ok := object.Key("Code") if err := awsRestjson1_serializeDocumentFunctionCode(v.Code, ok); err != nil { @@ -2739,6 +2746,10 @@ func awsRestjson1_serializeOpHttpBindingsListLayersInput(v *ListLayersInput, enc return fmt.Errorf("unsupported serialization of nil %T", v) } + if len(v.CompatibleArchitecture) > 0 { + encoder.SetQuery("CompatibleArchitecture").String(string(v.CompatibleArchitecture)) + } + if len(v.CompatibleRuntime) > 0 { encoder.SetQuery("CompatibleRuntime").String(string(v.CompatibleRuntime)) } @@ -2800,6 +2811,10 @@ func awsRestjson1_serializeOpHttpBindingsListLayerVersionsInput(v *ListLayerVers return fmt.Errorf("unsupported serialization of nil %T", v) } + if len(v.CompatibleArchitecture) > 0 { + encoder.SetQuery("CompatibleArchitecture").String(string(v.CompatibleArchitecture)) + } + if len(v.CompatibleRuntime) > 0 { encoder.SetQuery("CompatibleRuntime").String(string(v.CompatibleRuntime)) } @@ -3087,6 +3102,13 @@ func awsRestjson1_serializeOpDocumentPublishLayerVersionInput(v *PublishLayerVer object := value.Object() defer object.Close() + if v.CompatibleArchitectures != nil { + ok := object.Key("CompatibleArchitectures") + if err := awsRestjson1_serializeDocumentCompatibleArchitectures(v.CompatibleArchitectures, ok); err != nil { + return err + } + } + if v.CompatibleRuntimes != nil { ok := object.Key("CompatibleRuntimes") if err := awsRestjson1_serializeDocumentCompatibleRuntimes(v.CompatibleRuntimes, ok); err != nil { @@ -4265,6 +4287,13 @@ func awsRestjson1_serializeOpDocumentUpdateFunctionCodeInput(v *UpdateFunctionCo object := value.Object() defer object.Close() + if v.Architectures != nil { + ok := object.Key("Architectures") + if err := awsRestjson1_serializeDocumentArchitecturesList(v.Architectures, ok); err != nil { + return err + } + } + if v.DryRun { ok := object.Key("DryRun") ok.Boolean(v.DryRun) @@ -4622,6 +4651,17 @@ func awsRestjson1_serializeDocumentAllowedPublishers(v *types.AllowedPublishers, return nil } +func awsRestjson1_serializeDocumentArchitecturesList(v []types.Architecture, 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_serializeDocumentCodeSigningPolicies(v *types.CodeSigningPolicies, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4634,6 +4674,17 @@ func awsRestjson1_serializeDocumentCodeSigningPolicies(v *types.CodeSigningPolic return nil } +func awsRestjson1_serializeDocumentCompatibleArchitectures(v []types.Architecture, 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_serializeDocumentCompatibleRuntimes(v []types.Runtime, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/lambda/types/enums.go b/service/lambda/types/enums.go index 03830fc83db..6a7822b6df6 100644 --- a/service/lambda/types/enums.go +++ b/service/lambda/types/enums.go @@ -2,6 +2,24 @@ package types +type Architecture string + +// Enum values for Architecture +const ( + ArchitectureX8664 Architecture = "x86_64" + ArchitectureArm64 Architecture = "arm64" +) + +// Values returns all known values for Architecture. 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 (Architecture) Values() []Architecture { + return []Architecture{ + "x86_64", + "arm64", + } +} + type CodeSigningPolicy string // Enum values for CodeSigningPolicy diff --git a/service/lambda/types/errors.go b/service/lambda/types/errors.go index 045df84f17f..9ce635f4407 100644 --- a/service/lambda/types/errors.go +++ b/service/lambda/types/errors.go @@ -145,7 +145,7 @@ func (e *EC2UnexpectedException) ErrorMessage() string { func (e *EC2UnexpectedException) ErrorCode() string { return "EC2UnexpectedException" } func (e *EC2UnexpectedException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } -// An error occured when reading from or writing to a connected file system. +// An error occurred when reading from or writing to a connected file system. type EFSIOException struct { Message *string diff --git a/service/lambda/types/types.go b/service/lambda/types/types.go index 227dbd38da2..be666859ba9 100644 --- a/service/lambda/types/types.go +++ b/service/lambda/types/types.go @@ -151,7 +151,7 @@ type Concurrency struct { // The number of concurrent executions that are reserved for this function. For // more information, see Managing Concurrency - // (https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html). + // (https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html). ReservedConcurrentExecutions *int32 noSmithyDocumentSerde @@ -225,7 +225,13 @@ type EnvironmentResponse struct { // details, see CreateEventSourceMapping. type EventSourceMappingConfiguration struct { - // The maximum number of items to retrieve in a single batch. + // The maximum number of records in each batch that Lambda pulls from your stream + // or queue and sends to your function. Lambda passes all of the records in the + // batch to the function in a single call, up to the payload limit for synchronous + // invocation (6 MB). Default value: Varies by service. For Amazon SQS, the default + // is 10. For all other services, the default is 100. Related setting: When you set + // BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. BatchSize *int32 // (Streams only) If the function returns an error, split the batch in two and @@ -253,8 +259,10 @@ type EventSourceMappingConfiguration struct { // The result of the last Lambda invocation of your function. LastProcessingResult *string - // (Streams and Amazon SQS standard queues) The maximum amount of time to gather - // records before invoking the function, in seconds. The default value is zero. + // (Streams and Amazon SQS standard queues) The maximum amount of time, in seconds, + // that Lambda spends gathering records before invoking the function. Default: 0 + // Related setting: When you set BatchSize to a value greater than 10, you must set + // MaximumBatchingWindowInSeconds to at least 1. MaximumBatchingWindowInSeconds *int32 // (Streams only) Discard records older than the specified age. The default value @@ -378,6 +386,11 @@ type FunctionCodeLocation struct { // Details about a function's configuration. type FunctionConfiguration struct { + // The instruction set architecture that the function supports. Architecture is a + // string array with one of the valid values. The default architecture value is + // x86_64. + Architectures []Architecture + // The SHA256 hash of the function's deployment package. CodeSha256 *string @@ -639,6 +652,10 @@ type LayerVersionContentOutput struct { // (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). type LayerVersionsListItem struct { + // A list of compatible instruction set architectures + // (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + CompatibleArchitectures []Architecture + // The layer's compatible runtimes. CompatibleRuntimes []Runtime diff --git a/service/macie2/api_op_GetBucketStatistics.go b/service/macie2/api_op_GetBucketStatistics.go index c1111173413..76033c213a3 100644 --- a/service/macie2/api_op_GetBucketStatistics.go +++ b/service/macie2/api_op_GetBucketStatistics.go @@ -82,16 +82,16 @@ type GetBucketStatisticsOutput struct { ObjectCount int64 // The total storage size, in bytes, of the buckets. If versioning is enabled for - // any of the buckets, Macie calculates this value based on the size of the latest - // version of each object in those buckets. This value doesn't reflect the storage - // size of all versions of the objects in the buckets. + // any of the buckets, Amazon Macie calculates this value based on the size of the + // latest version of each object in those buckets. This value doesn't reflect the + // storage size of all versions of the objects in the buckets. SizeInBytes int64 // The total storage size, in bytes, of the objects that are compressed (.gz, // .gzip, .zip) files in the buckets. If versioning is enabled for any of the - // buckets, Macie calculates this value based on the size of the latest version of - // each applicable object in those buckets. This value doesn't reflect the storage - // size of all versions of the applicable objects in the buckets. + // buckets, Amazon Macie calculates this value based on the size of the latest + // version of each applicable object in those buckets. This value doesn't reflect + // the storage size of all versions of the applicable objects in the buckets. SizeInBytesCompressed int64 // The total number of objects that Amazon Macie can't analyze in the buckets. diff --git a/service/macie2/deserializers.go b/service/macie2/deserializers.go index 6dae85d7d9b..0fc20f6a925 100644 --- a/service/macie2/deserializers.go +++ b/service/macie2/deserializers.go @@ -10939,6 +10939,24 @@ func awsRestjson1_deserializeDocumentBucketMetadata(v **types.BucketMetadata, va sv.ClassifiableSizeInBytes = i64 } + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BucketMetadataErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.BucketMetadataErrorCode(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + case "jobDetails": if err := awsRestjson1_deserializeDocumentJobDetails(&sv.JobDetails, value); err != nil { return err @@ -13766,6 +13784,24 @@ func awsRestjson1_deserializeDocumentMatchingBucket(v **types.MatchingBucket, va sv.ClassifiableSizeInBytes = i64 } + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BucketMetadataErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.BucketMetadataErrorCode(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + case "jobDetails": if err := awsRestjson1_deserializeDocumentJobDetails(&sv.JobDetails, value); err != nil { return err diff --git a/service/macie2/types/enums.go b/service/macie2/types/enums.go index 1809a99740c..d48ffcb69d3 100644 --- a/service/macie2/types/enums.go +++ b/service/macie2/types/enums.go @@ -41,6 +41,22 @@ func (AllowsUnencryptedObjectUploads) Values() []AllowsUnencryptedObjectUploads } } +type BucketMetadataErrorCode string + +// Enum values for BucketMetadataErrorCode +const ( + BucketMetadataErrorCodeAccessDenied BucketMetadataErrorCode = "ACCESS_DENIED" +) + +// Values returns all known values for BucketMetadataErrorCode. 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 (BucketMetadataErrorCode) Values() []BucketMetadataErrorCode { + return []BucketMetadataErrorCode{ + "ACCESS_DENIED", + } +} + type Currency string // Enum values for Currency diff --git a/service/macie2/types/types.go b/service/macie2/types/types.go index ea73fd74c60..e4d54bfd2b8 100644 --- a/service/macie2/types/types.go +++ b/service/macie2/types/types.go @@ -221,10 +221,9 @@ type BucketCountByEffectivePermission struct { // in the Amazon Simple Storage Service User Guide. type BucketCountByEncryptionType struct { - // The total number of buckets that use an Key Management Service (KMS) customer - // master key (CMK) to encrypt new objects by default. These buckets use Amazon Web - // Services managed KMS encryption (AWS-KMS) or customer managed KMS encryption - // (SSE-KMS) by default. + // The total number of buckets that use an KMS key to encrypt new objects by + // default, either an Amazon Web Services managed key or a customer managed key. + // These buckets use KMS encryption (SSE-KMS) by default. KmsManaged int64 // The total number of buckets that use an Amazon S3 managed key to encrypt new @@ -299,7 +298,7 @@ type BucketCountPolicyAllowsUnencryptedObjectUploads struct { type BucketCriteriaAdditionalProperties struct { // The value for the property matches (equals) the specified value. If you specify - // multiple values, Macie uses OR logic to join the values. + // multiple values, Amazon Macie uses OR logic to join the values. Eq []string // The value for the property is greater than the specified value. @@ -342,7 +341,12 @@ type BucketLevelPermissions struct { noSmithyDocumentSerde } -// Provides information about an S3 bucket that Amazon Macie monitors and analyzes. +// Provides statistical data and other information about an S3 bucket that Amazon +// Macie monitors and analyzes for your account. If an error occurs when Macie +// attempts to retrieve and process information about the bucket or the bucket's +// objects, the value for most of these properties is null. Exceptions are +// accountId, bucketArn, bucketCreatedAt, bucketName, lastUpdated, and region. To +// identify the cause of the error, refer to the errorCode and errorMessage values. type BucketMetadata struct { // The unique identifier for the Amazon Web Services account that owns the bucket. @@ -390,6 +394,19 @@ type BucketMetadata struct { // size of all versions of each applicable object in the bucket. ClassifiableSizeInBytes int64 + // Specifies the error code for an error that prevented Amazon Macie from + // retrieving and processing information about the bucket and the bucket's objects. + // If this value is ACCESS_DENIED, Macie doesn't have permission to retrieve the + // information. For example, the bucket has a restrictive bucket policy and Amazon + // S3 denied the request. If this value is null, Macie was able to retrieve and + // process the information. + ErrorCode BucketMetadataErrorCode + + // A brief description of the error (errorCode) that prevented Amazon Macie from + // retrieving and processing information about the bucket and the bucket's objects. + // This value is null if Macie was able to retrieve and process the information. + ErrorMessage *string + // Specifies whether any one-time or recurring classification jobs are configured // to analyze data in the bucket, and, if so, the details of the job that ran most // recently. @@ -448,10 +465,10 @@ type BucketMetadata struct { SizeInBytes int64 // The total storage size, in bytes, of the objects that are compressed (.gz, - // .gzip, .zip) files in the bucket. If versioning is enabled for the bucket, Macie - // calculates this value based on the size of the latest version of each applicable - // object in the bucket. This value doesn't reflect the storage size of all - // versions of each applicable object in the bucket. + // .gzip, .zip) files in the bucket. If versioning is enabled for the bucket, + // Amazon Macie calculates this value based on the size of the latest version of + // each applicable object in the bucket. This value doesn't reflect the storage + // size of all versions of each applicable object in the bucket. SizeInBytesCompressed int64 // An array that specifies the tags (keys and values) that are associated with the @@ -532,26 +549,25 @@ type BucketPublicAccess struct { // in the Amazon Simple Storage Service User Guide. type BucketServerSideEncryption struct { - // The Amazon Resource Name (ARN) or unique identifier (key ID) for the Key - // Management Service (KMS) customer master key (CMK) that's used by default to - // encrypt objects that are added to the bucket. This value is null if the bucket - // uses an Amazon S3 managed key to encrypt new objects or the bucket doesn't - // encrypt new objects by default. + // The Amazon Resource Name (ARN) or unique identifier (key ID) for the KMS key + // that's used by default to encrypt objects that are added to the bucket. This + // value is null if the bucket uses an Amazon S3 managed key to encrypt new objects + // or the bucket doesn't encrypt new objects by default. KmsMasterKeyId *string // The type of server-side encryption that's used by default when storing new // objects in the bucket. Possible values are: // // * AES256 - New objects are - // encrypted with an Amazon S3 managed key and use Amazon S3 managed encryption - // (SSE-S3). + // encrypted with an Amazon S3 managed key. They use SSE-S3 encryption. // - // * aws:kms - New objects are encrypted with an KMS CMK, specified by - // the kmsMasterKeyId property, and use Amazon Web Services managed KMS encryption - // (AWS-KMS) or customer managed KMS encryption (SSE-KMS). + // * aws:kms + // - New objects are encrypted with an KMS key (kmsMasterKeyId), either an Amazon + // Web Services managed key or a customer managed key. They use SSE-KMS + // encryption. // - // * NONE - New objects - // aren't encrypted by default. Default encryption is disabled for the bucket. + // * NONE - New objects aren't encrypted by default. Default + // encryption is disabled for the bucket. Type Type noSmithyDocumentSerde @@ -1461,7 +1477,11 @@ type ManagedDataIdentifierSummary struct { } // Provides statistical data and other information about an S3 bucket that Amazon -// Macie monitors and analyzes. +// Macie monitors and analyzes for your account. If an error occurs when Macie +// attempts to retrieve and process information about the bucket or the bucket's +// objects, the value for most of these properties is null. Exceptions are +// accountId and bucketName. To identify the cause of the error, refer to the +// errorCode and errorMessage values. type MatchingBucket struct { // The unique identifier for the Amazon Web Services account that owns the bucket. @@ -1483,6 +1503,19 @@ type MatchingBucket struct { // size of all versions of each applicable object in the bucket. ClassifiableSizeInBytes int64 + // Specifies the error code for an error that prevented Amazon Macie from + // retrieving and processing information about the bucket and the bucket's objects. + // If this value is ACCESS_DENIED, Macie doesn't have permission to retrieve the + // information. For example, the bucket has a restrictive bucket policy and Amazon + // S3 denied the request. If this value is null, Macie was able to retrieve and + // process the information. + ErrorCode BucketMetadataErrorCode + + // A brief description of the error (errorCode) that prevented Amazon Macie from + // retrieving and processing information about the bucket and the bucket's objects. + // This value is null if Macie was able to retrieve and process the information. + ErrorMessage *string + // Specifies whether any one-time or recurring classification jobs are configured // to analyze objects in the bucket, and, if so, the details of the job that ran // most recently. @@ -1503,10 +1536,10 @@ type MatchingBucket struct { SizeInBytes int64 // The total storage size, in bytes, of the objects that are compressed (.gz, - // .gzip, .zip) files in the bucket. If versioning is enabled for the bucket, Macie - // calculates this value based on the size of the latest version of each applicable - // object in the bucket. This value doesn't reflect the storage size of all - // versions of each applicable object in the bucket. + // .gzip, .zip) files in the bucket. If versioning is enabled for the bucket, + // Amazon Macie calculates this value based on the size of the latest version of + // each applicable object in the bucket. This value doesn't reflect the storage + // size of all versions of each applicable object in the bucket. SizeInBytesCompressed int64 // The total number of objects that Amazon Macie can't analyze in the bucket. These @@ -1523,7 +1556,7 @@ type MatchingBucket struct { } // Provides statistical data and other information about an Amazon Web Services -// resource that Amazon Macie monitors and analyzes. +// resource that Amazon Macie monitors and analyzes for your account. type MatchingResource struct { // The details of an S3 bucket that Amazon Macie monitors and analyzes. @@ -1593,13 +1626,13 @@ type MonthlySchedule struct { // aren't encrypted. type ObjectCountByEncryptionType struct { - // The total number of objects that are encrypted with a customer-managed key. The + // The total number of objects that are encrypted with a customer-provided key. The // objects use customer-provided server-side encryption (SSE-C). CustomerManaged int64 - // The total number of objects that are encrypted with an Key Management Service - // (KMS) customer master key (CMK). The objects use Amazon Web Services managed KMS - // encryption (AWS-KMS) or customer managed KMS encryption (SSE-KMS). + // The total number of objects that are encrypted with an KMS key, either an Amazon + // Web Services managed key or a customer managed key. The objects use KMS + // encryption (SSE-KMS). KmsManaged int64 // The total number of objects that are encrypted with an Amazon S3 managed key. @@ -1620,10 +1653,10 @@ type ObjectCountByEncryptionType struct { // Provides information about the total storage size (in bytes) or number of // objects that Amazon Macie can't analyze in one or more S3 buckets. In a // BucketMetadata or MatchingBucket object, this data is for a specific bucket. In -// a GetBucketStatisticsResponse object, this data is aggregated for all the -// buckets in the query results. If versioning is enabled for a bucket, total -// storage size values are based on the size of the latest version of each -// applicable object in the bucket. +// a GetBucketStatisticsResponse object, this data is aggregated for the buckets in +// the query results. If versioning is enabled for a bucket, total storage size +// values are based on the size of the latest version of each applicable object in +// the bucket. type ObjectLevelStatistics struct { // The total storage size (in bytes) or number of objects that Amazon Macie can't @@ -1898,9 +1931,9 @@ type S3Destination struct { // This member is required. BucketName *string - // The Amazon Resource Name (ARN) of the Key Management Service (KMS) customer - // master key (CMK) to use for encryption of the results. This must be the ARN of - // an existing CMK that's in the same Amazon Web Services Region as the bucket. + // The Amazon Resource Name (ARN) of the KMS key to use for encryption of the + // results. This must be the ARN of an existing, symmetric, customer managed KMS + // key that's in the same Amazon Web Services Region as the bucket. // // This member is required. KmsKeyArn *string @@ -2188,9 +2221,9 @@ type ServerSideEncryption struct { // encrypted using server-side encryption, this value is NONE. EncryptionType EncryptionType - // The Amazon Resource Name (ARN) or unique identifier (key ID) for the Key - // Management Service (KMS) customer master key (CMK) that's used to encrypt data - // in the bucket or the object. If an KMS CMK isn't used, this value is null. + // The Amazon Resource Name (ARN) or unique identifier (key ID) for the KMS key + // that's used to encrypt data in the bucket or the object. This value is null if + // an KMS key isn't used to encrypt the data. KmsMasterKeyId *string noSmithyDocumentSerde diff --git a/service/networkfirewall/deserializers.go b/service/networkfirewall/deserializers.go index c1aead14322..a2cd9e6a5a3 100644 --- a/service/networkfirewall/deserializers.go +++ b/service/networkfirewall/deserializers.go @@ -1001,6 +1001,9 @@ func awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidResourcePolicyException", errorCode): + return awsAwsjson10_deserializeErrorInvalidResourcePolicyException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4526,6 +4529,16 @@ func awsAwsjson10_deserializeDocumentFirewallPolicy(v **types.FirewallPolicy, va for key, value := range shape { switch key { + case "StatefulDefaultActions": + if err := awsAwsjson10_deserializeDocumentStatefulActions(&sv.StatefulDefaultActions, value); err != nil { + return err + } + + case "StatefulEngineOptions": + if err := awsAwsjson10_deserializeDocumentStatefulEngineOptions(&sv.StatefulEngineOptions, value); err != nil { + return err + } + case "StatefulRuleGroupReferences": if err := awsAwsjson10_deserializeDocumentStatefulRuleGroupReferences(&sv.StatefulRuleGroupReferences, value); err != nil { return err @@ -4631,6 +4644,32 @@ func awsAwsjson10_deserializeDocumentFirewallPolicyResponse(v **types.FirewallPo for key, value := range shape { switch key { + case "ConsumedStatefulRuleCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RuleCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ConsumedStatefulRuleCapacity = ptr.Int32(int32(i64)) + } + + case "ConsumedStatelessRuleCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RuleCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ConsumedStatelessRuleCapacity = ptr.Int32(int32(i64)) + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -4676,6 +4715,19 @@ func awsAwsjson10_deserializeDocumentFirewallPolicyResponse(v **types.FirewallPo sv.FirewallPolicyStatus = types.ResourceStatus(jtv) } + case "NumberOfAssociations": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NumberOfAssociations to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfAssociations = ptr.Int32(int32(i64)) + } + case "Tags": if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err @@ -5951,6 +6003,11 @@ func awsAwsjson10_deserializeDocumentRuleGroup(v **types.RuleGroup, value interf return err } + case "StatefulRuleOptions": + if err := awsAwsjson10_deserializeDocumentStatefulRuleOptions(&sv.StatefulRuleOptions, value); err != nil { + return err + } + default: _, _ = key, value @@ -6044,6 +6101,19 @@ func awsAwsjson10_deserializeDocumentRuleGroupResponse(v **types.RuleGroupRespon sv.Capacity = ptr.Int32(int32(i64)) } + case "ConsumedCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RuleCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ConsumedCapacity = ptr.Int32(int32(i64)) + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -6053,6 +6123,19 @@ func awsAwsjson10_deserializeDocumentRuleGroupResponse(v **types.RuleGroupRespon sv.Description = ptr.String(jtv) } + case "NumberOfAssociations": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NumberOfAssociations to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfAssociations = ptr.Int32(int32(i64)) + } + case "RuleGroupArn": if value != nil { jtv, ok := value.(string) @@ -6443,6 +6526,82 @@ func awsAwsjson10_deserializeDocumentSettings(v *[]string, value interface{}) er return nil } +func awsAwsjson10_deserializeDocumentStatefulActions(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CollectionMember_String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStatefulEngineOptions(v **types.StatefulEngineOptions, 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.StatefulEngineOptions + if *v == nil { + sv = &types.StatefulEngineOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RuleOrder": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleOrder to be of type string, got %T instead", value) + } + sv.RuleOrder = types.RuleOrder(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentStatefulRule(v **types.StatefulRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6515,6 +6674,19 @@ func awsAwsjson10_deserializeDocumentStatefulRuleGroupReference(v **types.Statef for key, value := range shape { switch key { + case "Priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Priority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = int32(i64) + } + case "ResourceArn": if value != nil { jtv, ok := value.(string) @@ -6567,6 +6739,46 @@ func awsAwsjson10_deserializeDocumentStatefulRuleGroupReferences(v *[]types.Stat return nil } +func awsAwsjson10_deserializeDocumentStatefulRuleOptions(v **types.StatefulRuleOptions, 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.StatefulRuleOptions + if *v == nil { + sv = &types.StatefulRuleOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RuleOrder": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleOrder to be of type string, got %T instead", value) + } + sv.RuleOrder = types.RuleOrder(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentStatefulRules(v *[]types.StatefulRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/networkfirewall/doc.go b/service/networkfirewall/doc.go index 49505dd9d30..940893e4ead 100644 --- a/service/networkfirewall/doc.go +++ b/service/networkfirewall/doc.go @@ -29,50 +29,51 @@ // Firewall, you can filter traffic at the perimeter of your VPC. This includes // filtering traffic going to and coming from an internet gateway, NAT gateway, or // over VPN or AWS Direct Connect. Network Firewall uses rules that are compatible -// with Suricata, a free, open source intrusion detection system (IDS) engine. For -// information about Suricata, see the Suricata website -// (https://suricata-ids.org/). You can use Network Firewall to monitor and protect -// your VPC traffic in a number of ways. The following are just a few examples: +// with Suricata, a free, open source intrusion detection system (IDS) engine. AWS +// Network Firewall supports Suricata version 5.0.2. For information about +// Suricata, see the Suricata website (https://suricata-ids.org/). You can use +// Network Firewall to monitor and protect your VPC traffic in a number of ways. +// The following are just a few examples: // -// * -// Allow domains or IP addresses for known AWS service endpoints, such as Amazon -// S3, and block all other forms of traffic. +// * Allow domains or IP addresses for +// known AWS service endpoints, such as Amazon S3, and block all other forms of +// traffic. // -// * Use custom lists of known bad -// domains to limit the types of domain names that your applications can access. +// * Use custom lists of known bad domains to limit the types of domain +// names that your applications can access. // -// * -// Perform deep packet inspection on traffic entering or leaving your VPC. +// * Perform deep packet inspection on +// traffic entering or leaving your VPC. // -// * Use -// stateful protocol detection to filter protocols like HTTPS, regardless of the -// port used. +// * Use stateful protocol detection to +// filter protocols like HTTPS, regardless of the port used. // -// To enable Network Firewall for your VPCs, you perform steps in both -// Amazon VPC and in Network Firewall. For information about using Amazon VPC, see -// Amazon VPC User Guide (https://docs.aws.amazon.com/vpc/latest/userguide/). To -// start using Network Firewall, do the following: +// To enable Network +// Firewall for your VPCs, you perform steps in both Amazon VPC and in Network +// Firewall. For information about using Amazon VPC, see Amazon VPC User Guide +// (https://docs.aws.amazon.com/vpc/latest/userguide/). To start using Network +// Firewall, do the following: // -// * (Optional) If you don't -// already have a VPC that you want to protect, create it in Amazon VPC. +// * (Optional) If you don't already have a VPC that +// you want to protect, create it in Amazon VPC. // -// * In -// Amazon VPC, in each Availability Zone where you want to have a firewall -// endpoint, create a subnet for the sole use of Network Firewall. +// * In Amazon VPC, in each +// Availability Zone where you want to have a firewall endpoint, create a subnet +// for the sole use of Network Firewall. // -// * In Network -// Firewall, create stateless and stateful rule groups, to define the components of -// the network traffic filtering behavior that you want your firewall to have. -// -// * -// In Network Firewall, create a firewall policy that uses your rule groups and -// specifies additional default traffic filtering behavior. +// * In Network Firewall, create stateless +// and stateful rule groups, to define the components of the network traffic +// filtering behavior that you want your firewall to have. // // * In Network Firewall, -// create a firewall and specify your new firewall policy and VPC subnets. Network -// Firewall creates a firewall endpoint in each subnet that you specify, with the -// behavior that's defined in the firewall policy. +// create a firewall policy that uses your rule groups and specifies additional +// default traffic filtering behavior. +// +// * In Network Firewall, create a firewall +// and specify your new firewall policy and VPC subnets. Network Firewall creates a +// firewall endpoint in each subnet that you specify, with the behavior that's +// defined in the firewall policy. // -// * In Amazon VPC, use ingress -// routing enhancements to route traffic through the new firewall endpoints. +// * In Amazon VPC, use ingress routing +// enhancements to route traffic through the new firewall endpoints. package networkfirewall diff --git a/service/networkfirewall/serializers.go b/service/networkfirewall/serializers.go index aede3c822fa..c20ea9bdc2a 100644 --- a/service/networkfirewall/serializers.go +++ b/service/networkfirewall/serializers.go @@ -1487,6 +1487,20 @@ func awsAwsjson10_serializeDocumentFirewallPolicy(v *types.FirewallPolicy, value object := value.Object() defer object.Close() + if v.StatefulDefaultActions != nil { + ok := object.Key("StatefulDefaultActions") + if err := awsAwsjson10_serializeDocumentStatefulActions(v.StatefulDefaultActions, ok); err != nil { + return err + } + } + + if v.StatefulEngineOptions != nil { + ok := object.Key("StatefulEngineOptions") + if err := awsAwsjson10_serializeDocumentStatefulEngineOptions(v.StatefulEngineOptions, ok); err != nil { + return err + } + } + if v.StatefulRuleGroupReferences != nil { ok := object.Key("StatefulRuleGroupReferences") if err := awsAwsjson10_serializeDocumentStatefulRuleGroupReferences(v.StatefulRuleGroupReferences, ok); err != nil { @@ -1834,6 +1848,13 @@ func awsAwsjson10_serializeDocumentRuleGroup(v *types.RuleGroup, value smithyjso } } + if v.StatefulRuleOptions != nil { + ok := object.Key("StatefulRuleOptions") + if err := awsAwsjson10_serializeDocumentStatefulRuleOptions(v.StatefulRuleOptions, ok); err != nil { + return err + } + } + return nil } @@ -1971,6 +1992,29 @@ func awsAwsjson10_serializeDocumentSettings(v []string, value smithyjson.Value) return nil } +func awsAwsjson10_serializeDocumentStatefulActions(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 awsAwsjson10_serializeDocumentStatefulEngineOptions(v *types.StatefulEngineOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.RuleOrder) > 0 { + ok := object.Key("RuleOrder") + ok.String(string(v.RuleOrder)) + } + + return nil +} + func awsAwsjson10_serializeDocumentStatefulRule(v *types.StatefulRule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2001,6 +2045,11 @@ func awsAwsjson10_serializeDocumentStatefulRuleGroupReference(v *types.StatefulR object := value.Object() defer object.Close() + if v.Priority != 0 { + ok := object.Key("Priority") + ok.Integer(v.Priority) + } + if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) @@ -2022,6 +2071,18 @@ func awsAwsjson10_serializeDocumentStatefulRuleGroupReferences(v []types.Statefu return nil } +func awsAwsjson10_serializeDocumentStatefulRuleOptions(v *types.StatefulRuleOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.RuleOrder) > 0 { + ok := object.Key("RuleOrder") + ok.String(string(v.RuleOrder)) + } + + return nil +} + func awsAwsjson10_serializeDocumentStatefulRules(v []types.StatefulRule, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/networkfirewall/types/enums.go b/service/networkfirewall/types/enums.go index f947617f91d..c419a4aefbc 100644 --- a/service/networkfirewall/types/enums.go +++ b/service/networkfirewall/types/enums.go @@ -172,6 +172,24 @@ func (RuleGroupType) Values() []RuleGroupType { } } +type RuleOrder string + +// Enum values for RuleOrder +const ( + RuleOrderDefaultActionOrder RuleOrder = "DEFAULT_ACTION_ORDER" + RuleOrderStrictOrder RuleOrder = "STRICT_ORDER" +) + +// Values returns all known values for RuleOrder. 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 (RuleOrder) Values() []RuleOrder { + return []RuleOrder{ + "DEFAULT_ACTION_ORDER", + "STRICT_ORDER", + } +} + type StatefulAction string // Enum values for StatefulAction diff --git a/service/networkfirewall/types/errors.go b/service/networkfirewall/types/errors.go index 09ef9593ffd..4156635b443 100644 --- a/service/networkfirewall/types/errors.go +++ b/service/networkfirewall/types/errors.go @@ -96,7 +96,7 @@ func (e *InvalidRequestException) ErrorMessage() string { func (e *InvalidRequestException) ErrorCode() string { return "InvalidRequestException" } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// +// The policy statement failed validation. type InvalidResourcePolicyException struct { Message *string @@ -193,7 +193,7 @@ func (e *ResourceNotFoundException) ErrorMessage() string { func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// +// Unable to change the resource because your account doesn't own it. type ResourceOwnerCheckException struct { Message *string diff --git a/service/networkfirewall/types/types.go b/service/networkfirewall/types/types.go index b03a89d4b2b..f900202b5f5 100644 --- a/service/networkfirewall/types/types.go +++ b/service/networkfirewall/types/types.go @@ -236,8 +236,16 @@ type FirewallPolicy struct { // This member is required. StatelessFragmentDefaultActions []string - // References to the stateless rule groups that are used in the policy. These - // define the inspection criteria in stateful rules. + // The default actions to take on a packet that doesn't match any stateful rules. + StatefulDefaultActions []string + + // Additional options governing how Network Firewall handles stateful rules. The + // stateful rule groups that you use in your policy must have stateful rule options + // settings that are compatible with these settings. + StatefulEngineOptions *StatefulEngineOptions + + // References to the stateful rule groups that are used in the policy. These define + // the inspection criteria in stateful rules. StatefulRuleGroupReferences []StatefulRuleGroupReference // The custom action definitions that are available for use in the firewall @@ -291,6 +299,12 @@ type FirewallPolicyResponse struct { // This member is required. FirewallPolicyName *string + // The number of capacity units currently consumed by the policy's stateful rules. + ConsumedStatefulRuleCapacity *int32 + + // The number of capacity units currently consumed by the policy's stateless rules. + ConsumedStatelessRuleCapacity *int32 + // A description of the firewall policy. Description *string @@ -299,6 +313,9 @@ type FirewallPolicyResponse struct { // name or ARN. FirewallPolicyStatus ResourceStatus + // The number of firewalls that are associated with this firewall policy. + NumberOfAssociations *int32 + // The key:value pairs to associate with the resource. Tags []Tag @@ -341,9 +358,9 @@ type FirewallStatus struct { noSmithyDocumentSerde } -// The 5-tuple criteria for AWS Network Firewall to use to inspect packet headers -// in stateful traffic flow inspection. Traffic flows that match the criteria are a -// match for the corresponding StatefulRule. +// The basic rule criteria for AWS Network Firewall to use to inspect packet +// headers in stateful traffic flow inspection. Traffic flows that match the +// criteria are a match for the corresponding StatefulRule. type Header struct { // The destination IP address or address range to inspect for, in CIDR notation. To @@ -366,7 +383,7 @@ type Header struct { Destination *string // The destination port to inspect for. You can specify an individual port, for - // example 1994 and you can specify a port range, for example 1990-1994. To match + // example 1994 and you can specify a port range, for example 1990:1994. To match // with any port, specify ANY. // // This member is required. @@ -406,7 +423,7 @@ type Header struct { Source *string // The source port to inspect for. You can specify an individual port, for example - // 1994 and you can specify a port range, for example 1990-1994. To match with any + // 1994 and you can specify a port range, for example 1990:1994. To match with any // port, specify ANY. // // This member is required. @@ -495,7 +512,7 @@ type MatchAttributes struct { // The destination ports to inspect for. If not specified, this matches with any // destination port. This setting is only used for protocols 6 (TCP) and 17 (UDP). // You can specify individual ports, for example 1994 and you can specify port - // ranges, for example 1990-1994. + // ranges, for example 1990:1994. DestinationPorts []PortRange // The destination IP addresses and address ranges to inspect for, in CIDR @@ -509,7 +526,7 @@ type MatchAttributes struct { // The source ports to inspect for. If not specified, this matches with any source // port. This setting is only used for protocols 6 (TCP) and 17 (UDP). You can // specify individual ports, for example 1994 and you can specify port ranges, for - // example 1990-1994. + // example 1990:1994. SourcePorts []PortRange // The source IP addresses and address ranges to inspect for, in CIDR notation. If @@ -651,6 +668,11 @@ type RuleGroup struct { // use these for stateful rule groups. RuleVariables *RuleVariables + // Additional options governing how Network Firewall handles stateful rules. The + // policies where you use your stateful rule group must have stateful rule options + // settings that are compatible with these settings. + StatefulRuleOptions *StatefulRuleOptions + noSmithyDocumentSerde } @@ -700,9 +722,15 @@ type RuleGroupResponse struct { // group by calling CreateRuleGroup with DryRun set to TRUE. Capacity *int32 + // The number of capacity units currently consumed by the rule group rules. + ConsumedCapacity *int32 + // A description of the rule group. Description *string + // The number of firewall policies that use this rule group. + NumberOfAssociations *int32 + // Detailed information about the current status of a rule group. RuleGroupStatus ResourceStatus @@ -748,8 +776,11 @@ type RulesSource struct { // setting. RulesString *string - // The 5-tuple stateful inspection criteria. This contains an array of individual - // 5-tuple stateful rules to be used together in a stateful rule group. + // An array of individual stateful rules inspection criteria to be used together in + // a stateful rule group. Use this option to specify simple Suricata rules with + // protocol, source and destination, ports, direction, and rule options. For + // information about the Suricata Rules format, see Rules Format + // (https://suricata.readthedocs.io/en/suricata-5.0.0/rules/intro.html#). StatefulRules []StatefulRule // Stateless inspection criteria to be used in a stateless rule group. @@ -767,7 +798,7 @@ type RulesSource struct { // CIDR ranges. For more information, see RuleVariables in this guide and Stateful // domain list rule groups in AWS Network Firewall // (https://docs.aws.amazon.com/network-firewall/latest/developerguide/stateful-rule-groups-domain-names.html) -// in the Network Firewall Developer Guide +// in the Network Firewall Developer Guide. type RulesSourceList struct { // Whether you want to allow or deny access to the domains in your target list. @@ -775,7 +806,7 @@ type RulesSourceList struct { // This member is required. GeneratedRulesType GeneratedRulesType - // The protocols you want to inspect. Specify TLS_SNI for HTTPS. Specity HTTP_HOST + // The protocols you want to inspect. Specify TLS_SNI for HTTPS. Specify HTTP_HOST // for HTTP. You can specify either or both. // // This member is required. @@ -811,7 +842,27 @@ type RuleVariables struct { noSmithyDocumentSerde } -// A single 5-tuple stateful rule, for use in a stateful rule group. +// Configuration settings for the handling of the stateful rule groups in a +// firewall policy. +type StatefulEngineOptions struct { + + // Indicates how to manage the order of stateful rule evaluation for the policy. By + // default, Network Firewall leaves the rule evaluation order up to the Suricata + // rule processing engine. If you set this to STRICT_ORDER, your rules are + // evaluated in the exact order that you provide them in the policy. With strict + // ordering, the rule groups are evaluated by order of priority, starting from the + // lowest number, and the rules in each rule group are processed in the order that + // they're defined. + RuleOrder RuleOrder + + noSmithyDocumentSerde +} + +// A single Suricata rules specification, for use in a stateful rule group. Use +// this option to specify a simple Suricata rule with protocol, source and +// destination, ports, direction, and rule options. For information about the +// Suricata Rules format, see Rules Format +// (https://suricata.readthedocs.io/en/suricata-5.0.0/rules/intro.html#). type StatefulRule struct { // Defines what Network Firewall should do with the packets in a traffic flow when @@ -836,13 +887,12 @@ type StatefulRule struct { // This member is required. Action StatefulAction - // The stateful 5-tuple inspection criteria for this rule, used to inspect traffic - // flows. + // The stateful inspection criteria for this rule, used to inspect traffic flows. // // This member is required. Header *Header - // + // Additional options for the rule. These are the Suricata RuleOptions settings. // // This member is required. RuleOptions []RuleOption @@ -859,23 +909,47 @@ type StatefulRuleGroupReference struct { // This member is required. ResourceArn *string + // An integer setting that indicates the order in which to run the stateful rule + // groups in a single FirewallPolicy. This setting only applies to firewall + // policies that specify the STRICT_ORDER rule order in the stateful engine options + // settings. Network Firewall evalutes each stateful rule group against a packet + // starting with the group that has the lowest priority setting. You must ensure + // that the priority settings are unique within each policy. You can change the + // priority settings of your rule groups at any time. To make it easier to insert + // rule groups later, number them so there's a wide range in between, for example + // use 100, 200, and so on. + Priority int32 + + noSmithyDocumentSerde +} + +// Additional options governing how Network Firewall handles the rule group. You +// can only use these for stateful rule groups. +type StatefulRuleOptions struct { + + // Indicates how to manage the order of the rule evaluation for the rule group. By + // default, Network Firewall leaves the rule evaluation order up to the Suricata + // rule processing engine. If you set this to STRICT_ORDER, your rules are + // evaluated in the exact order that they're listed in your Suricata rules string. + RuleOrder RuleOrder + noSmithyDocumentSerde } // A single stateless rule. This is used in StatelessRulesAndCustomActions. type StatelessRule struct { - // A setting that indicates the order in which to run this rule relative to all of - // the rules that are defined for a stateless rule group. Network Firewall - // evaluates the rules in a rule group starting with the lowest priority setting. - // You must ensure that the priority settings are unique for the rule group. Each - // stateless rule group uses exactly one StatelessRulesAndCustomActions object, and - // each StatelessRulesAndCustomActions contains exactly one StatelessRules object. - // To ensure unique priority settings for your rule groups, set unique priorities - // for the stateless rules that you define inside any single StatelessRules object. - // You can change the priority settings of your rules at any time. To make it - // easier to insert rules later, number them so there's a wide range in between, - // for example use 100, 200, and so on. + // Indicates the order in which to run this rule relative to all of the rules that + // are defined for a stateless rule group. Network Firewall evaluates the rules in + // a rule group starting with the lowest priority setting. You must ensure that the + // priority settings are unique for the rule group. Each stateless rule group uses + // exactly one StatelessRulesAndCustomActions object, and each + // StatelessRulesAndCustomActions contains exactly one StatelessRules object. To + // ensure unique priority settings for your rule groups, set unique priorities for + // the stateless rules that you define inside any single StatelessRules object. You + // can change the priority settings of your rules at any time. To make it easier to + // insert rules later, number them so there's a wide range in between, for example + // use 100, 200, and so on. // // This member is required. Priority int32 diff --git a/service/pinpoint/deserializers.go b/service/pinpoint/deserializers.go index e2424669280..9bfe7397949 100644 --- a/service/pinpoint/deserializers.go +++ b/service/pinpoint/deserializers.go @@ -19474,6 +19474,11 @@ func awsRestjson1_deserializeDocumentActivity(v **types.Activity, value interfac return err } + case "ContactCenter": + if err := awsRestjson1_deserializeDocumentContactCenterActivity(&sv.ContactCenter, value); err != nil { + return err + } + case "CUSTOM": if err := awsRestjson1_deserializeDocumentCustomMessageActivity(&sv.CUSTOM, value); err != nil { return err @@ -22348,6 +22353,46 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsRestjson1_deserializeDocumentContactCenterActivity(v **types.ContactCenterActivity, 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.ContactCenterActivity + if *v == nil { + sv = &types.ContactCenterActivity{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextActivity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.NextActivity = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentCreateTemplateMessageBody(v **types.CreateTemplateMessageBody, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -25716,6 +25761,55 @@ func awsRestjson1_deserializeDocumentItemResponse(v **types.ItemResponse, value return nil } +func awsRestjson1_deserializeDocumentJourneyChannelSettings(v **types.JourneyChannelSettings, 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.JourneyChannelSettings + if *v == nil { + sv = &types.JourneyChannelSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConnectCampaignArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ConnectCampaignArn = ptr.String(jtv) + } + + case "ConnectCampaignExecutionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ConnectCampaignExecutionRoleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentJourneyCustomMessage(v **types.JourneyCustomMessage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -26211,6 +26305,11 @@ func awsRestjson1_deserializeDocumentJourneyResponse(v **types.JourneyResponse, sv.Id = ptr.String(jtv) } + case "JourneyChannelSettings": + if err := awsRestjson1_deserializeDocumentJourneyChannelSettings(&sv.JourneyChannelSettings, value); err != nil { + return err + } + case "LastModifiedDate": if value != nil { jtv, ok := value.(string) diff --git a/service/pinpoint/serializers.go b/service/pinpoint/serializers.go index 532c40eb34d..2db014c4082 100644 --- a/service/pinpoint/serializers.go +++ b/service/pinpoint/serializers.go @@ -8004,6 +8004,13 @@ func awsRestjson1_serializeDocumentActivity(v *types.Activity, value smithyjson. } } + if v.ContactCenter != nil { + ok := object.Key("ContactCenter") + if err := awsRestjson1_serializeDocumentContactCenterActivity(v.ContactCenter, ok); err != nil { + return err + } + } + if v.CUSTOM != nil { ok := object.Key("CUSTOM") if err := awsRestjson1_serializeDocumentCustomMessageActivity(v.CUSTOM, ok); err != nil { @@ -8957,6 +8964,18 @@ func awsRestjson1_serializeDocumentConditionalSplitActivity(v *types.Conditional return nil } +func awsRestjson1_serializeDocumentContactCenterActivity(v *types.ContactCenterActivity, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NextActivity != nil { + ok := object.Key("NextActivity") + ok.String(*v.NextActivity) + } + + return nil +} + func awsRestjson1_serializeDocumentCreateApplicationRequest(v *types.CreateApplicationRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/pinpoint/types/types.go b/service/pinpoint/types/types.go index 2ab93c0ab98..4c21dbacb6f 100644 --- a/service/pinpoint/types/types.go +++ b/service/pinpoint/types/types.go @@ -34,6 +34,10 @@ type Activity struct { // specify. ConditionalSplit *ConditionalSplitActivity + // The settings for a connect activity. This type of activity initiates a contact + // center call to participants. + ContactCenter *ContactCenterActivity + // The custom description of the activity. Description *string @@ -1744,6 +1748,14 @@ type ConditionalSplitActivity struct { noSmithyDocumentSerde } +type ContactCenterActivity struct { + + // The unique identifier for the next activity to perform after the this activity. + NextActivity *string + + noSmithyDocumentSerde +} + // Specifies the display name of an application and the tags to associate with the // application. type CreateApplicationRequest struct { @@ -3837,6 +3849,19 @@ type ItemResponse struct { noSmithyDocumentSerde } +// The channel-specific configurations for the journey. +type JourneyChannelSettings struct { + + // Amazon Resource Name (ARN) of the Connect Campaign. + ConnectCampaignArn *string + + // IAM role ARN to be assumed when invoking Connect campaign execution APIs for + // dialing. + ConnectCampaignExecutionRoleArn *string + + noSmithyDocumentSerde +} + // Specifies the message content for a custom channel message that's sent to // participants in a journey. type JourneyCustomMessage struct { @@ -4070,6 +4095,9 @@ type JourneyResponse struct { // The date, in ISO 8601 format, when the journey was created. CreationDate *string + // The channel-specific configurations for the journey. + JourneyChannelSettings *JourneyChannelSettings + // The date, in ISO 8601 format, when the journey was last modified. LastModifiedDate *string diff --git a/service/sesv2/api_op_CreateConfigurationSet.go b/service/sesv2/api_op_CreateConfigurationSet.go index ac85e0a6589..7acaf1bff93 100644 --- a/service/sesv2/api_op_CreateConfigurationSet.go +++ b/service/sesv2/api_op_CreateConfigurationSet.go @@ -34,7 +34,8 @@ func (c *Client) CreateConfigurationSet(ctx context.Context, params *CreateConfi // A request to create a configuration set. type CreateConfigurationSetInput struct { - // The name of the configuration set. + // The name of the configuration set. The name can contain up to 64 alphanumeric + // characters, including letters, numbers, hyphens (-) and underscores (_) only. // // This member is required. ConfigurationSetName *string @@ -55,8 +56,8 @@ type CreateConfigurationSetInput struct { // your account. SuppressionOptions *types.SuppressionOptions - // An array of objects that define the tags (keys and values) that you want to - // associate with the configuration set. + // An array of objects that define the tags (keys and values) to associate with the + // configuration set. Tags []types.Tag // An object that defines the open and click tracking options for emails that you diff --git a/service/sesv2/api_op_CreateConfigurationSetEventDestination.go b/service/sesv2/api_op_CreateConfigurationSetEventDestination.go index 87428e8d119..0733bcc18cf 100644 --- a/service/sesv2/api_op_CreateConfigurationSetEventDestination.go +++ b/service/sesv2/api_op_CreateConfigurationSetEventDestination.go @@ -36,7 +36,7 @@ func (c *Client) CreateConfigurationSetEventDestination(ctx context.Context, par // A request to add an event destination to a configuration set. type CreateConfigurationSetEventDestinationInput struct { - // The name of the configuration set that you want to add an event destination to. + // The name of the configuration set . // // This member is required. ConfigurationSetName *string diff --git a/service/sesv2/api_op_CreateDedicatedIpPool.go b/service/sesv2/api_op_CreateDedicatedIpPool.go index 2dae221b355..8e7468f8cce 100644 --- a/service/sesv2/api_op_CreateDedicatedIpPool.go +++ b/service/sesv2/api_op_CreateDedicatedIpPool.go @@ -12,10 +12,10 @@ import ( ) // Create a new pool of dedicated IP addresses. A pool can include one or more -// dedicated IP addresses that are associated with your AWS account. You can -// associate a pool with a configuration set. When you send an email that uses that -// configuration set, the message is sent from one of the addresses in the -// associated pool. +// dedicated IP addresses that are associated with your Amazon Web Services +// account. You can associate a pool with a configuration set. When you send an +// email that uses that configuration set, the message is sent from one of the +// addresses in the associated pool. func (c *Client) CreateDedicatedIpPool(ctx context.Context, params *CreateDedicatedIpPoolInput, optFns ...func(*Options)) (*CreateDedicatedIpPoolOutput, error) { if params == nil { params = &CreateDedicatedIpPoolInput{} diff --git a/service/sesv2/api_op_CreateEmailIdentity.go b/service/sesv2/api_op_CreateEmailIdentity.go index 0e50a6f4883..d6a48e8bc88 100644 --- a/service/sesv2/api_op_CreateEmailIdentity.go +++ b/service/sesv2/api_op_CreateEmailIdentity.go @@ -29,12 +29,12 @@ import ( // DKIM (BYODKIM). To use BYODKIM, your call to the CreateEmailIdentity operation // has to include the DkimSigningAttributes object. When you specify this object, // you provide a selector (a component of the DNS record name that identifies the -// public key that you want to use for DKIM authentication) and a private key. When -// you verify a domain, this operation provides a set of DKIM tokens, which you can -// convert into CNAME tokens. You add these CNAME tokens to the DNS configuration -// for your domain. Your domain is verified when Amazon SES detects these records -// in the DNS configuration for your domain. For some DNS providers, it can take 72 -// hours or more to complete the domain verification process. Additionally, you can +// public key to use for DKIM authentication) and a private key. When you verify a +// domain, this operation provides a set of DKIM tokens, which you can convert into +// CNAME tokens. You add these CNAME tokens to the DNS configuration for your +// domain. Your domain is verified when Amazon SES detects these records in the DNS +// configuration for your domain. For some DNS providers, it can take 72 hours or +// more to complete the domain verification process. Additionally, you can // associate an existing configuration set with the email identity that you're // verifying. func (c *Client) CreateEmailIdentity(ctx context.Context, params *CreateEmailIdentityInput, optFns ...func(*Options)) (*CreateEmailIdentityOutput, error) { @@ -56,7 +56,7 @@ func (c *Client) CreateEmailIdentity(ctx context.Context, params *CreateEmailIde // address or domain). type CreateEmailIdentityInput struct { - // The email address or domain that you want to verify. + // The email address or domain to verify. // // This member is required. EmailIdentity *string @@ -67,15 +67,15 @@ type CreateEmailIdentityInput struct { ConfigurationSetName *string // If your request includes this object, Amazon SES configures the identity to use - // Bring Your Own DKIM (BYODKIM) for DKIM authentication purposes, as opposed to - // the default method, Easy DKIM + // Bring Your Own DKIM (BYODKIM) for DKIM authentication purposes, or, configures + // the key length to be used for Easy DKIM // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html). You can // only specify this object if the email identity is a domain, as opposed to an // address. DkimSigningAttributes *types.DkimSigningAttributes - // An array of objects that define the tags (keys and values) that you want to - // associate with the email identity. + // An array of objects that define the tags (keys and values) to associate with the + // email identity. Tags []types.Tag noSmithyDocumentSerde @@ -89,7 +89,8 @@ type CreateEmailIdentityOutput struct { // An object that contains information about the DKIM attributes for the identity. DkimAttributes *types.DkimAttributes - // The email identity type. + // The email identity type. Note: the MANAGED_DOMAIN identity type is not + // supported. IdentityType types.IdentityType // Specifies whether or not the identity is verified. You can only send email from diff --git a/service/sesv2/api_op_CreateEmailIdentityPolicy.go b/service/sesv2/api_op_CreateEmailIdentityPolicy.go index 8773b0263cf..a74bb98c4ad 100644 --- a/service/sesv2/api_op_CreateEmailIdentityPolicy.go +++ b/service/sesv2/api_op_CreateEmailIdentityPolicy.go @@ -40,7 +40,7 @@ func (c *Client) CreateEmailIdentityPolicy(ctx context.Context, params *CreateEm // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-identity-owner-tasks-management.html). type CreateEmailIdentityPolicyInput struct { - // The email identity for which you want to create a policy. + // The email identity. // // This member is required. EmailIdentity *string diff --git a/service/sesv2/api_op_CreateEmailTemplate.go b/service/sesv2/api_op_CreateEmailTemplate.go index 63fc9afabb9..a8139a8f503 100644 --- a/service/sesv2/api_op_CreateEmailTemplate.go +++ b/service/sesv2/api_op_CreateEmailTemplate.go @@ -42,7 +42,7 @@ type CreateEmailTemplateInput struct { // This member is required. TemplateContent *types.EmailTemplateContent - // The name of the template you want to create. + // The name of the template. // // This member is required. TemplateName *string diff --git a/service/sesv2/api_op_DeleteConfigurationSet.go b/service/sesv2/api_op_DeleteConfigurationSet.go index c5863ab8f5a..6e36073eb4e 100644 --- a/service/sesv2/api_op_DeleteConfigurationSet.go +++ b/service/sesv2/api_op_DeleteConfigurationSet.go @@ -33,7 +33,7 @@ func (c *Client) DeleteConfigurationSet(ctx context.Context, params *DeleteConfi // A request to delete a configuration set. type DeleteConfigurationSetInput struct { - // The name of the configuration set that you want to delete. + // The name of the configuration set. // // This member is required. ConfigurationSetName *string diff --git a/service/sesv2/api_op_DeleteConfigurationSetEventDestination.go b/service/sesv2/api_op_DeleteConfigurationSetEventDestination.go index e4e20bd2038..d9d03d0c65a 100644 --- a/service/sesv2/api_op_DeleteConfigurationSetEventDestination.go +++ b/service/sesv2/api_op_DeleteConfigurationSetEventDestination.go @@ -34,13 +34,12 @@ func (c *Client) DeleteConfigurationSetEventDestination(ctx context.Context, par // A request to delete an event destination from a configuration set. type DeleteConfigurationSetEventDestinationInput struct { - // The name of the configuration set that contains the event destination that you - // want to delete. + // The name of the configuration set that contains the event destination to delete. // // This member is required. ConfigurationSetName *string - // The name of the event destination that you want to delete. + // The name of the event destination to delete. // // This member is required. EventDestinationName *string diff --git a/service/sesv2/api_op_DeleteCustomVerificationEmailTemplate.go b/service/sesv2/api_op_DeleteCustomVerificationEmailTemplate.go index cb645448129..69719a97c89 100644 --- a/service/sesv2/api_op_DeleteCustomVerificationEmailTemplate.go +++ b/service/sesv2/api_op_DeleteCustomVerificationEmailTemplate.go @@ -13,7 +13,7 @@ import ( // Deletes an existing custom verification email template. For more information // about custom verification email templates, see Using Custom Verification Email // Templates -// (https://docs.aws.amazon.com/es/latest/DeveloperGuide/send-email-verify-address-custom.html) +// (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-verify-address-custom.html) // in the Amazon SES Developer Guide. You can execute this operation no more than // once per second. func (c *Client) DeleteCustomVerificationEmailTemplate(ctx context.Context, params *DeleteCustomVerificationEmailTemplateInput, optFns ...func(*Options)) (*DeleteCustomVerificationEmailTemplateOutput, error) { diff --git a/service/sesv2/api_op_DeleteEmailIdentity.go b/service/sesv2/api_op_DeleteEmailIdentity.go index 95dabaadaaa..5d535631954 100644 --- a/service/sesv2/api_op_DeleteEmailIdentity.go +++ b/service/sesv2/api_op_DeleteEmailIdentity.go @@ -32,7 +32,7 @@ func (c *Client) DeleteEmailIdentity(ctx context.Context, params *DeleteEmailIde // to send email by completing the verification process for the identity again. type DeleteEmailIdentityInput struct { - // The identity (that is, the email address or domain) that you want to delete. + // The identity (that is, the email address or domain) to delete. // // This member is required. EmailIdentity *string diff --git a/service/sesv2/api_op_DeleteEmailIdentityPolicy.go b/service/sesv2/api_op_DeleteEmailIdentityPolicy.go index bbfd6d09822..85ba260daa3 100644 --- a/service/sesv2/api_op_DeleteEmailIdentityPolicy.go +++ b/service/sesv2/api_op_DeleteEmailIdentityPolicy.go @@ -41,7 +41,7 @@ func (c *Client) DeleteEmailIdentityPolicy(ctx context.Context, params *DeleteEm // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-identity-owner-tasks-management.html). type DeleteEmailIdentityPolicyInput struct { - // The email identity for which you want to delete a policy. + // The email identity. // // This member is required. EmailIdentity *string diff --git a/service/sesv2/api_op_GetAccount.go b/service/sesv2/api_op_GetAccount.go index f1994212988..89038905609 100644 --- a/service/sesv2/api_op_GetAccount.go +++ b/service/sesv2/api_op_GetAccount.go @@ -12,7 +12,7 @@ import ( ) // Obtain information about the email-sending status and capabilities of your -// Amazon SES account in the current AWS Region. +// Amazon SES account in the current Amazon Web Services Region. func (c *Client) GetAccount(ctx context.Context, params *GetAccountInput, optFns ...func(*Options)) (*GetAccountOutput, error) { if params == nil { params = &GetAccountInput{} @@ -35,7 +35,7 @@ type GetAccountInput struct { } // A list of details about the email-sending capabilities of your Amazon SES -// account in the current AWS Region. +// account in the current Amazon Web Services Region. type GetAccountOutput struct { // Indicates whether or not the automatic warm-up feature is enabled for dedicated @@ -61,27 +61,27 @@ type GetAccountOutput struct { // ability to send email is resumed. EnforcementStatus *string - // Indicates whether or not your account has production access in the current AWS - // Region. If the value is false, then your account is in the sandbox. When your - // account is in the sandbox, you can only send email to verified identities. - // Additionally, the maximum number of emails you can send in a 24-hour period - // (your sending quota) is 200, and the maximum number of emails you can send per - // second (your maximum sending rate) is 1. If the value is true, then your account - // has production access. When your account has production access, you can send - // email to any address. The sending quota and maximum sending rate for your - // account vary based on your specific use case. + // Indicates whether or not your account has production access in the current + // Amazon Web Services Region. If the value is false, then your account is in the + // sandbox. When your account is in the sandbox, you can only send email to + // verified identities. Additionally, the maximum number of emails you can send in + // a 24-hour period (your sending quota) is 200, and the maximum number of emails + // you can send per second (your maximum sending rate) is 1. If the value is true, + // then your account has production access. When your account has production + // access, you can send email to any address. The sending quota and maximum sending + // rate for your account vary based on your specific use case. ProductionAccessEnabled bool // An object that contains information about the per-day and per-second sending - // limits for your Amazon SES account in the current AWS Region. + // limits for your Amazon SES account in the current Amazon Web Services Region. SendQuota *types.SendQuota // Indicates whether or not email sending is enabled for your Amazon SES account in - // the current AWS Region. + // the current Amazon Web Services Region. SendingEnabled bool // An object that contains information about the email address suppression - // preferences for your account in the current AWS Region. + // preferences for your account in the current Amazon Web Services Region. SuppressionAttributes *types.SuppressionAttributes // Metadata pertaining to the operation's result. diff --git a/service/sesv2/api_op_GetConfigurationSet.go b/service/sesv2/api_op_GetConfigurationSet.go index 6515445a4c6..fe27a9b6286 100644 --- a/service/sesv2/api_op_GetConfigurationSet.go +++ b/service/sesv2/api_op_GetConfigurationSet.go @@ -36,8 +36,7 @@ func (c *Client) GetConfigurationSet(ctx context.Context, params *GetConfigurati // A request to obtain information about a configuration set. type GetConfigurationSetInput struct { - // The name of the configuration set that you want to obtain more information - // about. + // The name of the configuration set. // // This member is required. ConfigurationSetName *string diff --git a/service/sesv2/api_op_GetDedicatedIp.go b/service/sesv2/api_op_GetDedicatedIp.go index 55ab6d8fe7b..aad93bf17f4 100644 --- a/service/sesv2/api_op_GetDedicatedIp.go +++ b/service/sesv2/api_op_GetDedicatedIp.go @@ -33,8 +33,8 @@ func (c *Client) GetDedicatedIp(ctx context.Context, params *GetDedicatedIpInput type GetDedicatedIpInput struct { // The IP address that you want to obtain more information about. The value you - // specify has to be a dedicated IP address that's assocaited with your AWS - // account. + // specify has to be a dedicated IP address that's assocaited with your Amazon Web + // Services account. // // This member is required. Ip *string diff --git a/service/sesv2/api_op_GetDedicatedIps.go b/service/sesv2/api_op_GetDedicatedIps.go index a2aefdaa609..2f799ea3ff6 100644 --- a/service/sesv2/api_op_GetDedicatedIps.go +++ b/service/sesv2/api_op_GetDedicatedIps.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List the dedicated IP addresses that are associated with your AWS account. +// List the dedicated IP addresses that are associated with your Amazon Web +// Services account. func (c *Client) GetDedicatedIps(ctx context.Context, params *GetDedicatedIpsInput, optFns ...func(*Options)) (*GetDedicatedIpsOutput, error) { if params == nil { params = &GetDedicatedIpsInput{} @@ -47,11 +48,12 @@ type GetDedicatedIpsInput struct { noSmithyDocumentSerde } -// Information about the dedicated IP addresses that are associated with your AWS -// account. +// Information about the dedicated IP addresses that are associated with your +// Amazon Web Services account. type GetDedicatedIpsOutput struct { - // A list of dedicated IP addresses that are associated with your AWS account. + // A list of dedicated IP addresses that are associated with your Amazon Web + // Services account. DedicatedIps []types.DedicatedIp // A token that indicates that there are additional dedicated IP addresses to list. diff --git a/service/sesv2/api_op_GetDeliverabilityDashboardOptions.go b/service/sesv2/api_op_GetDeliverabilityDashboardOptions.go index e0a7ad16db8..4f1347218cc 100644 --- a/service/sesv2/api_op_GetDeliverabilityDashboardOptions.go +++ b/service/sesv2/api_op_GetDeliverabilityDashboardOptions.go @@ -18,8 +18,8 @@ import ( // send email. You also gain the ability to perform predictive inbox placement // tests. When you use the Deliverability dashboard, you pay a monthly subscription // charge, in addition to any other fees that you accrue by using Amazon SES and -// other AWS services. For more information about the features and cost of a -// Deliverability dashboard subscription, see Amazon SES Pricing +// other Amazon Web Services services. For more information about the features and +// cost of a Deliverability dashboard subscription, see Amazon SES Pricing // (http://aws.amazon.com/ses/pricing/). func (c *Client) GetDeliverabilityDashboardOptions(ctx context.Context, params *GetDeliverabilityDashboardOptionsInput, optFns ...func(*Options)) (*GetDeliverabilityDashboardOptionsOutput, error) { if params == nil { @@ -37,13 +37,13 @@ func (c *Client) GetDeliverabilityDashboardOptions(ctx context.Context, params * } // Retrieve information about the status of the Deliverability dashboard for your -// AWS account. When the Deliverability dashboard is enabled, you gain access to -// reputation, deliverability, and other metrics for your domains. You also gain -// the ability to perform predictive inbox placement tests. When you use the -// Deliverability dashboard, you pay a monthly subscription charge, in addition to -// any other fees that you accrue by using Amazon SES and other AWS services. For -// more information about the features and cost of a Deliverability dashboard -// subscription, see Amazon Pinpoint Pricing +// Amazon Web Services account. When the Deliverability dashboard is enabled, you +// gain access to reputation, deliverability, and other metrics for your domains. +// You also gain the ability to perform predictive inbox placement tests. When you +// use the Deliverability dashboard, you pay a monthly subscription charge, in +// addition to any other fees that you accrue by using Amazon SES and other Amazon +// Web Services services. For more information about the features and cost of a +// Deliverability dashboard subscription, see Amazon Pinpoint Pricing // (http://aws.amazon.com/pinpoint/pricing/). type GetDeliverabilityDashboardOptionsInput struct { noSmithyDocumentSerde diff --git a/service/sesv2/api_op_GetEmailIdentity.go b/service/sesv2/api_op_GetEmailIdentity.go index 4859353970b..8e60d2b8e03 100644 --- a/service/sesv2/api_op_GetEmailIdentity.go +++ b/service/sesv2/api_op_GetEmailIdentity.go @@ -32,7 +32,7 @@ func (c *Client) GetEmailIdentity(ctx context.Context, params *GetEmailIdentityI // A request to return details about an email identity. type GetEmailIdentityInput struct { - // The email identity that you want to retrieve details for. + // The email identity. // // This member is required. EmailIdentity *string @@ -59,7 +59,8 @@ type GetEmailIdentityOutput struct { // this setting is disabled). FeedbackForwardingStatus bool - // The email identity type. + // The email identity type. Note: the MANAGED_DOMAIN identity type is not + // supported. IdentityType types.IdentityType // An object that contains information about the Mail-From attributes for the email diff --git a/service/sesv2/api_op_GetEmailIdentityPolicies.go b/service/sesv2/api_op_GetEmailIdentityPolicies.go index a386ba3a7db..490f8a6d81d 100644 --- a/service/sesv2/api_op_GetEmailIdentityPolicies.go +++ b/service/sesv2/api_op_GetEmailIdentityPolicies.go @@ -37,7 +37,7 @@ func (c *Client) GetEmailIdentityPolicies(ctx context.Context, params *GetEmailI // A request to return the policies of an email identity. type GetEmailIdentityPoliciesInput struct { - // The email identity that you want to retrieve policies for. + // The email identity. // // This member is required. EmailIdentity *string diff --git a/service/sesv2/api_op_GetEmailTemplate.go b/service/sesv2/api_op_GetEmailTemplate.go index 2e7dfc27f06..b8ccd71f15d 100644 --- a/service/sesv2/api_op_GetEmailTemplate.go +++ b/service/sesv2/api_op_GetEmailTemplate.go @@ -33,7 +33,7 @@ func (c *Client) GetEmailTemplate(ctx context.Context, params *GetEmailTemplateI // line, HTML part and text part) for the template you specify. type GetEmailTemplateInput struct { - // The name of the template you want to retrieve. + // The name of the template. // // This member is required. TemplateName *string @@ -50,7 +50,7 @@ type GetEmailTemplateOutput struct { // This member is required. TemplateContent *types.EmailTemplateContent - // The name of the template you want to retrieve. + // The name of the template. // // This member is required. TemplateName *string diff --git a/service/sesv2/api_op_ListConfigurationSets.go b/service/sesv2/api_op_ListConfigurationSets.go index 5bfbf00bccd..100b6ea0480 100644 --- a/service/sesv2/api_op_ListConfigurationSets.go +++ b/service/sesv2/api_op_ListConfigurationSets.go @@ -33,7 +33,7 @@ func (c *Client) ListConfigurationSets(ctx context.Context, params *ListConfigur } // A request to obtain a list of configuration sets for your Amazon SES account in -// the current AWS Region. +// the current Amazon Web Services Region. type ListConfigurationSetsInput struct { // A token returned from a previous call to ListConfigurationSets to indicate the @@ -49,12 +49,12 @@ type ListConfigurationSetsInput struct { noSmithyDocumentSerde } -// A list of configuration sets in your Amazon SES account in the current AWS -// Region. +// A list of configuration sets in your Amazon SES account in the current Amazon +// Web Services Region. type ListConfigurationSetsOutput struct { // An array that contains all of the configuration sets in your Amazon SES account - // in the current AWS Region. + // in the current Amazon Web Services Region. ConfigurationSets []string // A token that indicates that there are additional configuration sets to list. To diff --git a/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go b/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go index 7a3ac640790..660b01f1cae 100644 --- a/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go +++ b/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go @@ -13,8 +13,8 @@ import ( ) // Lists the existing custom verification email templates for your account in the -// current AWS Region. For more information about custom verification email -// templates, see Using Custom Verification Email Templates +// current Amazon Web Services Region. For more information about custom +// verification email templates, see Using Custom Verification Email Templates // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-verify-address-custom.html) // in the Amazon SES Developer Guide. You can execute this operation no more than // once per second. diff --git a/service/sesv2/api_op_ListDedicatedIpPools.go b/service/sesv2/api_op_ListDedicatedIpPools.go index 482df61baee..e02a28084ab 100644 --- a/service/sesv2/api_op_ListDedicatedIpPools.go +++ b/service/sesv2/api_op_ListDedicatedIpPools.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List all of the dedicated IP pools that exist in your AWS account in the current -// Region. +// List all of the dedicated IP pools that exist in your Amazon Web Services +// account in the current Region. func (c *Client) ListDedicatedIpPools(ctx context.Context, params *ListDedicatedIpPoolsInput, optFns ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) { if params == nil { params = &ListDedicatedIpPoolsInput{} @@ -47,8 +47,8 @@ type ListDedicatedIpPoolsInput struct { // A list of dedicated IP pools. type ListDedicatedIpPoolsOutput struct { - // A list of all of the dedicated IP pools that are associated with your AWS - // account in the current Region. + // A list of all of the dedicated IP pools that are associated with your Amazon Web + // Services account in the current Region. DedicatedIpPools []string // A token that indicates that there are additional IP pools to list. To view diff --git a/service/sesv2/api_op_ListEmailIdentities.go b/service/sesv2/api_op_ListEmailIdentities.go index 92420bc2a46..dd4ede80a77 100644 --- a/service/sesv2/api_op_ListEmailIdentities.go +++ b/service/sesv2/api_op_ListEmailIdentities.go @@ -12,11 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of all of the email identities that are associated with your AWS -// account. An identity can be either an email address or a domain. This operation -// returns identities that are verified as well as those that aren't. This -// operation returns identities that are associated with Amazon SES and Amazon -// Pinpoint. +// Returns a list of all of the email identities that are associated with your +// Amazon Web Services account. An identity can be either an email address or a +// domain. This operation returns identities that are verified as well as those +// that aren't. This operation returns identities that are associated with Amazon +// SES and Amazon Pinpoint. func (c *Client) ListEmailIdentities(ctx context.Context, params *ListEmailIdentitiesInput, optFns ...func(*Options)) (*ListEmailIdentitiesOutput, error) { if params == nil { params = &ListEmailIdentitiesInput{} @@ -32,10 +32,10 @@ func (c *Client) ListEmailIdentities(ctx context.Context, params *ListEmailIdent return out, nil } -// A request to list all of the email identities associated with your AWS account. -// This list includes identities that you've already verified, identities that are -// unverified, and identities that were verified in the past, but are no longer -// verified. +// A request to list all of the email identities associated with your Amazon Web +// Services account. This list includes identities that you've already verified, +// identities that are unverified, and identities that were verified in the past, +// but are no longer verified. type ListEmailIdentitiesInput struct { // A token returned from a previous call to ListEmailIdentities to indicate the @@ -56,8 +56,8 @@ type ListEmailIdentitiesInput struct { // whether or not those identities were successfully verified. type ListEmailIdentitiesOutput struct { - // An array that includes all of the email identities associated with your AWS - // account. + // An array that includes all of the email identities associated with your Amazon + // Web Services account. EmailIdentities []types.IdentityInfo // A token that indicates that there are additional configuration sets to list. To diff --git a/service/sesv2/api_op_ListEmailTemplates.go b/service/sesv2/api_op_ListEmailTemplates.go index a0ee6eba75b..265276faf4d 100644 --- a/service/sesv2/api_op_ListEmailTemplates.go +++ b/service/sesv2/api_op_ListEmailTemplates.go @@ -12,8 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the email templates present in your Amazon SES account in the current AWS -// Region. You can execute this operation no more than once per second. +// Lists the email templates present in your Amazon SES account in the current +// Amazon Web Services Region. You can execute this operation no more than once per +// second. func (c *Client) ListEmailTemplates(ctx context.Context, params *ListEmailTemplatesInput, optFns ...func(*Options)) (*ListEmailTemplatesOutput, error) { if params == nil { params = &ListEmailTemplatesInput{} @@ -30,8 +31,8 @@ func (c *Client) ListEmailTemplates(ctx context.Context, params *ListEmailTempla } // Represents a request to list the email templates present in your Amazon SES -// account in the current AWS Region. For more information, see the Amazon SES -// Developer Guide +// account in the current Amazon Web Services Region. For more information, see the +// Amazon SES Developer Guide // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html). type ListEmailTemplatesInput struct { diff --git a/service/sesv2/api_op_PutAccountDedicatedIpWarmupAttributes.go b/service/sesv2/api_op_PutAccountDedicatedIpWarmupAttributes.go index 8752a3ec166..ffda0f964cd 100644 --- a/service/sesv2/api_op_PutAccountDedicatedIpWarmupAttributes.go +++ b/service/sesv2/api_op_PutAccountDedicatedIpWarmupAttributes.go @@ -30,8 +30,9 @@ func (c *Client) PutAccountDedicatedIpWarmupAttributes(ctx context.Context, para type PutAccountDedicatedIpWarmupAttributesInput struct { // Enables or disables the automatic warm-up feature for dedicated IP addresses - // that are associated with your Amazon SES account in the current AWS Region. Set - // to true to enable the automatic warm-up feature, or set to false to disable it. + // that are associated with your Amazon SES account in the current Amazon Web + // Services Region. Set to true to enable the automatic warm-up feature, or set to + // false to disable it. AutoWarmupEnabled bool noSmithyDocumentSerde diff --git a/service/sesv2/api_op_PutAccountDetails.go b/service/sesv2/api_op_PutAccountDetails.go index 9fcd30e0c40..46458b554f6 100644 --- a/service/sesv2/api_op_PutAccountDetails.go +++ b/service/sesv2/api_op_PutAccountDetails.go @@ -54,14 +54,14 @@ type PutAccountDetailsInput struct { ContactLanguage types.ContactLanguage // Indicates whether or not your account should have production access in the - // current AWS Region. If the value is false, then your account is in the sandbox. - // When your account is in the sandbox, you can only send email to verified - // identities. Additionally, the maximum number of emails you can send in a 24-hour - // period (your sending quota) is 200, and the maximum number of emails you can - // send per second (your maximum sending rate) is 1. If the value is true, then - // your account has production access. When your account has production access, you - // can send email to any address. The sending quota and maximum sending rate for - // your account vary based on your specific use case. + // current Amazon Web Services Region. If the value is false, then your account is + // in the sandbox. When your account is in the sandbox, you can only send email to + // verified identities. Additionally, the maximum number of emails you can send in + // a 24-hour period (your sending quota) is 200, and the maximum number of emails + // you can send per second (your maximum sending rate) is 1. If the value is true, + // then your account has production access. When your account has production + // access, you can send email to any address. The sending quota and maximum sending + // rate for your account vary based on your specific use case. ProductionAccessEnabled *bool noSmithyDocumentSerde diff --git a/service/sesv2/api_op_PutAccountSendingAttributes.go b/service/sesv2/api_op_PutAccountSendingAttributes.go index 781d7dfce3e..60b6e0c4416 100644 --- a/service/sesv2/api_op_PutAccountSendingAttributes.go +++ b/service/sesv2/api_op_PutAccountSendingAttributes.go @@ -30,9 +30,9 @@ func (c *Client) PutAccountSendingAttributes(ctx context.Context, params *PutAcc type PutAccountSendingAttributesInput struct { // Enables or disables your account's ability to send email. Set to true to enable - // email sending, or set to false to disable email sending. If AWS paused your - // account's ability to send email, you can't use this operation to resume your - // account's ability to send email. + // email sending, or set to false to disable email sending. If Amazon Web Services + // paused your account's ability to send email, you can't use this operation to + // resume your account's ability to send email. SendingEnabled bool noSmithyDocumentSerde diff --git a/service/sesv2/api_op_PutConfigurationSetDeliveryOptions.go b/service/sesv2/api_op_PutConfigurationSetDeliveryOptions.go index a38a11908bd..742a23ca9c7 100644 --- a/service/sesv2/api_op_PutConfigurationSetDeliveryOptions.go +++ b/service/sesv2/api_op_PutConfigurationSetDeliveryOptions.go @@ -32,14 +32,12 @@ func (c *Client) PutConfigurationSetDeliveryOptions(ctx context.Context, params // A request to associate a configuration set with a dedicated IP pool. type PutConfigurationSetDeliveryOptionsInput struct { - // The name of the configuration set that you want to associate with a dedicated IP - // pool. + // The name of the configuration set to associate with a dedicated IP pool. // // This member is required. ConfigurationSetName *string - // The name of the dedicated IP pool that you want to associate with the - // configuration set. + // The name of the dedicated IP pool to associate with the configuration set. SendingPoolName *string // Specifies whether messages that use the configuration set are required to use diff --git a/service/sesv2/api_op_PutConfigurationSetReputationOptions.go b/service/sesv2/api_op_PutConfigurationSetReputationOptions.go index 6f44922db61..af3c2cbc6bc 100644 --- a/service/sesv2/api_op_PutConfigurationSetReputationOptions.go +++ b/service/sesv2/api_op_PutConfigurationSetReputationOptions.go @@ -11,7 +11,7 @@ import ( ) // Enable or disable collection of reputation metrics for emails that you send -// using a particular configuration set in a specific AWS Region. +// using a particular configuration set in a specific Amazon Web Services Region. func (c *Client) PutConfigurationSetReputationOptions(ctx context.Context, params *PutConfigurationSetReputationOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetReputationOptionsOutput, error) { if params == nil { params = &PutConfigurationSetReputationOptionsInput{} @@ -31,8 +31,7 @@ func (c *Client) PutConfigurationSetReputationOptions(ctx context.Context, param // configuration set. type PutConfigurationSetReputationOptionsInput struct { - // The name of the configuration set that you want to enable or disable reputation - // metric tracking for. + // The name of the configuration set. // // This member is required. ConfigurationSetName *string diff --git a/service/sesv2/api_op_PutConfigurationSetSendingOptions.go b/service/sesv2/api_op_PutConfigurationSetSendingOptions.go index 2097c3fa068..204dfb24660 100644 --- a/service/sesv2/api_op_PutConfigurationSetSendingOptions.go +++ b/service/sesv2/api_op_PutConfigurationSetSendingOptions.go @@ -11,7 +11,7 @@ import ( ) // Enable or disable email sending for messages that use a particular configuration -// set in a specific AWS Region. +// set in a specific Amazon Web Services Region. func (c *Client) PutConfigurationSetSendingOptions(ctx context.Context, params *PutConfigurationSetSendingOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetSendingOptionsOutput, error) { if params == nil { params = &PutConfigurationSetSendingOptionsInput{} @@ -31,8 +31,7 @@ func (c *Client) PutConfigurationSetSendingOptions(ctx context.Context, params * // a specific configuration set. type PutConfigurationSetSendingOptionsInput struct { - // The name of the configuration set that you want to enable or disable email - // sending for. + // The name of the configuration set to enable or disable email sending for. // // This member is required. ConfigurationSetName *string diff --git a/service/sesv2/api_op_PutConfigurationSetSuppressionOptions.go b/service/sesv2/api_op_PutConfigurationSetSuppressionOptions.go index 6c5d427ed2b..27706949359 100644 --- a/service/sesv2/api_op_PutConfigurationSetSuppressionOptions.go +++ b/service/sesv2/api_op_PutConfigurationSetSuppressionOptions.go @@ -31,8 +31,8 @@ func (c *Client) PutConfigurationSetSuppressionOptions(ctx context.Context, para // configuration set. type PutConfigurationSetSuppressionOptionsInput struct { - // The name of the configuration set that you want to change the suppression list - // preferences for. + // The name of the configuration set to change the suppression list preferences + // for. // // This member is required. ConfigurationSetName *string diff --git a/service/sesv2/api_op_PutConfigurationSetTrackingOptions.go b/service/sesv2/api_op_PutConfigurationSetTrackingOptions.go index bcb37bf420e..2c6e71f2a5b 100644 --- a/service/sesv2/api_op_PutConfigurationSetTrackingOptions.go +++ b/service/sesv2/api_op_PutConfigurationSetTrackingOptions.go @@ -31,13 +31,12 @@ func (c *Client) PutConfigurationSetTrackingOptions(ctx context.Context, params // configuration set. type PutConfigurationSetTrackingOptionsInput struct { - // The name of the configuration set that you want to add a custom tracking domain - // to. + // The name of the configuration set. // // This member is required. ConfigurationSetName *string - // The domain that you want to use to track open and click events. + // The domain to use to track open and click events. CustomRedirectDomain *string noSmithyDocumentSerde diff --git a/service/sesv2/api_op_PutDedicatedIpInPool.go b/service/sesv2/api_op_PutDedicatedIpInPool.go index 363ffd8e500..2fd13229f4f 100644 --- a/service/sesv2/api_op_PutDedicatedIpInPool.go +++ b/service/sesv2/api_op_PutDedicatedIpInPool.go @@ -12,8 +12,8 @@ import ( // Move a dedicated IP address to an existing dedicated IP pool. The dedicated IP // address that you specify must already exist, and must be associated with your -// AWS account. The dedicated IP pool you specify must already exist. You can -// create a new pool by using the CreateDedicatedIpPool operation. +// Amazon Web Services account. The dedicated IP pool you specify must already +// exist. You can create a new pool by using the CreateDedicatedIpPool operation. func (c *Client) PutDedicatedIpInPool(ctx context.Context, params *PutDedicatedIpInPoolInput, optFns ...func(*Options)) (*PutDedicatedIpInPoolOutput, error) { if params == nil { params = &PutDedicatedIpInPoolInput{} @@ -39,8 +39,8 @@ type PutDedicatedIpInPoolInput struct { DestinationPoolName *string // The IP address that you want to move to the dedicated IP pool. The value you - // specify has to be a dedicated IP address that's associated with your AWS - // account. + // specify has to be a dedicated IP address that's associated with your Amazon Web + // Services account. // // This member is required. Ip *string diff --git a/service/sesv2/api_op_PutDeliverabilityDashboardOption.go b/service/sesv2/api_op_PutDeliverabilityDashboardOption.go index dd41b74212a..7371b0c4cd2 100644 --- a/service/sesv2/api_op_PutDeliverabilityDashboardOption.go +++ b/service/sesv2/api_op_PutDeliverabilityDashboardOption.go @@ -16,9 +16,10 @@ import ( // other metrics for the domains that you use to send email. You also gain the // ability to perform predictive inbox placement tests. When you use the // Deliverability dashboard, you pay a monthly subscription charge, in addition to -// any other fees that you accrue by using Amazon SES and other AWS services. For -// more information about the features and cost of a Deliverability dashboard -// subscription, see Amazon SES Pricing (http://aws.amazon.com/ses/pricing/). +// any other fees that you accrue by using Amazon SES and other Amazon Web Services +// services. For more information about the features and cost of a Deliverability +// dashboard subscription, see Amazon SES Pricing +// (http://aws.amazon.com/ses/pricing/). func (c *Client) PutDeliverabilityDashboardOption(ctx context.Context, params *PutDeliverabilityDashboardOptionInput, optFns ...func(*Options)) (*PutDeliverabilityDashboardOptionOutput, error) { if params == nil { params = &PutDeliverabilityDashboardOptionInput{} @@ -39,9 +40,9 @@ func (c *Client) PutDeliverabilityDashboardOption(ctx context.Context, params *P // other metrics for the domains that you use to send email using Amazon SES API // v2. You also gain the ability to perform predictive inbox placement tests. When // you use the Deliverability dashboard, you pay a monthly subscription charge, in -// addition to any other fees that you accrue by using Amazon SES and other AWS -// services. For more information about the features and cost of a Deliverability -// dashboard subscription, see Amazon Pinpoint Pricing +// addition to any other fees that you accrue by using Amazon SES and other Amazon +// Web Services services. For more information about the features and cost of a +// Deliverability dashboard subscription, see Amazon Pinpoint Pricing // (http://aws.amazon.com/pinpoint/pricing/). type PutDeliverabilityDashboardOptionInput struct { diff --git a/service/sesv2/api_op_PutEmailIdentityConfigurationSetAttributes.go b/service/sesv2/api_op_PutEmailIdentityConfigurationSetAttributes.go index 945ce8d2388..8b5ec3426a7 100644 --- a/service/sesv2/api_op_PutEmailIdentityConfigurationSetAttributes.go +++ b/service/sesv2/api_op_PutEmailIdentityConfigurationSetAttributes.go @@ -29,12 +29,12 @@ func (c *Client) PutEmailIdentityConfigurationSetAttributes(ctx context.Context, // A request to associate a configuration set with an email identity. type PutEmailIdentityConfigurationSetAttributesInput struct { - // The email address or domain that you want to associate with a configuration set. + // The email address or domain to associate with a configuration set. // // This member is required. EmailIdentity *string - // The configuration set that you want to associate with an email identity. + // The configuration set to associate with an email identity. ConfigurationSetName *string noSmithyDocumentSerde diff --git a/service/sesv2/api_op_PutEmailIdentityDkimAttributes.go b/service/sesv2/api_op_PutEmailIdentityDkimAttributes.go index 0c759b145ec..7f61c12cebe 100644 --- a/service/sesv2/api_op_PutEmailIdentityDkimAttributes.go +++ b/service/sesv2/api_op_PutEmailIdentityDkimAttributes.go @@ -30,7 +30,7 @@ func (c *Client) PutEmailIdentityDkimAttributes(ctx context.Context, params *Put // identity. type PutEmailIdentityDkimAttributesInput struct { - // The email identity that you want to change the DKIM settings for. + // The email identity. // // This member is required. EmailIdentity *string diff --git a/service/sesv2/api_op_PutEmailIdentityDkimSigningAttributes.go b/service/sesv2/api_op_PutEmailIdentityDkimSigningAttributes.go index 879eb2ec12b..0092e7dcc16 100644 --- a/service/sesv2/api_op_PutEmailIdentityDkimSigningAttributes.go +++ b/service/sesv2/api_op_PutEmailIdentityDkimSigningAttributes.go @@ -18,13 +18,16 @@ import ( // signing attributes for an identity that uses Bring Your Own DKIM (BYODKIM). // // * -// Change from using no DKIM authentication to using Easy DKIM. +// Update the key length that should be used for Easy DKIM. // -// * Change from -// using no DKIM authentication to using BYODKIM. +// * Change from using no +// DKIM authentication to using Easy DKIM. // -// * Change from using Easy DKIM to -// using BYODKIM. +// * Change from using no DKIM +// authentication to using BYODKIM. +// +// * Change from using Easy DKIM to using +// BYODKIM. // // * Change from using BYODKIM to using Easy DKIM. func (c *Client) PutEmailIdentityDkimSigningAttributes(ctx context.Context, params *PutEmailIdentityDkimSigningAttributesInput, optFns ...func(*Options)) (*PutEmailIdentityDkimSigningAttributesOutput, error) { @@ -45,16 +48,16 @@ func (c *Client) PutEmailIdentityDkimSigningAttributes(ctx context.Context, para // A request to change the DKIM attributes for an email identity. type PutEmailIdentityDkimSigningAttributesInput struct { - // The email identity that you want to configure DKIM for. + // The email identity. // // This member is required. EmailIdentity *string - // The method that you want to use to configure DKIM for the identity. There are - // two possible values: + // The method to use to configure DKIM for the identity. There are the following + // possible values: // - // * AWS_SES – Configure DKIM for the identity by using Easy - // DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html). + // * AWS_SES – Configure DKIM for the identity by using Easy DKIM + // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html). // // * // EXTERNAL – Configure DKIM for the identity by using Bring Your Own DKIM @@ -64,8 +67,9 @@ type PutEmailIdentityDkimSigningAttributesInput struct { SigningAttributesOrigin types.DkimSigningAttributesOrigin // An object that contains information about the private key and selector that you - // want to use to configure DKIM for the identity. This object is only required if - // you want to configure Bring Your Own DKIM (BYODKIM) for the identity. + // want to use to configure DKIM for the identity for Bring Your Own DKIM (BYODKIM) + // for the identity, or, configures the key length to be used for Easy DKIM + // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html). SigningAttributes *types.DkimSigningAttributes noSmithyDocumentSerde diff --git a/service/sesv2/api_op_PutEmailIdentityFeedbackAttributes.go b/service/sesv2/api_op_PutEmailIdentityFeedbackAttributes.go index f8199103856..cb214081c7d 100644 --- a/service/sesv2/api_op_PutEmailIdentityFeedbackAttributes.go +++ b/service/sesv2/api_op_PutEmailIdentityFeedbackAttributes.go @@ -38,8 +38,7 @@ func (c *Client) PutEmailIdentityFeedbackAttributes(ctx context.Context, params // processed. type PutEmailIdentityFeedbackAttributesInput struct { - // The email identity that you want to configure bounce and complaint feedback - // forwarding for. + // The email identity. // // This member is required. EmailIdentity *string diff --git a/service/sesv2/api_op_PutEmailIdentityMailFromAttributes.go b/service/sesv2/api_op_PutEmailIdentityMailFromAttributes.go index 8241ecf9d4e..e9e3f6c7589 100644 --- a/service/sesv2/api_op_PutEmailIdentityMailFromAttributes.go +++ b/service/sesv2/api_op_PutEmailIdentityMailFromAttributes.go @@ -31,19 +31,17 @@ func (c *Client) PutEmailIdentityMailFromAttributes(ctx context.Context, params // A request to configure the custom MAIL FROM domain for a verified identity. type PutEmailIdentityMailFromAttributesInput struct { - // The verified email identity that you want to set up the custom MAIL FROM domain - // for. + // The verified email identity. // // This member is required. EmailIdentity *string - // The action that you want to take if the required MX record isn't found when you - // send an email. When you set this value to UseDefaultValue, the mail is sent - // using amazonses.com as the MAIL FROM domain. When you set this value to - // RejectMessage, the Amazon SES API v2 returns a MailFromDomainNotVerified error, - // and doesn't attempt to deliver the email. These behaviors are taken when the - // custom MAIL FROM domain configuration is in the Pending, Failed, and - // TemporaryFailure states. + // The action to take if the required MX record isn't found when you send an email. + // When you set this value to UseDefaultValue, the mail is sent using amazonses.com + // as the MAIL FROM domain. When you set this value to RejectMessage, the Amazon + // SES API v2 returns a MailFromDomainNotVerified error, and doesn't attempt to + // deliver the email. These behaviors are taken when the custom MAIL FROM domain + // configuration is in the Pending, Failed, and TemporaryFailure states. BehaviorOnMxFailure types.BehaviorOnMxFailure // The custom MAIL FROM domain that you want the verified identity to use. The MAIL diff --git a/service/sesv2/api_op_SendBulkEmail.go b/service/sesv2/api_op_SendBulkEmail.go index 2f3e9a06ad8..0fbb31ccbc6 100644 --- a/service/sesv2/api_op_SendBulkEmail.go +++ b/service/sesv2/api_op_SendBulkEmail.go @@ -43,7 +43,7 @@ type SendBulkEmailInput struct { // This member is required. DefaultContent *types.BulkEmailContent - // The name of the configuration set that you want to use when sending the email. + // The name of the configuration set to use when sending the email. ConfigurationSetName *string // A list of tags, in the form of name/value pairs, to apply to an email that you @@ -67,8 +67,8 @@ type SendBulkEmailInput struct { // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). FeedbackForwardingEmailAddressIdentityArn *string - // The email address that you want to use as the "From" address for the email. The - // address that you specify has to be verified. + // The email address to use as the "From" address for the email. The address that + // you specify has to be verified. FromEmailAddress *string // This parameter is used only for sending authorization. It is the ARN of the @@ -94,7 +94,8 @@ type SendBulkEmailInput struct { // The following data is returned in JSON format by the service. type SendBulkEmailOutput struct { - // A list of BulkMailEntry objects. + // One object per intended recipient. Check each response object and retry any + // messages with a failure status. // // This member is required. BulkEmailEntryResults []types.BulkEmailEntryResult diff --git a/service/sesv2/api_op_SendCustomVerificationEmail.go b/service/sesv2/api_op_SendCustomVerificationEmail.go index 992e7d9c0c6..0186e8cb9b9 100644 --- a/service/sesv2/api_op_SendCustomVerificationEmail.go +++ b/service/sesv2/api_op_SendCustomVerificationEmail.go @@ -11,11 +11,12 @@ import ( ) // Adds an email address to the list of identities for your Amazon SES account in -// the current AWS Region and attempts to verify it. As a result of executing this -// operation, a customized verification email is sent to the specified address. To -// use this operation, you must first create a custom verification email template. -// For more information about creating and using custom verification email -// templates, see Using Custom Verification Email Templates +// the current Amazon Web Services Region and attempts to verify it. As a result of +// executing this operation, a customized verification email is sent to the +// specified address. To use this operation, you must first create a custom +// verification email template. For more information about creating and using +// custom verification email templates, see Using Custom Verification Email +// Templates // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-verify-address-custom.html) // in the Amazon SES Developer Guide. You can execute this operation no more than // once per second. diff --git a/service/sesv2/api_op_SendEmail.go b/service/sesv2/api_op_SendEmail.go index 37dea5e6644..5911d52e53c 100644 --- a/service/sesv2/api_op_SendEmail.go +++ b/service/sesv2/api_op_SendEmail.go @@ -11,17 +11,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Sends an email message. You can use the Amazon SES API v2 to send two types of -// messages: +// Sends an email message. You can use the Amazon SES API v2 to send the following +// types of messages: // -// * Simple – A standard email message. When you create this type of -// message, you specify the sender, the recipient, and the message body, and Amazon -// SES assembles the message for you. +// * Simple – A standard email message. When you create this +// type of message, you specify the sender, the recipient, and the message body, +// and Amazon SES assembles the message for you. // -// * Raw – A raw, MIME-formatted email message. -// When you send this type of email, you have to specify all of the message -// headers, as well as the message body. You can use this message type to send -// messages that contain attachments. The message that you specify has to be a +// * Raw – A raw, MIME-formatted +// email message. When you send this type of email, you have to specify all of the +// message headers, as well as the message body. You can use this message type to +// send messages that contain attachments. The message that you specify has to be a // valid MIME message. // // * Templated – A message that contains personalization tags. @@ -53,7 +53,7 @@ type SendEmailInput struct { // This member is required. Content *types.EmailContent - // The name of the configuration set that you want to use when sending the email. + // The name of the configuration set to use when sending the email. ConfigurationSetName *string // An object that contains the recipients of the email message. @@ -80,8 +80,8 @@ type SendEmailInput struct { // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html). FeedbackForwardingEmailAddressIdentityArn *string - // The email address that you want to use as the "From" address for the email. The - // address that you specify has to be verified. + // The email address to use as the "From" address for the email. The address that + // you specify has to be verified. FromEmailAddress *string // This parameter is used only for sending authorization. It is the ARN of the diff --git a/service/sesv2/api_op_TestRenderEmailTemplate.go b/service/sesv2/api_op_TestRenderEmailTemplate.go index 1ce1ec0a7de..53653a9a0c1 100644 --- a/service/sesv2/api_op_TestRenderEmailTemplate.go +++ b/service/sesv2/api_op_TestRenderEmailTemplate.go @@ -39,7 +39,7 @@ type TestRenderEmailTemplateInput struct { // This member is required. TemplateData *string - // The name of the template that you want to render. + // The name of the template. // // This member is required. TemplateName *string diff --git a/service/sesv2/api_op_UpdateConfigurationSetEventDestination.go b/service/sesv2/api_op_UpdateConfigurationSetEventDestination.go index fa677548e72..c88bc8102d3 100644 --- a/service/sesv2/api_op_UpdateConfigurationSetEventDestination.go +++ b/service/sesv2/api_op_UpdateConfigurationSetEventDestination.go @@ -36,8 +36,7 @@ func (c *Client) UpdateConfigurationSetEventDestination(ctx context.Context, par // set. type UpdateConfigurationSetEventDestinationInput struct { - // The name of the configuration set that contains the event destination that you - // want to modify. + // The name of the configuration set that contains the event destination to modify. // // This member is required. ConfigurationSetName *string @@ -47,7 +46,7 @@ type UpdateConfigurationSetEventDestinationInput struct { // This member is required. EventDestination *types.EventDestinationDefinition - // The name of the event destination that you want to modify. + // The name of the event destination. // // This member is required. EventDestinationName *string diff --git a/service/sesv2/api_op_UpdateEmailIdentityPolicy.go b/service/sesv2/api_op_UpdateEmailIdentityPolicy.go index a9da478fdbb..5452abf9a8d 100644 --- a/service/sesv2/api_op_UpdateEmailIdentityPolicy.go +++ b/service/sesv2/api_op_UpdateEmailIdentityPolicy.go @@ -41,7 +41,7 @@ func (c *Client) UpdateEmailIdentityPolicy(ctx context.Context, params *UpdateEm // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-identity-owner-tasks-management.html). type UpdateEmailIdentityPolicyInput struct { - // The email identity for which you want to update policy. + // The email identity. // // This member is required. EmailIdentity *string diff --git a/service/sesv2/api_op_UpdateEmailTemplate.go b/service/sesv2/api_op_UpdateEmailTemplate.go index 6993d6e1a29..3076894c173 100644 --- a/service/sesv2/api_op_UpdateEmailTemplate.go +++ b/service/sesv2/api_op_UpdateEmailTemplate.go @@ -42,7 +42,7 @@ type UpdateEmailTemplateInput struct { // This member is required. TemplateContent *types.EmailTemplateContent - // The name of the template you want to update. + // The name of the template. // // This member is required. TemplateName *string diff --git a/service/sesv2/deserializers.go b/service/sesv2/deserializers.go index 78ab9fa919d..2cee770cb31 100644 --- a/service/sesv2/deserializers.go +++ b/service/sesv2/deserializers.go @@ -12218,6 +12218,40 @@ func awsRestjson1_deserializeDocumentDkimAttributes(v **types.DkimAttributes, va for key, value := range shape { switch key { + case "CurrentSigningKeyLength": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DkimSigningKeyLength to be of type string, got %T instead", value) + } + sv.CurrentSigningKeyLength = types.DkimSigningKeyLength(jtv) + } + + case "LastKeyGenerationTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastKeyGenerationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "NextSigningKeyLength": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DkimSigningKeyLength to be of type string, got %T instead", value) + } + sv.NextSigningKeyLength = types.DkimSigningKeyLength(jtv) + } + case "SigningAttributesOrigin": if value != nil { jtv, ok := value.(string) diff --git a/service/sesv2/doc.go b/service/sesv2/doc.go index 96a87e1c57b..6d7bcca5a88 100644 --- a/service/sesv2/doc.go +++ b/service/sesv2/doc.go @@ -3,28 +3,11 @@ // Package sesv2 provides the API client, operations, and parameter types for // Amazon Simple Email Service. // -// Amazon SES API v2 Welcome to the Amazon SES API v2 Reference. This guide -// provides information about the Amazon SES API v2, including supported -// operations, data types, parameters, and schemas. Amazon SES -// (https://aws.amazon.com/pinpoint) is an AWS service that you can use to send -// email messages to your customers. If you're new to Amazon SES API v2, you might -// find it helpful to also review the Amazon Simple Email Service Developer Guide +// Amazon SES API v2 Amazon SES (http://aws.amazon.com/ses) is an Amazon Web +// Services service that you can use to send email messages to your customers. If +// you're new to Amazon SES API v2, you might find it helpful to review the Amazon +// Simple Email Service Developer Guide // (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/). The Amazon SES // Developer Guide provides information and code samples that demonstrate how to -// use Amazon SES API v2 features programmatically. The Amazon SES API v2 is -// available in several AWS Regions and it provides an endpoint for each of these -// Regions. For a list of all the Regions and endpoints where the API is currently -// available, see AWS Service Endpoints -// (https://docs.aws.amazon.com/general/latest/gr/rande.html#ses_region) in the -// Amazon Web Services General Reference. To learn more about AWS Regions, see -// Managing AWS Regions -// (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) in the Amazon -// Web Services General Reference. In each Region, AWS maintains multiple -// Availability Zones. These Availability Zones are physically isolated from each -// other, but are united by private, low-latency, high-throughput, and highly -// redundant network connections. These Availability Zones enable us to provide -// very high levels of availability and redundancy, while also minimizing latency. -// To learn more about the number of Availability Zones that are available in each -// Region, see AWS Global Infrastructure -// (http://aws.amazon.com/about-aws/global-infrastructure/). +// use Amazon SES API v2 features programmatically. package sesv2 diff --git a/service/sesv2/serializers.go b/service/sesv2/serializers.go index 7b922c4b11e..21712d729c4 100644 --- a/service/sesv2/serializers.go +++ b/service/sesv2/serializers.go @@ -6149,6 +6149,11 @@ func awsRestjson1_serializeDocumentDkimSigningAttributes(v *types.DkimSigningAtt ok.String(*v.DomainSigningSelector) } + if len(v.NextSigningKeyLength) > 0 { + ok := object.Key("NextSigningKeyLength") + ok.String(string(v.NextSigningKeyLength)) + } + return nil } diff --git a/service/sesv2/types/enums.go b/service/sesv2/types/enums.go index 9c56d72efc6..0b28cb46dfd 100644 --- a/service/sesv2/types/enums.go +++ b/service/sesv2/types/enums.go @@ -193,6 +193,24 @@ func (DkimSigningAttributesOrigin) Values() []DkimSigningAttributesOrigin { } } +type DkimSigningKeyLength string + +// Enum values for DkimSigningKeyLength +const ( + DkimSigningKeyLengthRsa1024Bit DkimSigningKeyLength = "RSA_1024_BIT" + DkimSigningKeyLengthRsa2048Bit DkimSigningKeyLength = "RSA_2048_BIT" +) + +// Values returns all known values for DkimSigningKeyLength. 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 (DkimSigningKeyLength) Values() []DkimSigningKeyLength { + return []DkimSigningKeyLength{ + "RSA_1024_BIT", + "RSA_2048_BIT", + } +} + type DkimStatus string // Enum values for DkimStatus diff --git a/service/sesv2/types/types.go b/service/sesv2/types/types.go index 8573183a53d..a773d1fae31 100644 --- a/service/sesv2/types/types.go +++ b/service/sesv2/types/types.go @@ -224,10 +224,10 @@ type CloudWatchDimensionConfiguration struct { DimensionName *string // The location where the Amazon SES API v2 finds the value of a dimension to - // publish to Amazon CloudWatch. If you want to use the message tags that you - // specify using an X-SES-MESSAGE-TAGS header or a parameter to the SendEmail or - // SendRawEmail API, choose messageTag. If you want to use your own email headers, - // choose emailHeader. If you want to use link tags, choose linkTags. + // publish to Amazon CloudWatch. To use the message tags that you specify using an + // X-SES-MESSAGE-TAGS header or a parameter to the SendEmail or SendRawEmail API, + // choose messageTag. To use your own email headers, choose emailHeader. To use + // link tags, choose linkTags. // // This member is required. DimensionValueSource DimensionValueSource @@ -273,7 +273,7 @@ type ContactList struct { // An object that contains details about the action of a contact list. type ContactListDestination struct { - // >The type of action that you want to perform on the addresses. Acceptable + // >The type of action to perform on the addresses. The following are the possible // values: // // * PUT: add the addresses to the contact list. If the record already @@ -421,8 +421,7 @@ type DeliverabilityTestReport struct { // Used to associate a configuration set with a dedicated IP pool. type DeliveryOptions struct { - // The name of the dedicated IP pool that you want to associate with the - // configuration set. + // The name of the dedicated IP pool to associate with the configuration set. SendingPoolName *string // Specifies whether messages that use the configuration set are required to use @@ -435,7 +434,15 @@ type DeliveryOptions struct { noSmithyDocumentSerde } -// An object that describes the recipients for an email. +// An object that describes the recipients for an email. Amazon SES does not +// support the SMTPUTF8 extension, as described in RFC6531 +// (https://tools.ietf.org/html/rfc6531). For this reason, the local part of a +// destination email address (the part of the email address that precedes the @ +// sign) may only contain 7-bit ASCII characters +// (https://en.wikipedia.org/wiki/Email_address#Local-part). If the domain part of +// an address (the part after the @ sign) contains non-ASCII characters, they must +// be encoded using Punycode, as described in RFC3492 +// (https://tools.ietf.org/html/rfc3492.html). type Destination struct { // An array that contains the email addresses of the "BCC" (blind carbon copy) @@ -464,7 +471,17 @@ type Destination struct { // identity type DkimAttributes struct { - // A string that indicates how DKIM was configured for the identity. There are two + // [Easy DKIM] The key length of the DKIM key pair in use. + CurrentSigningKeyLength DkimSigningKeyLength + + // [Easy DKIM] The last time a key pair was generated for this identity. + LastKeyGenerationTimestamp *time.Time + + // [Easy DKIM] The key length of the future DKIM key pair to be generated. This can + // be changed at most once per day. + NextSigningKeyLength DkimSigningKeyLength + + // A string that indicates how DKIM was configured for the identity. These are the // possible values: // // * AWS_SES – Indicates that DKIM was configured for the @@ -519,22 +536,23 @@ type DkimAttributes struct { noSmithyDocumentSerde } -// An object that contains information about the tokens used for setting up Bring -// Your Own DKIM (BYODKIM). +// An object that contains configuration for Bring Your Own DKIM (BYODKIM), or, for +// Easy DKIM type DkimSigningAttributes struct { - // A private key that's used to generate a DKIM signature. The private key must use - // 1024-bit RSA encryption, and must be encoded using base64 encoding. - // - // This member is required. + // [Bring Your Own DKIM] A private key that's used to generate a DKIM signature. + // The private key must use 1024 or 2048-bit RSA encryption, and must be encoded + // using base64 encoding. DomainSigningPrivateKey *string - // A string that's used to identify a public key in the DNS configuration for a - // domain. - // - // This member is required. + // [Bring Your Own DKIM] A string that's used to identify a public key in the DNS + // configuration for a domain. DomainSigningSelector *string + // [Easy DKIM] The key length of the future DKIM key pair to be generated. This can + // be changed at most once per day. + NextSigningKeyLength DkimSigningKeyLength + noSmithyDocumentSerde } @@ -608,8 +626,8 @@ type DomainDeliverabilityCampaign struct { // placement, and other metrics for the domain. type DomainDeliverabilityTrackingOption struct { - // A verified domain that’s associated with your AWS account and currently has an - // active Deliverability dashboard subscription. + // A verified domain that’s associated with your Amazon Web Services account and + // currently has an active Deliverability dashboard subscription. Domain *string // An object that contains information about the inbox placement data settings for @@ -832,15 +850,8 @@ type IdentityInfo struct { // The address or domain of the identity. IdentityName *string - // The email identity type. The identity type can be one of the following: - // - // * - // EMAIL_ADDRESS – The identity is an email address. - // - // * DOMAIN – The identity is a - // domain. - // - // * MANAGED_DOMAIN – The identity is a domain that is managed by AWS. + // The email identity type. Note: the MANAGED_DOMAIN type is not supported for + // email identity types. IdentityType IdentityType // Indicates whether or not you can send email from the identity. An identity is an @@ -901,8 +912,9 @@ type ImportJobSummary struct { } // An object that contains information about the inbox placement data settings for -// a verified domain that’s associated with your AWS account. This data is -// available only if you enabled the Deliverability dashboard for the domain. +// a verified domain that’s associated with your Amazon Web Services account. This +// data is available only if you enabled the Deliverability dashboard for the +// domain. type InboxPlacementTrackingOption struct { // Specifies whether inbox placement data is being tracked for the domain. @@ -978,13 +990,13 @@ type ListManagementOptions struct { // A list of attributes that are associated with a MAIL FROM domain. type MailFromAttributes struct { - // The action that you want to take if the required MX record can't be found when - // you send an email. When you set this value to UseDefaultValue, the mail is sent - // using amazonses.com as the MAIL FROM domain. When you set this value to - // RejectMessage, the Amazon SES API v2 returns a MailFromDomainNotVerified error, - // and doesn't attempt to deliver the email. These behaviors are taken when the - // custom MAIL FROM domain configuration is in the Pending, Failed, and - // TemporaryFailure states. + // The action to take if the required MX record can't be found when you send an + // email. When you set this value to UseDefaultValue, the mail is sent using + // amazonses.com as the MAIL FROM domain. When you set this value to RejectMessage, + // the Amazon SES API v2 returns a MailFromDomainNotVerified error, and doesn't + // attempt to deliver the email. These behaviors are taken when the custom MAIL + // FROM domain configuration is in the Pending, Failed, and TemporaryFailure + // states. // // This member is required. BehaviorOnMxFailure BehaviorOnMxFailure @@ -1092,8 +1104,8 @@ type OverallVolume struct { // in the Amazon Pinpoint User Guide. type PinpointDestination struct { - // The Amazon Resource Name (ARN) of the Amazon Pinpoint project that you want to - // send email events to. + // The Amazon Resource Name (ARN) of the Amazon Pinpoint project to send email + // events to. ApplicationArn *string noSmithyDocumentSerde @@ -1182,7 +1194,7 @@ type ReplacementTemplate struct { } // Enable or disable collection of reputation metrics for emails that you send -// using this configuration set in the current AWS Region. +// using this configuration set in the current Amazon Web Services Region. type ReputationOptions struct { // The date and time (in Unix time) when the reputation metrics were last given a @@ -1223,7 +1235,7 @@ type ReviewDetails struct { } // Used to enable or disable email sending for messages that use this configuration -// set in the current AWS Region. +// set in the current Amazon Web Services Region. type SendingOptions struct { // If true, email sending is enabled for the configuration set. If false, email @@ -1234,20 +1246,21 @@ type SendingOptions struct { } // An object that contains information about the per-day and per-second sending -// limits for your Amazon SES account in the current AWS Region. +// limits for your Amazon SES account in the current Amazon Web Services Region. type SendQuota struct { - // The maximum number of emails that you can send in the current AWS Region over a - // 24-hour period. This value is also called your sending quota. + // The maximum number of emails that you can send in the current Amazon Web + // Services Region over a 24-hour period. This value is also called your sending + // quota. Max24HourSend float64 - // The maximum number of emails that you can send per second in the current AWS - // Region. This value is also called your maximum sending rate or your maximum TPS - // (transactions per second) rate. + // The maximum number of emails that you can send per second in the current Amazon + // Web Services Region. This value is also called your maximum sending rate or your + // maximum TPS (transactions per second) rate. MaxSendRate float64 - // The number of emails sent from your Amazon SES account in the current AWS Region - // over the past 24 hours. + // The number of emails sent from your Amazon SES account in the current Amazon Web + // Services Region over the past 24 hours. SentLast24Hours float64 noSmithyDocumentSerde @@ -1257,10 +1270,9 @@ type SendQuota struct { // Amazon SNS to send notification when certain email events occur. type SnsDestination struct { - // The Amazon Resource Name (ARN) of the Amazon SNS topic that you want to publish - // email events to. For more information about Amazon SNS topics, see the Amazon - // SNS Developer Guide - // (https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). + // The Amazon Resource Name (ARN) of the Amazon SNS topic to publish email events + // to. For more information about Amazon SNS topics, see the Amazon SNS Developer + // Guide (https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html). // // This member is required. TopicArn *string @@ -1333,7 +1345,7 @@ type SuppressedDestinationSummary struct { } // An object that contains information about the email address suppression -// preferences for your account in the current AWS Region. +// preferences for your account in the current Amazon Web Services Region. type SuppressionAttributes struct { // A list that contains the reasons that email addresses will be automatically @@ -1355,7 +1367,7 @@ type SuppressionAttributes struct { // An object that contains details about the action of suppression list. type SuppressionListDestination struct { - // The type of action that you want to perform on the address. Acceptable + // The type of action to perform on the address. The following are possible // values: // // * PUT: add the addresses to the suppression list. If the record already @@ -1407,16 +1419,16 @@ type SuppressionOptions struct { // each associated resource, each tag key must be unique and it can have only one // value. // -// * The aws: prefix is reserved for use by AWS; you can’t use it in any -// tag keys or values that you define. In addition, you can't edit or remove tag -// keys or values that use this prefix. Tags that use this prefix don’t count -// against the limit of 50 tags per resource. +// * The aws: prefix is reserved for use by Amazon Web Services; you can’t +// use it in any tag keys or values that you define. In addition, you can't edit or +// remove tag keys or values that use this prefix. Tags that use this prefix don’t +// count against the limit of 50 tags per resource. // -// * You can associate tags with public -// or shared resources, but the tags are available only for your AWS account, not -// any other accounts that share the resource. In addition, the tags are available -// only for resources that are located in the specified AWS Region for your AWS -// account. +// * You can associate tags with +// public or shared resources, but the tags are available only for your Amazon Web +// Services account, not any other accounts that share the resource. In addition, +// the tags are available only for resources that are located in the specified +// Amazon Web Services Region for your Amazon Web Services account. type Tag struct { // One part of a key-value pair that defines a tag. The maximum length of a tag key @@ -1518,12 +1530,12 @@ type TopicPreference struct { // use the Amazon SES API v2 to send an email, it contains an invisible image // that's used to track when recipients open your email. If your email contains // links, those links are changed slightly in order to track when recipients click -// them. These images and links include references to a domain operated by AWS. You -// can optionally configure the Amazon SES to use a domain that you operate for -// these images and links. +// them. These images and links include references to a domain operated by Amazon +// Web Services. You can optionally configure the Amazon SES to use a domain that +// you operate for these images and links. type TrackingOptions struct { - // The domain that you want to use for tracking open and click events. + // The domain to use for tracking open and click events. // // This member is required. CustomRedirectDomain *string diff --git a/service/sesv2/validators.go b/service/sesv2/validators.go index d8a630b97b6..036ad7e0890 100644 --- a/service/sesv2/validators.go +++ b/service/sesv2/validators.go @@ -1743,24 +1743,6 @@ func validateContent(v *types.Content) error { } } -func validateDkimSigningAttributes(v *types.DkimSigningAttributes) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DkimSigningAttributes"} - if v.DomainSigningSelector == nil { - invalidParams.Add(smithy.NewErrParamRequired("DomainSigningSelector")) - } - if v.DomainSigningPrivateKey == nil { - invalidParams.Add(smithy.NewErrParamRequired("DomainSigningPrivateKey")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateEmailContent(v *types.EmailContent) error { if v == nil { return nil @@ -2300,11 +2282,6 @@ func validateOpCreateEmailIdentityInput(v *CreateEmailIdentityInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } - if v.DkimSigningAttributes != nil { - if err := validateDkimSigningAttributes(v.DkimSigningAttributes); err != nil { - invalidParams.AddNested("DkimSigningAttributes", err.(smithy.InvalidParamsError)) - } - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3006,11 +2983,6 @@ func validateOpPutEmailIdentityDkimSigningAttributesInput(v *PutEmailIdentityDki if len(v.SigningAttributesOrigin) == 0 { invalidParams.Add(smithy.NewErrParamRequired("SigningAttributesOrigin")) } - if v.SigningAttributes != nil { - if err := validateDkimSigningAttributes(v.SigningAttributes); err != nil { - invalidParams.AddNested("SigningAttributes", err.(smithy.InvalidParamsError)) - } - } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/transfer/api_op_CreateAccess.go b/service/transfer/api_op_CreateAccess.go index 26bfe084015..f86e0851900 100644 --- a/service/transfer/api_op_CreateAccess.go +++ b/service/transfer/api_op_CreateAccess.go @@ -76,20 +76,19 @@ type CreateAccessInput struct { // specify a target, it is displayed as is. You also must ensure that your Amazon // Web Services Identity and Access Management (IAM) role provides access to paths // in Target. This value can only be set when HomeDirectoryType is set to LOGICAL. - // The following is an Entry and Target pair example. [ { "Entry": - // "your-personal-report.pdf", "Target": - // "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] In most cases, you - // can use this value instead of the session policy to lock down your user to the - // designated home directory ("chroot"). To do this, you can set Entry to / and set - // Target to the HomeDirectory parameter value. The following is an Entry and - // Target pair example for chroot. [ { "Entry:": "/", "Target": - // "/bucket_name/home/mydirectory" } ] If the target of a logical directory entry - // does not exist in Amazon S3 or EFS, the entry is ignored. As a workaround, you - // can use the Amazon S3 API or EFS API to create 0 byte objects as place holders - // for your directory. If using the CLI, use the s3api or efsapi call instead of s3 - // or efs so you can use the put-object operation. For example, you use the - // following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make - // sure that the end of the key name ends in a / for it to be considered a folder. + // The following is an Entry and Target pair example. [ { "Entry": "/directory1", + // "Target": "/bucket_name/home/mydirectory" } ] In most cases, you can use this + // value instead of the session policy to lock down your user to the designated + // home directory ("chroot"). To do this, you can set Entry to / and set Target to + // the HomeDirectory parameter value. The following is an Entry and Target pair + // example for chroot. [ { "Entry:": "/", "Target": "/bucket_name/home/mydirectory" + // } ] If the target of a logical directory entry does not exist in Amazon S3 or + // EFS, the entry is ignored. As a workaround, you can use the Amazon S3 API or EFS + // API to create 0 byte objects as place holders for your directory. If using the + // CLI, use the s3api or efsapi call instead of s3 or efs so you can use the + // put-object operation. For example, you use the following: aws s3api put-object + // --bucket bucketname --key path/to/folder/. Make sure that the end of the key + // name ends in a / for it to be considered a folder. HomeDirectoryMappings []types.HomeDirectoryMapEntry // The type of landing directory (folder) you want your users' home directory to be diff --git a/service/transfer/api_op_CreateUser.go b/service/transfer/api_op_CreateUser.go index 0280ada5f79..92280d71fb0 100644 --- a/service/transfer/api_op_CreateUser.go +++ b/service/transfer/api_op_CreateUser.go @@ -71,20 +71,19 @@ type CreateUserInput struct { // specify a target, it is displayed as is. You also must ensure that your Amazon // Web Services Identity and Access Management (IAM) role provides access to paths // in Target. This value can only be set when HomeDirectoryType is set to LOGICAL. - // The following is an Entry and Target pair example. [ { "Entry": - // "your-personal-report.pdf", "Target": - // "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] In most cases, you - // can use this value instead of the session policy to lock your user down to the - // designated home directory ("chroot"). To do this, you can set Entry to / and set - // Target to the HomeDirectory parameter value. The following is an Entry and - // Target pair example for chroot. [ { "Entry:": "/", "Target": - // "/bucket_name/home/mydirectory" } ] If the target of a logical directory entry - // does not exist in Amazon S3 or EFS, the entry is ignored. As a workaround, you - // can use the Amazon S3 API or EFS API to create 0 byte objects as place holders - // for your directory. If using the CLI, use the s3api or efsapi call instead of s3 - // or efs so you can use the put-object operation. For example, you use the - // following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make - // sure that the end of the key name ends in a / for it to be considered a folder. + // The following is an Entry and Target pair example. [ { "Entry": "/directory1", + // "Target": "/bucket_name/home/mydirectory" } ] In most cases, you can use this + // value instead of the session policy to lock your user down to the designated + // home directory ("chroot"). To do this, you can set Entry to / and set Target to + // the HomeDirectory parameter value. The following is an Entry and Target pair + // example for chroot. [ { "Entry:": "/", "Target": "/bucket_name/home/mydirectory" + // } ] If the target of a logical directory entry does not exist in Amazon S3 or + // EFS, the entry is ignored. As a workaround, you can use the Amazon S3 API or EFS + // API to create 0 byte objects as place holders for your directory. If using the + // CLI, use the s3api or efsapi call instead of s3 or efs so you can use the + // put-object operation. For example, you use the following: aws s3api put-object + // --bucket bucketname --key path/to/folder/. Make sure that the end of the key + // name ends in a / for it to be considered a folder. HomeDirectoryMappings []types.HomeDirectoryMapEntry // The type of landing directory (folder) you want your users' home directory to be diff --git a/service/transfer/api_op_CreateWorkflow.go b/service/transfer/api_op_CreateWorkflow.go index d256882efda..307608e0846 100644 --- a/service/transfer/api_op_CreateWorkflow.go +++ b/service/transfer/api_op_CreateWorkflow.go @@ -45,8 +45,9 @@ type CreateWorkflowInput struct { // // * Tag: add a tag to the file // - // For file location, you - // specify either the S3 bucket and key, or the EFS filesystem ID and path. + // Currently, copying and + // tagging are supported only on S3. For file location, you specify either the S3 + // bucket and key, or the EFS filesystem ID and path. // // This member is required. Steps []types.WorkflowStep @@ -54,8 +55,10 @@ type CreateWorkflowInput struct { // A textual description for the workflow. Description *string - // Specifies the steps (actions) to take if any errors are encountered during - // execution of the workflow. + // Specifies the steps (actions) to take if errors are encountered during execution + // of the workflow. For custom steps, the lambda function needs to send FAILURE to + // the call back API to kick off the exception steps. Additionally, if the lambda + // does not send SUCCESS before it times out, the exception steps are executed. OnExceptionSteps []types.WorkflowStep // Key-value pairs that can be used to group and search for workflows. Tags are diff --git a/service/transfer/api_op_UpdateAccess.go b/service/transfer/api_op_UpdateAccess.go index 8c6cd74d1b7..5dce4c2ea54 100644 --- a/service/transfer/api_op_UpdateAccess.go +++ b/service/transfer/api_op_UpdateAccess.go @@ -62,20 +62,19 @@ type UpdateAccessInput struct { // specify a target, it is displayed as is. You also must ensure that your Amazon // Web Services Identity and Access Management (IAM) role provides access to paths // in Target. This value can only be set when HomeDirectoryType is set to LOGICAL. - // The following is an Entry and Target pair example. [ { "Entry": - // "your-personal-report.pdf", "Target": - // "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] In most cases, you - // can use this value instead of the session policy to lock down your user to the - // designated home directory ("chroot"). To do this, you can set Entry to / and set - // Target to the HomeDirectory parameter value. The following is an Entry and - // Target pair example for chroot. [ { "Entry:": "/", "Target": - // "/bucket_name/home/mydirectory" } ] If the target of a logical directory entry - // does not exist in Amazon S3 or EFS, the entry is ignored. As a workaround, you - // can use the Amazon S3 API or EFS API to create 0 byte objects as place holders - // for your directory. If using the CLI, use the s3api or efsapi call instead of s3 - // or efs so you can use the put-object operation. For example, you use the - // following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make - // sure that the end of the key name ends in a / for it to be considered a folder. + // The following is an Entry and Target pair example. [ { "Entry": "/directory1", + // "Target": "/bucket_name/home/mydirectory" } ] In most cases, you can use this + // value instead of the session policy to lock down your user to the designated + // home directory ("chroot"). To do this, you can set Entry to / and set Target to + // the HomeDirectory parameter value. The following is an Entry and Target pair + // example for chroot. [ { "Entry:": "/", "Target": "/bucket_name/home/mydirectory" + // } ] If the target of a logical directory entry does not exist in Amazon S3 or + // EFS, the entry is ignored. As a workaround, you can use the Amazon S3 API or EFS + // API to create 0 byte objects as place holders for your directory. If using the + // CLI, use the s3api or efsapi call instead of s3 or efs so you can use the + // put-object operation. For example, you use the following: aws s3api put-object + // --bucket bucketname --key path/to/folder/. Make sure that the end of the key + // name ends in a / for it to be considered a folder. HomeDirectoryMappings []types.HomeDirectoryMapEntry // The type of landing directory (folder) you want your users' home directory to be diff --git a/service/transfer/api_op_UpdateUser.go b/service/transfer/api_op_UpdateUser.go index 958228fa042..fd1342da826 100644 --- a/service/transfer/api_op_UpdateUser.go +++ b/service/transfer/api_op_UpdateUser.go @@ -58,20 +58,19 @@ type UpdateUserInput struct { // specify a target, it is displayed as is. You also must ensure that your Amazon // Web Services Identity and Access Management (IAM) role provides access to paths // in Target. This value can only be set when HomeDirectoryType is set to LOGICAL. - // The following is an Entry and Target pair example. [ { "Entry": - // "your-personal-report.pdf", "Target": - // "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] In most cases, you - // can use this value instead of the session policy to lock down your user to the - // designated home directory ("chroot"). To do this, you can set Entry to '/' and - // set Target to the HomeDirectory parameter value. The following is an Entry and - // Target pair example for chroot. [ { "Entry:": "/", "Target": - // "/bucket_name/home/mydirectory" } ] If the target of a logical directory entry - // does not exist in Amazon S3 or EFS, the entry is ignored. As a workaround, you - // can use the Amazon S3 API or EFS API to create 0 byte objects as place holders - // for your directory. If using the CLI, use the s3api or efsapi call instead of s3 - // or efs so you can use the put-object operation. For example, you use the - // following: aws s3api put-object --bucket bucketname --key path/to/folder/. Make - // sure that the end of the key name ends in a / for it to be considered a folder. + // The following is an Entry and Target pair example. [ { "Entry": "/directory1", + // "Target": "/bucket_name/home/mydirectory" } ] In most cases, you can use this + // value instead of the session policy to lock down your user to the designated + // home directory ("chroot"). To do this, you can set Entry to '/' and set Target + // to the HomeDirectory parameter value. The following is an Entry and Target pair + // example for chroot. [ { "Entry:": "/", "Target": "/bucket_name/home/mydirectory" + // } ] If the target of a logical directory entry does not exist in Amazon S3 or + // EFS, the entry is ignored. As a workaround, you can use the Amazon S3 API or EFS + // API to create 0 byte objects as place holders for your directory. If using the + // CLI, use the s3api or efsapi call instead of s3 or efs so you can use the + // put-object operation. For example, you use the following: aws s3api put-object + // --bucket bucketname --key path/to/folder/. Make sure that the end of the key + // name ends in a / for it to be considered a folder. HomeDirectoryMappings []types.HomeDirectoryMapEntry // The type of landing directory (folder) you want your users' home directory to be diff --git a/service/transfer/types/types.go b/service/transfer/types/types.go index 0956969f5e2..0371e06b29f 100644 --- a/service/transfer/types/types.go +++ b/service/transfer/types/types.go @@ -39,7 +39,7 @@ type CustomStepDetails struct { noSmithyDocumentSerde } -// The name of the step, used to identify the step that is being deleted. +// The name of the step, used to identify the delete step. type DeleteStepDetails struct { // The name of the step, used as an identifier. @@ -370,8 +370,8 @@ type DescribedWorkflow struct { // Specifies the text description for the workflow. Description *string - // Specifies the steps (actions) to take if any errors are encountered during - // execution of the workflow. + // Specifies the steps (actions) to take if errors are encountered during execution + // of the workflow. OnExceptionSteps []WorkflowStep // Specifies the details for the steps that are in the specified workflow. @@ -387,18 +387,7 @@ type DescribedWorkflow struct { noSmithyDocumentSerde } -// Specifies the details for the file location for the file being used in the -// workflow. Only applicable if you are using Amazon EFS for storage. You need to -// provide the file system ID and the pathname. The pathname can represent either a -// path or a file. This is determined by whether or not you end the path value with -// the forward slash (/) character. If the final character is "/", then your file -// is copied to the folder, and its name does not change. If, rather, the final -// character is alphanumeric, your uploaded file is renamed to the path value. In -// this case, if a file with that name already exists, it is overwritten. For -// example, if your path is shared-files/bob/, your uploaded files are copied to -// the shared-files/bob/, folder. If your path is shared-files/today, each uploaded -// file is copied to the shared-files folder and named today: each upload -// overwrites the previous version of the bob file. +// Reserved for future use. type EfsFileLocation struct { // The ID of the file system, assigned by Amazon EFS. @@ -478,8 +467,8 @@ type ExecutionError struct { // any errors during workflow execution. type ExecutionResults struct { - // Specifies the steps (actions) to take if any errors are encountered during - // execution of the workflow. + // Specifies the steps (actions) to take if errors are encountered during execution + // of the workflow. OnExceptionSteps []ExecutionStepResult // Specifies the details for the steps that are in the specified workflow. @@ -576,7 +565,7 @@ type IdentityProviderDetails struct { // type of workflow steps. type InputFileLocation struct { - // Specifies the details for the Amazon EFS file being copied. + // Reserved for future use. EfsFileLocation *EfsFileLocation // Specifies the details for the S3 file being copied. @@ -817,17 +806,7 @@ type ProtocolDetails struct { } // Specifies the details for the file location for the file being used in the -// workflow. Only applicable if you are using S3 storage. You need to provide the -// bucket and key. The key can represent either a path or a file. This is -// determined by whether or not you end the key value with the forward slash (/) -// character. If the final character is "/", then your file is copied to the -// folder, and its name does not change. If, rather, the final character is -// alphanumeric, your uploaded file is renamed to the path value. In this case, if -// a file with that name already exists, it is overwritten. For example, if your -// path is shared-files/bob/, your uploaded files are copied to the -// shared-files/bob/, folder. If your path is shared-files/today, each uploaded -// file is copied to the shared-files folder and named today: each upload -// overwrites the previous version of the bob file. +// workflow. Only applicable if you are using S3 storage. type S3FileLocation struct { // Specifies the S3 bucket that contains the file being used. @@ -847,10 +826,21 @@ type S3FileLocation struct { noSmithyDocumentSerde } -// Specifies the details for the S3 file being copied. +// Specifies the customer input S3 file location. If it is used inside +// copyStepDetails.DestinationFileLocation, it should be the S3 copy destination. +// You need to provide the bucket and key. The key can represent either a path or a +// file. This is determined by whether or not you end the key value with the +// forward slash (/) character. If the final character is "/", then your file is +// copied to the folder, and its name does not change. If, rather, the final +// character is alphanumeric, your uploaded file is renamed to the path value. In +// this case, if a file with that name already exists, it is overwritten. For +// example, if your path is shared-files/bob/, your uploaded files are copied to +// the shared-files/bob/, folder. If your path is shared-files/today, each uploaded +// file is copied to the shared-files folder and named today: each upload +// overwrites the previous version of the bob file. type S3InputFileLocation struct { - // Specifies the S3 bucket that contains the file being copied. + // Specifies the S3 bucket for the customer input file. Bucket *string // The name assigned to the file when it was created in S3. You use the object key @@ -1008,18 +998,18 @@ type WorkflowStep struct { // // * A description // - // * An S3 or EFS location for the destination of the - // file copy. + // * An S3 location for the destination of the file + // copy. // - // * A flag that indicates whether or not to overwrite an existing file - // of the same name. The default is FALSE. + // * A flag that indicates whether or not to overwrite an existing file of + // the same name. The default is FALSE. CopyStepDetails *CopyStepDetails // Details for a step that invokes a lambda function. Consists of the lambda // function name, target, and timeout (in seconds). CustomStepDetails *CustomStepDetails - // You need to specify the name of the file to be deleted. + // Details for a step that deletes the file. DeleteStepDetails *DeleteStepDetails // Details for a step that creates one or more tags. You specify one or more tags: diff --git a/service/voiceid/LICENSE.txt b/service/voiceid/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/voiceid/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/voiceid/api_client.go b/service/voiceid/api_client.go new file mode 100644 index 00000000000..f248c679a17 --- /dev/null +++ b/service/voiceid/api_client.go @@ -0,0 +1,281 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "Voice ID" +const ServiceAPIVersion = "2021-09-27" + +// Client provides the API client to make operations call for Amazon Voice ID. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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 endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer aws.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "voiceid", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +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 resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/voiceid/api_op_CreateDomain.go b/service/voiceid/api_op_CreateDomain.go new file mode 100644 index 00000000000..a16c59dc09a --- /dev/null +++ b/service/voiceid/api_op_CreateDomain.go @@ -0,0 +1,178 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a domain that contains all Amazon Connect Voice ID data, such as +// speakers, fraudsters, customer audio, and voiceprints. +func (c *Client) CreateDomain(ctx context.Context, params *CreateDomainInput, optFns ...func(*Options)) (*CreateDomainOutput, error) { + if params == nil { + params = &CreateDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDomain", params, optFns, c.addOperationCreateDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDomainInput struct { + + // The name of the domain. + // + // This member is required. + Name *string + + // The configuration, containing the KMS Key Identifier, to be used by Voice ID for + // the server-side encryption of your data. Refer to Amazon Connect VoiceID + // encryption at rest + // (https://docs.aws.amazon.com/connect/latest/adminguide/encryption-at-rest.html#encryption-at-rest-voiceid) + // for more details on how the KMS Key is used. + // + // This member is required. + ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration + + // The idempotency token for creating a new domain. If not provided, Amazon Web + // Services SDK populates this field. + ClientToken *string + + // A brief description of this domain. + Description *string + + // A list of tags you want added to the domain. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDomainOutput struct { + + // Information about the newly created domain. + Domain *types.Domain + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateDomainMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateDomain struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateDomain) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateDomain) 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.(*CreateDomainInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDomainInput ") + } + + 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_opCreateDomainMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDomain{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "CreateDomain", + } +} diff --git a/service/voiceid/api_op_DeleteDomain.go b/service/voiceid/api_op_DeleteDomain.go new file mode 100644 index 00000000000..34c8601ec48 --- /dev/null +++ b/service/voiceid/api_op_DeleteDomain.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified domain from the Amazon Connect Voice ID system. +func (c *Client) DeleteDomain(ctx context.Context, params *DeleteDomainInput, optFns ...func(*Options)) (*DeleteDomainOutput, error) { + if params == nil { + params = &DeleteDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDomain", params, optFns, c.addOperationDeleteDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDomainInput struct { + + // The identifier of the domain you want to delete. + // + // This member is required. + DomainId *string + + noSmithyDocumentSerde +} + +type DeleteDomainOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DeleteDomain", + } +} diff --git a/service/voiceid/api_op_DeleteFraudster.go b/service/voiceid/api_op_DeleteFraudster.go new file mode 100644 index 00000000000..3bde3fdeca1 --- /dev/null +++ b/service/voiceid/api_op_DeleteFraudster.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified fraudster from the Amazon Connect Voice ID system. +func (c *Client) DeleteFraudster(ctx context.Context, params *DeleteFraudsterInput, optFns ...func(*Options)) (*DeleteFraudsterOutput, error) { + if params == nil { + params = &DeleteFraudsterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteFraudster", params, optFns, c.addOperationDeleteFraudsterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteFraudsterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteFraudsterInput struct { + + // The identifier of the domain containing the fraudster. + // + // This member is required. + DomainId *string + + // The identifier of the fraudster you want to delete. + // + // This member is required. + FraudsterId *string + + noSmithyDocumentSerde +} + +type DeleteFraudsterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteFraudsterMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteFraudster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteFraudster{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteFraudsterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFraudster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteFraudster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DeleteFraudster", + } +} diff --git a/service/voiceid/api_op_DeleteSpeaker.go b/service/voiceid/api_op_DeleteSpeaker.go new file mode 100644 index 00000000000..00463d5d9a5 --- /dev/null +++ b/service/voiceid/api_op_DeleteSpeaker.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified speaker from the Amazon Connect Voice ID system. +func (c *Client) DeleteSpeaker(ctx context.Context, params *DeleteSpeakerInput, optFns ...func(*Options)) (*DeleteSpeakerOutput, error) { + if params == nil { + params = &DeleteSpeakerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSpeaker", params, optFns, c.addOperationDeleteSpeakerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSpeakerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSpeakerInput struct { + + // The identifier of the domain containing the speaker. + // + // This member is required. + DomainId *string + + // The identifier of the speaker you want to delete. + // + // This member is required. + SpeakerId *string + + noSmithyDocumentSerde +} + +type DeleteSpeakerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSpeakerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteSpeaker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteSpeaker{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSpeakerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSpeaker(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSpeaker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DeleteSpeaker", + } +} diff --git a/service/voiceid/api_op_DescribeDomain.go b/service/voiceid/api_op_DescribeDomain.go new file mode 100644 index 00000000000..a75680e9dbd --- /dev/null +++ b/service/voiceid/api_op_DescribeDomain.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified domain. +func (c *Client) DescribeDomain(ctx context.Context, params *DescribeDomainInput, optFns ...func(*Options)) (*DescribeDomainOutput, error) { + if params == nil { + params = &DescribeDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDomain", params, optFns, c.addOperationDescribeDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDomainInput struct { + + // The identifier of the domain you are describing. + // + // This member is required. + DomainId *string + + noSmithyDocumentSerde +} + +type DescribeDomainOutput struct { + + // Information about the specified domain. + Domain *types.Domain + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DescribeDomain", + } +} diff --git a/service/voiceid/api_op_DescribeFraudster.go b/service/voiceid/api_op_DescribeFraudster.go new file mode 100644 index 00000000000..eea6656892a --- /dev/null +++ b/service/voiceid/api_op_DescribeFraudster.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified fraudster. +func (c *Client) DescribeFraudster(ctx context.Context, params *DescribeFraudsterInput, optFns ...func(*Options)) (*DescribeFraudsterOutput, error) { + if params == nil { + params = &DescribeFraudsterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeFraudster", params, optFns, c.addOperationDescribeFraudsterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeFraudsterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeFraudsterInput struct { + + // The identifier of the domain containing the fraudster. + // + // This member is required. + DomainId *string + + // The identifier of the fraudster you are describing. + // + // This member is required. + FraudsterId *string + + noSmithyDocumentSerde +} + +type DescribeFraudsterOutput struct { + + // Information about the specified fraudster. + Fraudster *types.Fraudster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeFraudsterMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeFraudster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeFraudster{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeFraudsterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFraudster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeFraudster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DescribeFraudster", + } +} diff --git a/service/voiceid/api_op_DescribeFraudsterRegistrationJob.go b/service/voiceid/api_op_DescribeFraudsterRegistrationJob.go new file mode 100644 index 00000000000..69691eeecc3 --- /dev/null +++ b/service/voiceid/api_op_DescribeFraudsterRegistrationJob.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified fraudster registration job. +func (c *Client) DescribeFraudsterRegistrationJob(ctx context.Context, params *DescribeFraudsterRegistrationJobInput, optFns ...func(*Options)) (*DescribeFraudsterRegistrationJobOutput, error) { + if params == nil { + params = &DescribeFraudsterRegistrationJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeFraudsterRegistrationJob", params, optFns, c.addOperationDescribeFraudsterRegistrationJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeFraudsterRegistrationJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeFraudsterRegistrationJobInput struct { + + // The identifier for the domain containing the fraudster registration job. + // + // This member is required. + DomainId *string + + // The identifier for the fraudster registration job you are describing. + // + // This member is required. + JobId *string + + noSmithyDocumentSerde +} + +type DescribeFraudsterRegistrationJobOutput struct { + + // Contains details about the specified fraudster registration job. + Job *types.FraudsterRegistrationJob + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeFraudsterRegistrationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeFraudsterRegistrationJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeFraudsterRegistrationJob{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeFraudsterRegistrationJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFraudsterRegistrationJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeFraudsterRegistrationJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DescribeFraudsterRegistrationJob", + } +} diff --git a/service/voiceid/api_op_DescribeSpeaker.go b/service/voiceid/api_op_DescribeSpeaker.go new file mode 100644 index 00000000000..6683f127bd5 --- /dev/null +++ b/service/voiceid/api_op_DescribeSpeaker.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified speaker. +func (c *Client) DescribeSpeaker(ctx context.Context, params *DescribeSpeakerInput, optFns ...func(*Options)) (*DescribeSpeakerOutput, error) { + if params == nil { + params = &DescribeSpeakerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeSpeaker", params, optFns, c.addOperationDescribeSpeakerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeSpeakerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeSpeakerInput struct { + + // The identifier of the domain that contains the speaker. + // + // This member is required. + DomainId *string + + // The identifier of the speaker you are describing. + // + // This member is required. + SpeakerId *string + + noSmithyDocumentSerde +} + +type DescribeSpeakerOutput struct { + + // Information about the specified speaker. + Speaker *types.Speaker + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeSpeakerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeSpeaker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeSpeaker{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeSpeakerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpeaker(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeSpeaker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DescribeSpeaker", + } +} diff --git a/service/voiceid/api_op_DescribeSpeakerEnrollmentJob.go b/service/voiceid/api_op_DescribeSpeakerEnrollmentJob.go new file mode 100644 index 00000000000..a957a624c24 --- /dev/null +++ b/service/voiceid/api_op_DescribeSpeakerEnrollmentJob.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified speaker enrollment job. +func (c *Client) DescribeSpeakerEnrollmentJob(ctx context.Context, params *DescribeSpeakerEnrollmentJobInput, optFns ...func(*Options)) (*DescribeSpeakerEnrollmentJobOutput, error) { + if params == nil { + params = &DescribeSpeakerEnrollmentJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeSpeakerEnrollmentJob", params, optFns, c.addOperationDescribeSpeakerEnrollmentJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeSpeakerEnrollmentJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeSpeakerEnrollmentJobInput struct { + + // The identifier of the domain containing the speaker enrollment job. + // + // This member is required. + DomainId *string + + // The identifier of the speaker enrollment job you are describing. + // + // This member is required. + JobId *string + + noSmithyDocumentSerde +} + +type DescribeSpeakerEnrollmentJobOutput struct { + + // Contains details about the specified speaker enrollment job. + Job *types.SpeakerEnrollmentJob + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeSpeakerEnrollmentJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeSpeakerEnrollmentJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeSpeakerEnrollmentJob{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeSpeakerEnrollmentJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSpeakerEnrollmentJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeSpeakerEnrollmentJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "DescribeSpeakerEnrollmentJob", + } +} diff --git a/service/voiceid/api_op_EvaluateSession.go b/service/voiceid/api_op_EvaluateSession.go new file mode 100644 index 00000000000..a5110c598ac --- /dev/null +++ b/service/voiceid/api_op_EvaluateSession.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Evaluates a specified session based on audio data accumulated during a streaming +// Amazon Connect Voice ID call. +func (c *Client) EvaluateSession(ctx context.Context, params *EvaluateSessionInput, optFns ...func(*Options)) (*EvaluateSessionOutput, error) { + if params == nil { + params = &EvaluateSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EvaluateSession", params, optFns, c.addOperationEvaluateSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EvaluateSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type EvaluateSessionInput struct { + + // The identifier of the domain where the session started. + // + // This member is required. + DomainId *string + + // The session identifier, or name of the session, that you want to evaluate. In + // Voice ID integration, this is the Contact-Id. + // + // This member is required. + SessionNameOrId *string + + noSmithyDocumentSerde +} + +type EvaluateSessionOutput struct { + + // Details resulting from the authentication process, such as authentication + // decision and authentication score. + AuthenticationResult *types.AuthenticationResult + + // The identifier of the domain containing the session. + DomainId *string + + // Details resulting from the fraud detection process, such as fraud detection + // decision and risk score. + FraudDetectionResult *types.FraudDetectionResult + + // The service-generated identifier of the session. + SessionId *string + + // The client-provided name of the session. + SessionName *string + + // The current status of audio streaming for this session. This field is useful to + // infer next steps when the Authentication or Fraud Detection results are empty or + // the decision is NOT_ENOUGH_SPEECH. In this situation, if the StreamingStatus is + // ONGOING/PENDING_CONFIGURATION, it can mean that the client should call the API + // again later, once Voice ID has enough audio to produce a result. If the decision + // remains NOT_ENOUGH_SPEECH even after StreamingStatus is ENDED, it means that the + // previously streamed session did not have enough speech to perform evaluation, + // and a new streaming session is needed to try again. + StreamingStatus types.StreamingStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationEvaluateSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpEvaluateSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpEvaluateSession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpEvaluateSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEvaluateSession(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opEvaluateSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "EvaluateSession", + } +} diff --git a/service/voiceid/api_op_ListDomains.go b/service/voiceid/api_op_ListDomains.go new file mode 100644 index 00000000000..7308478d32e --- /dev/null +++ b/service/voiceid/api_op_ListDomains.go @@ -0,0 +1,218 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the domains in the Amazon Web Services account. +func (c *Client) ListDomains(ctx context.Context, params *ListDomainsInput, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if params == nil { + params = &ListDomainsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDomains", params, optFns, c.addOperationListDomainsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDomainsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDomainsInput struct { + + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + MaxResults *int32 + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDomainsOutput struct { + + // A list containing details about each domain in the Amazon Web Services account. + DomainSummaries []types.DomainSummary + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListDomains{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListDomains{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDomains(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + 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 +} + +// ListDomainsPaginator is a paginator for ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + if params == nil { + params = &ListDomainsInput{} + } + + options := ListDomainsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "ListDomains", + } +} diff --git a/service/voiceid/api_op_ListFraudsterRegistrationJobs.go b/service/voiceid/api_op_ListFraudsterRegistrationJobs.go new file mode 100644 index 00000000000..925df544ed8 --- /dev/null +++ b/service/voiceid/api_op_ListFraudsterRegistrationJobs.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the fraudster registration jobs in the domain with the given +// JobStatus. If JobStatus is not provided, this lists all fraudster registration +// jobs in the given domain. +func (c *Client) ListFraudsterRegistrationJobs(ctx context.Context, params *ListFraudsterRegistrationJobsInput, optFns ...func(*Options)) (*ListFraudsterRegistrationJobsOutput, error) { + if params == nil { + params = &ListFraudsterRegistrationJobsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFraudsterRegistrationJobs", params, optFns, c.addOperationListFraudsterRegistrationJobsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFraudsterRegistrationJobsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFraudsterRegistrationJobsInput struct { + + // The identifier of the domain containing the fraudster registration Jobs. + // + // This member is required. + DomainId *string + + // Provides the status of your fraudster registration job. + JobStatus types.FraudsterRegistrationJobStatus + + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + MaxResults *int32 + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type ListFraudsterRegistrationJobsOutput struct { + + // A list containing details about each specified fraudster registration job. + JobSummaries []types.FraudsterRegistrationJobSummary + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFraudsterRegistrationJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListFraudsterRegistrationJobs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListFraudsterRegistrationJobs{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListFraudsterRegistrationJobsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFraudsterRegistrationJobs(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListFraudsterRegistrationJobsAPIClient is a client that implements the +// ListFraudsterRegistrationJobs operation. +type ListFraudsterRegistrationJobsAPIClient interface { + ListFraudsterRegistrationJobs(context.Context, *ListFraudsterRegistrationJobsInput, ...func(*Options)) (*ListFraudsterRegistrationJobsOutput, error) +} + +var _ ListFraudsterRegistrationJobsAPIClient = (*Client)(nil) + +// ListFraudsterRegistrationJobsPaginatorOptions is the paginator options for +// ListFraudsterRegistrationJobs +type ListFraudsterRegistrationJobsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + 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 +} + +// ListFraudsterRegistrationJobsPaginator is a paginator for +// ListFraudsterRegistrationJobs +type ListFraudsterRegistrationJobsPaginator struct { + options ListFraudsterRegistrationJobsPaginatorOptions + client ListFraudsterRegistrationJobsAPIClient + params *ListFraudsterRegistrationJobsInput + nextToken *string + firstPage bool +} + +// NewListFraudsterRegistrationJobsPaginator returns a new +// ListFraudsterRegistrationJobsPaginator +func NewListFraudsterRegistrationJobsPaginator(client ListFraudsterRegistrationJobsAPIClient, params *ListFraudsterRegistrationJobsInput, optFns ...func(*ListFraudsterRegistrationJobsPaginatorOptions)) *ListFraudsterRegistrationJobsPaginator { + if params == nil { + params = &ListFraudsterRegistrationJobsInput{} + } + + options := ListFraudsterRegistrationJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFraudsterRegistrationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFraudsterRegistrationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFraudsterRegistrationJobs page. +func (p *ListFraudsterRegistrationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFraudsterRegistrationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListFraudsterRegistrationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListFraudsterRegistrationJobs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "ListFraudsterRegistrationJobs", + } +} diff --git a/service/voiceid/api_op_ListSpeakerEnrollmentJobs.go b/service/voiceid/api_op_ListSpeakerEnrollmentJobs.go new file mode 100644 index 00000000000..fda41383b28 --- /dev/null +++ b/service/voiceid/api_op_ListSpeakerEnrollmentJobs.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the speaker enrollment jobs in the domain with the specified +// JobStatus. If JobStatus is not provided, this lists all jobs with all possible +// speaker enrollment job statuses. +func (c *Client) ListSpeakerEnrollmentJobs(ctx context.Context, params *ListSpeakerEnrollmentJobsInput, optFns ...func(*Options)) (*ListSpeakerEnrollmentJobsOutput, error) { + if params == nil { + params = &ListSpeakerEnrollmentJobsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSpeakerEnrollmentJobs", params, optFns, c.addOperationListSpeakerEnrollmentJobsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSpeakerEnrollmentJobsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSpeakerEnrollmentJobsInput struct { + + // The identifier of the domain containing the speaker enrollment jobs. + // + // This member is required. + DomainId *string + + // Provides the status of your speaker enrollment Job. + JobStatus types.SpeakerEnrollmentJobStatus + + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + MaxResults *int32 + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSpeakerEnrollmentJobsOutput struct { + + // A list containing details about each specified speaker enrollment job. + JobSummaries []types.SpeakerEnrollmentJobSummary + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSpeakerEnrollmentJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListSpeakerEnrollmentJobs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListSpeakerEnrollmentJobs{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListSpeakerEnrollmentJobsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSpeakerEnrollmentJobs(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSpeakerEnrollmentJobsAPIClient is a client that implements the +// ListSpeakerEnrollmentJobs operation. +type ListSpeakerEnrollmentJobsAPIClient interface { + ListSpeakerEnrollmentJobs(context.Context, *ListSpeakerEnrollmentJobsInput, ...func(*Options)) (*ListSpeakerEnrollmentJobsOutput, error) +} + +var _ ListSpeakerEnrollmentJobsAPIClient = (*Client)(nil) + +// ListSpeakerEnrollmentJobsPaginatorOptions is the paginator options for +// ListSpeakerEnrollmentJobs +type ListSpeakerEnrollmentJobsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + 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 +} + +// ListSpeakerEnrollmentJobsPaginator is a paginator for ListSpeakerEnrollmentJobs +type ListSpeakerEnrollmentJobsPaginator struct { + options ListSpeakerEnrollmentJobsPaginatorOptions + client ListSpeakerEnrollmentJobsAPIClient + params *ListSpeakerEnrollmentJobsInput + nextToken *string + firstPage bool +} + +// NewListSpeakerEnrollmentJobsPaginator returns a new +// ListSpeakerEnrollmentJobsPaginator +func NewListSpeakerEnrollmentJobsPaginator(client ListSpeakerEnrollmentJobsAPIClient, params *ListSpeakerEnrollmentJobsInput, optFns ...func(*ListSpeakerEnrollmentJobsPaginatorOptions)) *ListSpeakerEnrollmentJobsPaginator { + if params == nil { + params = &ListSpeakerEnrollmentJobsInput{} + } + + options := ListSpeakerEnrollmentJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSpeakerEnrollmentJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSpeakerEnrollmentJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSpeakerEnrollmentJobs page. +func (p *ListSpeakerEnrollmentJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSpeakerEnrollmentJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListSpeakerEnrollmentJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListSpeakerEnrollmentJobs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "ListSpeakerEnrollmentJobs", + } +} diff --git a/service/voiceid/api_op_ListSpeakers.go b/service/voiceid/api_op_ListSpeakers.go new file mode 100644 index 00000000000..81bf83baa3a --- /dev/null +++ b/service/voiceid/api_op_ListSpeakers.go @@ -0,0 +1,226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all speakers in a specified domain. +func (c *Client) ListSpeakers(ctx context.Context, params *ListSpeakersInput, optFns ...func(*Options)) (*ListSpeakersOutput, error) { + if params == nil { + params = &ListSpeakersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSpeakers", params, optFns, c.addOperationListSpeakersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSpeakersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSpeakersInput struct { + + // The identifier of the domain. + // + // This member is required. + DomainId *string + + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + MaxResults *int32 + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSpeakersOutput struct { + + // If NextToken is returned, there are more results available. The value of + // NextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. + NextToken *string + + // A list containing details about each speaker in the Amazon Web Services account. + SpeakerSummaries []types.SpeakerSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSpeakersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListSpeakers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListSpeakers{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListSpeakersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSpeakers(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSpeakersAPIClient is a client that implements the ListSpeakers operation. +type ListSpeakersAPIClient interface { + ListSpeakers(context.Context, *ListSpeakersInput, ...func(*Options)) (*ListSpeakersOutput, error) +} + +var _ ListSpeakersAPIClient = (*Client)(nil) + +// ListSpeakersPaginatorOptions is the paginator options for ListSpeakers +type ListSpeakersPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use NextToken + // to obtain further pages of results. The default is 100; the maximum allowed page + // size is also 100. + 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 +} + +// ListSpeakersPaginator is a paginator for ListSpeakers +type ListSpeakersPaginator struct { + options ListSpeakersPaginatorOptions + client ListSpeakersAPIClient + params *ListSpeakersInput + nextToken *string + firstPage bool +} + +// NewListSpeakersPaginator returns a new ListSpeakersPaginator +func NewListSpeakersPaginator(client ListSpeakersAPIClient, params *ListSpeakersInput, optFns ...func(*ListSpeakersPaginatorOptions)) *ListSpeakersPaginator { + if params == nil { + params = &ListSpeakersInput{} + } + + options := ListSpeakersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSpeakersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSpeakersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSpeakers page. +func (p *ListSpeakersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSpeakersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListSpeakers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListSpeakers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "ListSpeakers", + } +} diff --git a/service/voiceid/api_op_ListTagsForResource.go b/service/voiceid/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..b3c62639ce5 --- /dev/null +++ b/service/voiceid/api_op_ListTagsForResource.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all tags associated with a specified Voice ID 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 +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) of the Voice ID resource for which you want to + // list the tags. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The list of tags associated with the specified resource. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "ListTagsForResource", + } +} diff --git a/service/voiceid/api_op_OptOutSpeaker.go b/service/voiceid/api_op_OptOutSpeaker.go new file mode 100644 index 00000000000..bb4b9e75204 --- /dev/null +++ b/service/voiceid/api_op_OptOutSpeaker.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Opts out a speaker from Voice ID system. A speaker can be opted out regardless +// of whether or not they already exist in the system. If they don't yet exist, a +// new speaker is created in an opted out state. If they already exist, their +// existing status is overridden and they are opted out. Enrollment and evaluation +// authentication requests are rejected for opted out speakers, and opted out +// speakers have no voice embeddings stored in the system. +func (c *Client) OptOutSpeaker(ctx context.Context, params *OptOutSpeakerInput, optFns ...func(*Options)) (*OptOutSpeakerOutput, error) { + if params == nil { + params = &OptOutSpeakerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "OptOutSpeaker", params, optFns, c.addOperationOptOutSpeakerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*OptOutSpeakerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type OptOutSpeakerInput struct { + + // The identifier of the domain containing the speaker. + // + // This member is required. + DomainId *string + + // The identifier of the speaker you want opted-out. + // + // This member is required. + SpeakerId *string + + noSmithyDocumentSerde +} + +type OptOutSpeakerOutput struct { + + // Details about the opted-out speaker. + Speaker *types.Speaker + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationOptOutSpeakerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpOptOutSpeaker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpOptOutSpeaker{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpOptOutSpeakerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opOptOutSpeaker(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opOptOutSpeaker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "OptOutSpeaker", + } +} diff --git a/service/voiceid/api_op_StartFraudsterRegistrationJob.go b/service/voiceid/api_op_StartFraudsterRegistrationJob.go new file mode 100644 index 00000000000..e6d3ee691ea --- /dev/null +++ b/service/voiceid/api_op_StartFraudsterRegistrationJob.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a new batch fraudster registration job using provided details. +func (c *Client) StartFraudsterRegistrationJob(ctx context.Context, params *StartFraudsterRegistrationJobInput, optFns ...func(*Options)) (*StartFraudsterRegistrationJobOutput, error) { + if params == nil { + params = &StartFraudsterRegistrationJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartFraudsterRegistrationJob", params, optFns, c.addOperationStartFraudsterRegistrationJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartFraudsterRegistrationJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartFraudsterRegistrationJobInput struct { + + // The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to + // access customer's buckets to read the input manifest file and write the Job + // output file. Refer to the Create and edit a fraudster watchlist + // (https://docs.aws.amazon.com/connect/latest/adminguide/voiceid-fraudster-watchlist.html) + // documentation for the permissions needed in this role. + // + // This member is required. + DataAccessRoleArn *string + + // The identifier of the domain containing the fraudster registration job and in + // which the fraudsters are registered. + // + // This member is required. + DomainId *string + + // The input data config containing an S3 URI for the input manifest file that + // contains the list of fraudster registration requests. + // + // This member is required. + InputDataConfig *types.InputDataConfig + + // The output data config containing the S3 location where Voice ID writes the job + // output file; you must also include a KMS Key ID to encrypt the file. + // + // This member is required. + OutputDataConfig *types.OutputDataConfig + + // The idempotency token for starting a new fraudster registration job. If not + // provided, Amazon Web Services SDK populates this field. + ClientToken *string + + // The name of the new fraudster registration job. + JobName *string + + // The registration config containing details such as the action to take when a + // duplicate fraudster is detected, and the similarity threshold to use for + // detecting a duplicate fraudster. + RegistrationConfig *types.RegistrationConfig + + noSmithyDocumentSerde +} + +type StartFraudsterRegistrationJobOutput struct { + + // Details about the started fraudster registration job. + Job *types.FraudsterRegistrationJob + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartFraudsterRegistrationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpStartFraudsterRegistrationJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStartFraudsterRegistrationJob{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opStartFraudsterRegistrationJobMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartFraudsterRegistrationJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartFraudsterRegistrationJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpStartFraudsterRegistrationJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartFraudsterRegistrationJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartFraudsterRegistrationJob) 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.(*StartFraudsterRegistrationJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartFraudsterRegistrationJobInput ") + } + + 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_opStartFraudsterRegistrationJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartFraudsterRegistrationJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartFraudsterRegistrationJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "StartFraudsterRegistrationJob", + } +} diff --git a/service/voiceid/api_op_StartSpeakerEnrollmentJob.go b/service/voiceid/api_op_StartSpeakerEnrollmentJob.go new file mode 100644 index 00000000000..b4861a9da49 --- /dev/null +++ b/service/voiceid/api_op_StartSpeakerEnrollmentJob.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a new batch speaker enrollment job using specified details. +func (c *Client) StartSpeakerEnrollmentJob(ctx context.Context, params *StartSpeakerEnrollmentJobInput, optFns ...func(*Options)) (*StartSpeakerEnrollmentJobOutput, error) { + if params == nil { + params = &StartSpeakerEnrollmentJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartSpeakerEnrollmentJob", params, optFns, c.addOperationStartSpeakerEnrollmentJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartSpeakerEnrollmentJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartSpeakerEnrollmentJobInput struct { + + // The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to + // access customer's buckets to read the input manifest file and write the job + // output file. Refer to Batch enrollment using audio data from prior calls + // (https://docs.aws.amazon.com/connect/latest/adminguide/voiceid-batch-enrollment.html) + // documentation for the permissions needed in this role. + // + // This member is required. + DataAccessRoleArn *string + + // The identifier of the domain that contains the speaker enrollment job and in + // which the speakers are enrolled. + // + // This member is required. + DomainId *string + + // The input data config containing the S3 location for the input manifest file + // that contains the list of speaker enrollment requests. + // + // This member is required. + InputDataConfig *types.InputDataConfig + + // The output data config containing the S3 location where Voice ID writes the job + // output file; you must also include a KMS Key ID to encrypt the file. + // + // This member is required. + OutputDataConfig *types.OutputDataConfig + + // The idempotency token for starting a new speaker enrollment Job. If not + // provided, Amazon Web Services SDK populates this field. + ClientToken *string + + // The enrollment config that contains details such as the action to take when a + // speaker is already enrolled in the Voice ID system or when a speaker is + // identified as a fraudster. + EnrollmentConfig *types.EnrollmentConfig + + // A name for your speaker enrollment job. + JobName *string + + noSmithyDocumentSerde +} + +type StartSpeakerEnrollmentJobOutput struct { + + // Details about the started speaker enrollment job. + Job *types.SpeakerEnrollmentJob + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartSpeakerEnrollmentJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpStartSpeakerEnrollmentJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStartSpeakerEnrollmentJob{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opStartSpeakerEnrollmentJobMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartSpeakerEnrollmentJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSpeakerEnrollmentJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpStartSpeakerEnrollmentJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartSpeakerEnrollmentJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartSpeakerEnrollmentJob) 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.(*StartSpeakerEnrollmentJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartSpeakerEnrollmentJobInput ") + } + + 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_opStartSpeakerEnrollmentJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartSpeakerEnrollmentJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartSpeakerEnrollmentJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "StartSpeakerEnrollmentJob", + } +} diff --git a/service/voiceid/api_op_TagResource.go b/service/voiceid/api_op_TagResource.go new file mode 100644 index 00000000000..269d0bebc07 --- /dev/null +++ b/service/voiceid/api_op_TagResource.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Tags an Amazon Connect Voice ID resource with the provided list of tags. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the Voice ID resource you want to tag. + // + // This member is required. + ResourceArn *string + + // The list of tags to assign to the specified resource. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "TagResource", + } +} diff --git a/service/voiceid/api_op_UntagResource.go b/service/voiceid/api_op_UntagResource.go new file mode 100644 index 00000000000..06b29cbea6d --- /dev/null +++ b/service/voiceid/api_op_UntagResource.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes specified tags from a specified Amazon Connect Voice ID 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 +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the Voice ID resource you want to remove tags + // from. + // + // This member is required. + ResourceArn *string + + // The list of tag keys you want to remove from the specified resource. + // + // 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) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "UntagResource", + } +} diff --git a/service/voiceid/api_op_UpdateDomain.go b/service/voiceid/api_op_UpdateDomain.go new file mode 100644 index 00000000000..4bed75e6d98 --- /dev/null +++ b/service/voiceid/api_op_UpdateDomain.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the specified domain. This API has clobber behavior, and clears and +// replaces all attributes. If an optional field, such as 'Description' is not +// provided, it is removed from the domain. +func (c *Client) UpdateDomain(ctx context.Context, params *UpdateDomainInput, optFns ...func(*Options)) (*UpdateDomainOutput, error) { + if params == nil { + params = &UpdateDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDomain", params, optFns, c.addOperationUpdateDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDomainInput struct { + + // The identifier of the domain to be updated. + // + // This member is required. + DomainId *string + + // The name of the domain. + // + // This member is required. + Name *string + + // The configuration, containing the KMS Key Identifier, to be used by Voice ID for + // the server-side encryption of your data. Note that all the existing data in the + // domain are still encrypted using the existing key, only the data added to domain + // after updating the key is encrypted using the new key. + // + // This member is required. + ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration + + // A brief description about this domain. + Description *string + + noSmithyDocumentSerde +} + +type UpdateDomainOutput struct { + + // Details about the updated domain + Domain *types.Domain + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "voiceid", + OperationName: "UpdateDomain", + } +} diff --git a/service/voiceid/deserializers.go b/service/voiceid/deserializers.go new file mode 100644 index 00000000000..07a386050e7 --- /dev/null +++ b/service/voiceid/deserializers.go @@ -0,0 +1,5824 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strings" +) + +type awsAwsjson10_deserializeOpCreateDomain struct { +} + +func (*awsAwsjson10_deserializeOpCreateDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreateDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorCreateDomain(response, &metadata) + } + output := &CreateDomainOutput{} + 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_deserializeOpDocumentCreateDomainOutput(&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_deserializeOpErrorCreateDomain(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDeleteDomain struct { +} + +func (*awsAwsjson10_deserializeOpDeleteDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteDomain(response, &metadata) + } + output := &DeleteDomainOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeleteDomain(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDeleteFraudster struct { +} + +func (*awsAwsjson10_deserializeOpDeleteFraudster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteFraudster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteFraudster(response, &metadata) + } + output := &DeleteFraudsterOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeleteFraudster(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDeleteSpeaker struct { +} + +func (*awsAwsjson10_deserializeOpDeleteSpeaker) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteSpeaker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteSpeaker(response, &metadata) + } + output := &DeleteSpeakerOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeleteSpeaker(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDescribeDomain struct { +} + +func (*awsAwsjson10_deserializeOpDescribeDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDescribeDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeDomain(response, &metadata) + } + output := &DescribeDomainOutput{} + 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_deserializeOpDocumentDescribeDomainOutput(&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_deserializeOpErrorDescribeDomain(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDescribeFraudster struct { +} + +func (*awsAwsjson10_deserializeOpDescribeFraudster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDescribeFraudster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeFraudster(response, &metadata) + } + output := &DescribeFraudsterOutput{} + 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_deserializeOpDocumentDescribeFraudsterOutput(&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_deserializeOpErrorDescribeFraudster(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDescribeFraudsterRegistrationJob struct { +} + +func (*awsAwsjson10_deserializeOpDescribeFraudsterRegistrationJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDescribeFraudsterRegistrationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeFraudsterRegistrationJob(response, &metadata) + } + output := &DescribeFraudsterRegistrationJobOutput{} + 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_deserializeOpDocumentDescribeFraudsterRegistrationJobOutput(&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_deserializeOpErrorDescribeFraudsterRegistrationJob(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDescribeSpeaker struct { +} + +func (*awsAwsjson10_deserializeOpDescribeSpeaker) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDescribeSpeaker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeSpeaker(response, &metadata) + } + output := &DescribeSpeakerOutput{} + 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_deserializeOpDocumentDescribeSpeakerOutput(&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_deserializeOpErrorDescribeSpeaker(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpDescribeSpeakerEnrollmentJob struct { +} + +func (*awsAwsjson10_deserializeOpDescribeSpeakerEnrollmentJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDescribeSpeakerEnrollmentJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeSpeakerEnrollmentJob(response, &metadata) + } + output := &DescribeSpeakerEnrollmentJobOutput{} + 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_deserializeOpDocumentDescribeSpeakerEnrollmentJobOutput(&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_deserializeOpErrorDescribeSpeakerEnrollmentJob(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpEvaluateSession struct { +} + +func (*awsAwsjson10_deserializeOpEvaluateSession) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpEvaluateSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorEvaluateSession(response, &metadata) + } + output := &EvaluateSessionOutput{} + 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_deserializeOpDocumentEvaluateSessionOutput(&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_deserializeOpErrorEvaluateSession(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpListDomains struct { +} + +func (*awsAwsjson10_deserializeOpListDomains) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListDomains(response, &metadata) + } + output := &ListDomainsOutput{} + 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_deserializeOpDocumentListDomainsOutput(&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_deserializeOpErrorListDomains(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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("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_deserializeOpListFraudsterRegistrationJobs struct { +} + +func (*awsAwsjson10_deserializeOpListFraudsterRegistrationJobs) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListFraudsterRegistrationJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListFraudsterRegistrationJobs(response, &metadata) + } + output := &ListFraudsterRegistrationJobsOutput{} + 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_deserializeOpDocumentListFraudsterRegistrationJobsOutput(&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_deserializeOpErrorListFraudsterRegistrationJobs(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpListSpeakerEnrollmentJobs struct { +} + +func (*awsAwsjson10_deserializeOpListSpeakerEnrollmentJobs) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListSpeakerEnrollmentJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListSpeakerEnrollmentJobs(response, &metadata) + } + output := &ListSpeakerEnrollmentJobsOutput{} + 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_deserializeOpDocumentListSpeakerEnrollmentJobsOutput(&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_deserializeOpErrorListSpeakerEnrollmentJobs(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpListSpeakers struct { +} + +func (*awsAwsjson10_deserializeOpListSpeakers) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListSpeakers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListSpeakers(response, &metadata) + } + output := &ListSpeakersOutput{} + 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_deserializeOpDocumentListSpeakersOutput(&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_deserializeOpErrorListSpeakers(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +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) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_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 = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func 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)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpOptOutSpeaker struct { +} + +func (*awsAwsjson10_deserializeOpOptOutSpeaker) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpOptOutSpeaker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorOptOutSpeaker(response, &metadata) + } + output := &OptOutSpeakerOutput{} + 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_deserializeOpDocumentOptOutSpeakerOutput(&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_deserializeOpErrorOptOutSpeaker(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpStartFraudsterRegistrationJob struct { +} + +func (*awsAwsjson10_deserializeOpStartFraudsterRegistrationJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpStartFraudsterRegistrationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorStartFraudsterRegistrationJob(response, &metadata) + } + output := &StartFraudsterRegistrationJobOutput{} + 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_deserializeOpDocumentStartFraudsterRegistrationJobOutput(&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_deserializeOpErrorStartFraudsterRegistrationJob(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpStartSpeakerEnrollmentJob struct { +} + +func (*awsAwsjson10_deserializeOpStartSpeakerEnrollmentJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpStartSpeakerEnrollmentJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorStartSpeakerEnrollmentJob(response, &metadata) + } + output := &StartSpeakerEnrollmentJobOutput{} + 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_deserializeOpDocumentStartSpeakerEnrollmentJobOutput(&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_deserializeOpErrorStartSpeakerEnrollmentJob(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpTagResource struct { +} + +func (*awsAwsjson10_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + 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_deserializeOpDocumentTagResourceOutput(&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_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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpUntagResource struct { +} + +func (*awsAwsjson10_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + 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_deserializeOpDocumentUntagResourceOutput(&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_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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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_deserializeOpUpdateDomain struct { +} + +func (*awsAwsjson10_deserializeOpUpdateDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateDomain(response, &metadata) + } + output := &UpdateDomainOutput{} + 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_deserializeOpDocumentUpdateDomainOutput(&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_deserializeOpErrorUpdateDomain(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = 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 + + } +} + +func awsAwsjson10_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AccessDeniedException{} + err := awsAwsjson10_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConflictException{} + err := awsAwsjson10_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InternalServerException{} + err := awsAwsjson10_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) + return output +} + +func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceNotFoundException{} + err := awsAwsjson10_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson10_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson10_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson10_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentAuthenticationConfiguration(v **types.AuthenticationConfiguration, 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.AuthenticationConfiguration + if *v == nil { + sv = &types.AuthenticationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AcceptanceThreshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Score to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AcceptanceThreshold = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentAuthenticationResult(v **types.AuthenticationResult, 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.AuthenticationResult + if *v == nil { + sv = &types.AuthenticationResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AudioAggregationEndedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.AudioAggregationEndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "AudioAggregationStartedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.AudioAggregationStartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "AuthenticationResultId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UniqueIdLarge to be of type string, got %T instead", value) + } + sv.AuthenticationResultId = ptr.String(jtv) + } + + case "Configuration": + if err := awsAwsjson10_deserializeDocumentAuthenticationConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "CustomerSpeakerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomerSpeakerId to be of type string, got %T instead", value) + } + sv.CustomerSpeakerId = ptr.String(jtv) + } + + case "Decision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthenticationDecision to be of type string, got %T instead", value) + } + sv.Decision = types.AuthenticationDecision(jtv) + } + + case "GeneratedSpeakerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeneratedSpeakerId to be of type string, got %T instead", value) + } + sv.GeneratedSpeakerId = ptr.String(jtv) + } + + case "Score": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Score to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Score = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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 "ConflictType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConflictType to be of type string, got %T instead", value) + } + sv.ConflictType = types.ConflictType(jtv) + } + + case "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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDomain(v **types.Domain, 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.Domain + if *v == nil { + sv = &types.Domain{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "DomainStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainStatus to be of type string, got %T instead", value) + } + sv.DomainStatus = types.DomainStatus(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ServerSideEncryptionConfiguration": + if err := awsAwsjson10_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDomainSummaries(v *[]types.DomainSummary, 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.DomainSummary + if *v == nil { + cv = []types.DomainSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DomainSummary + destAddr := &col + if err := awsAwsjson10_deserializeDocumentDomainSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentDomainSummary(v **types.DomainSummary, 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.DomainSummary + if *v == nil { + sv = &types.DomainSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "DomainStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainStatus to be of type string, got %T instead", value) + } + sv.DomainStatus = types.DomainStatus(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ServerSideEncryptionConfiguration": + if err := awsAwsjson10_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEnrollmentConfig(v **types.EnrollmentConfig, 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.EnrollmentConfig + if *v == nil { + sv = &types.EnrollmentConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExistingEnrollmentAction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExistingEnrollmentAction to be of type string, got %T instead", value) + } + sv.ExistingEnrollmentAction = types.ExistingEnrollmentAction(jtv) + } + + case "FraudDetectionConfig": + if err := awsAwsjson10_deserializeDocumentEnrollmentJobFraudDetectionConfig(&sv.FraudDetectionConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentEnrollmentJobFraudDetectionConfig(v **types.EnrollmentJobFraudDetectionConfig, 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.EnrollmentJobFraudDetectionConfig + if *v == nil { + sv = &types.EnrollmentJobFraudDetectionConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FraudDetectionAction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FraudDetectionAction to be of type string, got %T instead", value) + } + sv.FraudDetectionAction = types.FraudDetectionAction(jtv) + } + + case "RiskThreshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Score to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RiskThreshold = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFailureDetails(v **types.FailureDetails, 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.FailureDetails + if *v == nil { + sv = &types.FailureDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "StatusCode": + 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.StatusCode = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudDetectionConfiguration(v **types.FraudDetectionConfiguration, 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.FraudDetectionConfiguration + if *v == nil { + sv = &types.FraudDetectionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RiskThreshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Score to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RiskThreshold = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudDetectionReasons(v *[]types.FraudDetectionReason, 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.FraudDetectionReason + if *v == nil { + cv = []types.FraudDetectionReason{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FraudDetectionReason + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FraudDetectionReason to be of type string, got %T instead", value) + } + col = types.FraudDetectionReason(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudDetectionResult(v **types.FraudDetectionResult, 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.FraudDetectionResult + if *v == nil { + sv = &types.FraudDetectionResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AudioAggregationEndedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.AudioAggregationEndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "AudioAggregationStartedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.AudioAggregationStartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Configuration": + if err := awsAwsjson10_deserializeDocumentFraudDetectionConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "Decision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FraudDetectionDecision to be of type string, got %T instead", value) + } + sv.Decision = types.FraudDetectionDecision(jtv) + } + + case "FraudDetectionResultId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UniqueIdLarge to be of type string, got %T instead", value) + } + sv.FraudDetectionResultId = ptr.String(jtv) + } + + case "Reasons": + if err := awsAwsjson10_deserializeDocumentFraudDetectionReasons(&sv.Reasons, value); err != nil { + return err + } + + case "RiskDetails": + if err := awsAwsjson10_deserializeDocumentFraudRiskDetails(&sv.RiskDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudRiskDetails(v **types.FraudRiskDetails, 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.FraudRiskDetails + if *v == nil { + sv = &types.FraudRiskDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KnownFraudsterRisk": + if err := awsAwsjson10_deserializeDocumentKnownFraudsterRisk(&sv.KnownFraudsterRisk, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudster(v **types.Fraudster, 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.Fraudster + if *v == nil { + sv = &types.Fraudster{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "GeneratedFraudsterId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeneratedFraudsterId to be of type string, got %T instead", value) + } + sv.GeneratedFraudsterId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudsterRegistrationJob(v **types.FraudsterRegistrationJob, 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.FraudsterRegistrationJob + if *v == nil { + sv = &types.FraudsterRegistrationJob{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DataAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) + } + sv.DataAccessRoleArn = ptr.String(jtv) + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "EndedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "FailureDetails": + if err := awsAwsjson10_deserializeDocumentFailureDetails(&sv.FailureDetails, value); err != nil { + return err + } + + case "InputDataConfig": + if err := awsAwsjson10_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { + return err + } + + case "JobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } + + case "JobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobName to be of type string, got %T instead", value) + } + sv.JobName = ptr.String(jtv) + } + + case "JobProgress": + if err := awsAwsjson10_deserializeDocumentJobProgress(&sv.JobProgress, value); err != nil { + return err + } + + case "JobStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FraudsterRegistrationJobStatus to be of type string, got %T instead", value) + } + sv.JobStatus = types.FraudsterRegistrationJobStatus(jtv) + } + + case "OutputDataConfig": + if err := awsAwsjson10_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { + return err + } + + case "RegistrationConfig": + if err := awsAwsjson10_deserializeDocumentRegistrationConfig(&sv.RegistrationConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudsterRegistrationJobSummaries(v *[]types.FraudsterRegistrationJobSummary, 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.FraudsterRegistrationJobSummary + if *v == nil { + cv = []types.FraudsterRegistrationJobSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FraudsterRegistrationJobSummary + destAddr := &col + if err := awsAwsjson10_deserializeDocumentFraudsterRegistrationJobSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentFraudsterRegistrationJobSummary(v **types.FraudsterRegistrationJobSummary, 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.FraudsterRegistrationJobSummary + if *v == nil { + sv = &types.FraudsterRegistrationJobSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "EndedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "FailureDetails": + if err := awsAwsjson10_deserializeDocumentFailureDetails(&sv.FailureDetails, value); err != nil { + return err + } + + case "JobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } + + case "JobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobName to be of type string, got %T instead", value) + } + sv.JobName = ptr.String(jtv) + } + + case "JobProgress": + if err := awsAwsjson10_deserializeDocumentJobProgress(&sv.JobProgress, value); err != nil { + return err + } + + case "JobStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FraudsterRegistrationJobStatus to be of type string, got %T instead", value) + } + sv.JobStatus = types.FraudsterRegistrationJobStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInputDataConfig(v **types.InputDataConfig, 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.InputDataConfig + if *v == nil { + sv = &types.InputDataConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "S3Uri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) + } + sv.S3Uri = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentJobProgress(v **types.JobProgress, 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.JobProgress + if *v == nil { + sv = &types.JobProgress{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PercentComplete": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Score to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.PercentComplete = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentKnownFraudsterRisk(v **types.KnownFraudsterRisk, 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.KnownFraudsterRisk + if *v == nil { + sv = &types.KnownFraudsterRisk{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GeneratedFraudsterId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeneratedFraudsterId to be of type string, got %T instead", value) + } + sv.GeneratedFraudsterId = ptr.String(jtv) + } + + case "RiskScore": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Score to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RiskScore = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentOutputDataConfig(v **types.OutputDataConfig, 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.OutputDataConfig + if *v == nil { + sv = &types.OutputDataConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "S3Uri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) + } + sv.S3Uri = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRegistrationConfig(v **types.RegistrationConfig, 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.RegistrationConfig + if *v == nil { + sv = &types.RegistrationConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DuplicateRegistrationAction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DuplicateRegistrationAction to be of type string, got %T instead", value) + } + sv.DuplicateRegistrationAction = types.DuplicateRegistrationAction(jtv) + } + + case "FraudsterSimilarityThreshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Score to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FraudsterSimilarityThreshold = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = types.ResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentServerSideEncryptionConfiguration(v **types.ServerSideEncryptionConfiguration, 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.ServerSideEncryptionConfiguration + if *v == nil { + sv = &types.ServerSideEncryptionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSpeaker(v **types.Speaker, 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.Speaker + if *v == nil { + sv = &types.Speaker{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CustomerSpeakerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomerSpeakerId to be of type string, got %T instead", value) + } + sv.CustomerSpeakerId = ptr.String(jtv) + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "GeneratedSpeakerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeneratedSpeakerId to be of type string, got %T instead", value) + } + sv.GeneratedSpeakerId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpeakerStatus to be of type string, got %T instead", value) + } + sv.Status = types.SpeakerStatus(jtv) + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSpeakerEnrollmentJob(v **types.SpeakerEnrollmentJob, 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.SpeakerEnrollmentJob + if *v == nil { + sv = &types.SpeakerEnrollmentJob{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DataAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) + } + sv.DataAccessRoleArn = ptr.String(jtv) + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "EndedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "EnrollmentConfig": + if err := awsAwsjson10_deserializeDocumentEnrollmentConfig(&sv.EnrollmentConfig, value); err != nil { + return err + } + + case "FailureDetails": + if err := awsAwsjson10_deserializeDocumentFailureDetails(&sv.FailureDetails, value); err != nil { + return err + } + + case "InputDataConfig": + if err := awsAwsjson10_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { + return err + } + + case "JobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } + + case "JobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobName to be of type string, got %T instead", value) + } + sv.JobName = ptr.String(jtv) + } + + case "JobProgress": + if err := awsAwsjson10_deserializeDocumentJobProgress(&sv.JobProgress, value); err != nil { + return err + } + + case "JobStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpeakerEnrollmentJobStatus to be of type string, got %T instead", value) + } + sv.JobStatus = types.SpeakerEnrollmentJobStatus(jtv) + } + + case "OutputDataConfig": + if err := awsAwsjson10_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSpeakerEnrollmentJobSummaries(v *[]types.SpeakerEnrollmentJobSummary, 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.SpeakerEnrollmentJobSummary + if *v == nil { + cv = []types.SpeakerEnrollmentJobSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SpeakerEnrollmentJobSummary + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSpeakerEnrollmentJobSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSpeakerEnrollmentJobSummary(v **types.SpeakerEnrollmentJobSummary, 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.SpeakerEnrollmentJobSummary + if *v == nil { + sv = &types.SpeakerEnrollmentJobSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "EndedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "FailureDetails": + if err := awsAwsjson10_deserializeDocumentFailureDetails(&sv.FailureDetails, value); err != nil { + return err + } + + case "JobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobId to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } + + case "JobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobName to be of type string, got %T instead", value) + } + sv.JobName = ptr.String(jtv) + } + + case "JobProgress": + if err := awsAwsjson10_deserializeDocumentJobProgress(&sv.JobProgress, value); err != nil { + return err + } + + case "JobStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpeakerEnrollmentJobStatus to be of type string, got %T instead", value) + } + sv.JobStatus = types.SpeakerEnrollmentJobStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSpeakerSummaries(v *[]types.SpeakerSummary, 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.SpeakerSummary + if *v == nil { + cv = []types.SpeakerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SpeakerSummary + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSpeakerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSpeakerSummary(v **types.SpeakerSummary, 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.SpeakerSummary + if *v == nil { + sv = &types.SpeakerSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CustomerSpeakerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomerSpeakerId to be of type string, got %T instead", value) + } + sv.CustomerSpeakerId = ptr.String(jtv) + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "GeneratedSpeakerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeneratedSpeakerId to be of type string, got %T instead", value) + } + sv.GeneratedSpeakerId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpeakerStatus to be of type string, got %T instead", value) + } + sv.Status = types.SpeakerStatus(jtv) + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCreateDomainOutput(v **CreateDomainOutput, 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 *CreateDomainOutput + if *v == nil { + sv = &CreateDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Domain": + if err := awsAwsjson10_deserializeDocumentDomain(&sv.Domain, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDescribeDomainOutput(v **DescribeDomainOutput, 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 *DescribeDomainOutput + if *v == nil { + sv = &DescribeDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Domain": + if err := awsAwsjson10_deserializeDocumentDomain(&sv.Domain, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDescribeFraudsterOutput(v **DescribeFraudsterOutput, 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 *DescribeFraudsterOutput + if *v == nil { + sv = &DescribeFraudsterOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Fraudster": + if err := awsAwsjson10_deserializeDocumentFraudster(&sv.Fraudster, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDescribeFraudsterRegistrationJobOutput(v **DescribeFraudsterRegistrationJobOutput, 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 *DescribeFraudsterRegistrationJobOutput + if *v == nil { + sv = &DescribeFraudsterRegistrationJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Job": + if err := awsAwsjson10_deserializeDocumentFraudsterRegistrationJob(&sv.Job, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDescribeSpeakerEnrollmentJobOutput(v **DescribeSpeakerEnrollmentJobOutput, 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 *DescribeSpeakerEnrollmentJobOutput + if *v == nil { + sv = &DescribeSpeakerEnrollmentJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Job": + if err := awsAwsjson10_deserializeDocumentSpeakerEnrollmentJob(&sv.Job, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDescribeSpeakerOutput(v **DescribeSpeakerOutput, 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 *DescribeSpeakerOutput + if *v == nil { + sv = &DescribeSpeakerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Speaker": + if err := awsAwsjson10_deserializeDocumentSpeaker(&sv.Speaker, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentEvaluateSessionOutput(v **EvaluateSessionOutput, 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 *EvaluateSessionOutput + if *v == nil { + sv = &EvaluateSessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AuthenticationResult": + if err := awsAwsjson10_deserializeDocumentAuthenticationResult(&sv.AuthenticationResult, value); err != nil { + return err + } + + case "DomainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "FraudDetectionResult": + if err := awsAwsjson10_deserializeDocumentFraudDetectionResult(&sv.FraudDetectionResult, value); err != nil { + return err + } + + case "SessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionId to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + case "SessionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionName to be of type string, got %T instead", value) + } + sv.SessionName = ptr.String(jtv) + } + + case "StreamingStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StreamingStatus to be of type string, got %T instead", value) + } + sv.StreamingStatus = types.StreamingStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListDomainsOutput(v **ListDomainsOutput, 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 *ListDomainsOutput + if *v == nil { + sv = &ListDomainsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainSummaries": + if err := awsAwsjson10_deserializeDocumentDomainSummaries(&sv.DomainSummaries, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListFraudsterRegistrationJobsOutput(v **ListFraudsterRegistrationJobsOutput, 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 *ListFraudsterRegistrationJobsOutput + if *v == nil { + sv = &ListFraudsterRegistrationJobsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "JobSummaries": + if err := awsAwsjson10_deserializeDocumentFraudsterRegistrationJobSummaries(&sv.JobSummaries, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListSpeakerEnrollmentJobsOutput(v **ListSpeakerEnrollmentJobsOutput, 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 *ListSpeakerEnrollmentJobsOutput + if *v == nil { + sv = &ListSpeakerEnrollmentJobsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "JobSummaries": + if err := awsAwsjson10_deserializeDocumentSpeakerEnrollmentJobSummaries(&sv.JobSummaries, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentListSpeakersOutput(v **ListSpeakersOutput, 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 *ListSpeakersOutput + if *v == nil { + sv = &ListSpeakersOutput{} + } 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 String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SpeakerSummaries": + if err := awsAwsjson10_deserializeDocumentSpeakerSummaries(&sv.SpeakerSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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 := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentOptOutSpeakerOutput(v **OptOutSpeakerOutput, 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 *OptOutSpeakerOutput + if *v == nil { + sv = &OptOutSpeakerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Speaker": + if err := awsAwsjson10_deserializeDocumentSpeaker(&sv.Speaker, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentStartFraudsterRegistrationJobOutput(v **StartFraudsterRegistrationJobOutput, 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 *StartFraudsterRegistrationJobOutput + if *v == nil { + sv = &StartFraudsterRegistrationJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Job": + if err := awsAwsjson10_deserializeDocumentFraudsterRegistrationJob(&sv.Job, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentStartSpeakerEnrollmentJobOutput(v **StartSpeakerEnrollmentJobOutput, 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 *StartSpeakerEnrollmentJobOutput + if *v == nil { + sv = &StartSpeakerEnrollmentJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Job": + if err := awsAwsjson10_deserializeDocumentSpeakerEnrollmentJob(&sv.Job, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, 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 *TagResourceOutput + if *v == nil { + sv = &TagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, 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 *UntagResourceOutput + if *v == nil { + sv = &UntagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentUpdateDomainOutput(v **UpdateDomainOutput, 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 *UpdateDomainOutput + if *v == nil { + sv = &UpdateDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Domain": + if err := awsAwsjson10_deserializeDocumentDomain(&sv.Domain, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/voiceid/doc.go b/service/voiceid/doc.go new file mode 100644 index 00000000000..313683acb0f --- /dev/null +++ b/service/voiceid/doc.go @@ -0,0 +1,8 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package voiceid provides the API client, operations, and parameter types for +// Amazon Voice ID. +// +// Amazon Connect Voice ID provides real-time caller authentication and fraud +// screening. This guide describes the APIs used for this service. +package voiceid diff --git a/service/voiceid/endpoints.go b/service/voiceid/endpoints.go new file mode 100644 index 00000000000..b684c86d890 --- /dev/null +++ b/service/voiceid/endpoints.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/voiceid/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + if err != nil { + 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 = "voiceid" + } + 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.EndpointResolver + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint +// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError +// error, the resolver will use the the provided fallbackResolver for resolution. +// awsResolver and fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/voiceid/generated.json b/service/voiceid/generated.json new file mode 100644 index 00000000000..f236e4c633a --- /dev/null +++ b/service/voiceid/generated.json @@ -0,0 +1,45 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_op_CreateDomain.go", + "api_op_DeleteDomain.go", + "api_op_DeleteFraudster.go", + "api_op_DeleteSpeaker.go", + "api_op_DescribeDomain.go", + "api_op_DescribeFraudster.go", + "api_op_DescribeFraudsterRegistrationJob.go", + "api_op_DescribeSpeaker.go", + "api_op_DescribeSpeakerEnrollmentJob.go", + "api_op_EvaluateSession.go", + "api_op_ListDomains.go", + "api_op_ListFraudsterRegistrationJobs.go", + "api_op_ListSpeakerEnrollmentJobs.go", + "api_op_ListSpeakers.go", + "api_op_ListTagsForResource.go", + "api_op_OptOutSpeaker.go", + "api_op_StartFraudsterRegistrationJob.go", + "api_op_StartSpeakerEnrollmentJob.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateDomain.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/voiceid", + "unstable": false +} diff --git a/service/voiceid/go.mod b/service/voiceid/go.mod new file mode 100644 index 00000000000..0d7f8b7287b --- /dev/null +++ b/service/voiceid/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/voiceid + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.9.1 + github.com/aws/smithy-go v1.8.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/voiceid/go.sum b/service/voiceid/go.sum new file mode 100644 index 00000000000..779915f8ab7 --- /dev/null +++ b/service/voiceid/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/voiceid/go_module_metadata.go b/service/voiceid/go_module_metadata.go new file mode 100644 index 00000000000..f0f9448e432 --- /dev/null +++ b/service/voiceid/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package voiceid + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/voiceid/internal/endpoints/endpoints.go b/service/voiceid/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..753279d6e8f --- /dev/null +++ b/service/voiceid/internal/endpoints/endpoints.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver Voice ID 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + 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 + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "voiceid.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + "ap-northeast-1": endpoints.Endpoint{}, + "ap-southeast-1": endpoints.Endpoint{}, + "ap-southeast-2": endpoints.Endpoint{}, + "eu-central-1": endpoints.Endpoint{}, + "eu-west-2": endpoints.Endpoint{}, + "us-east-1": endpoints.Endpoint{}, + "us-west-2": endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "voiceid.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "voiceid.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "voiceid.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "voiceid.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/voiceid/internal/endpoints/endpoints_test.go b/service/voiceid/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/voiceid/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/voiceid/protocol_test.go b/service/voiceid/protocol_test.go new file mode 100644 index 00000000000..1cab49f1d80 --- /dev/null +++ b/service/voiceid/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid diff --git a/service/voiceid/serializers.go b/service/voiceid/serializers.go new file mode 100644 index 00000000000..e76bb949b2c --- /dev/null +++ b/service/voiceid/serializers.go @@ -0,0 +1,1600 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsAwsjson10_serializeOpCreateDomain struct { +} + +func (*awsAwsjson10_serializeOpCreateDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.CreateDomain") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateDomainInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDeleteDomain struct { +} + +func (*awsAwsjson10_serializeOpDeleteDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DeleteDomain") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteDomainInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDeleteFraudster struct { +} + +func (*awsAwsjson10_serializeOpDeleteFraudster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteFraudster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteFraudsterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DeleteFraudster") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteFraudsterInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDeleteSpeaker struct { +} + +func (*awsAwsjson10_serializeOpDeleteSpeaker) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteSpeaker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSpeakerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DeleteSpeaker") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteSpeakerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDescribeDomain struct { +} + +func (*awsAwsjson10_serializeOpDescribeDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DescribeDomain") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeDomainInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDescribeFraudster struct { +} + +func (*awsAwsjson10_serializeOpDescribeFraudster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeFraudster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeFraudsterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DescribeFraudster") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeFraudsterInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDescribeFraudsterRegistrationJob struct { +} + +func (*awsAwsjson10_serializeOpDescribeFraudsterRegistrationJob) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeFraudsterRegistrationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeFraudsterRegistrationJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DescribeFraudsterRegistrationJob") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeFraudsterRegistrationJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDescribeSpeaker struct { +} + +func (*awsAwsjson10_serializeOpDescribeSpeaker) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeSpeaker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeSpeakerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DescribeSpeaker") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeSpeakerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpDescribeSpeakerEnrollmentJob struct { +} + +func (*awsAwsjson10_serializeOpDescribeSpeakerEnrollmentJob) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeSpeakerEnrollmentJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeSpeakerEnrollmentJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.DescribeSpeakerEnrollmentJob") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeSpeakerEnrollmentJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpEvaluateSession struct { +} + +func (*awsAwsjson10_serializeOpEvaluateSession) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpEvaluateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*EvaluateSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.EvaluateSession") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentEvaluateSessionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpListDomains struct { +} + +func (*awsAwsjson10_serializeOpListDomains) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDomainsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.ListDomains") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListDomainsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpListFraudsterRegistrationJobs struct { +} + +func (*awsAwsjson10_serializeOpListFraudsterRegistrationJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListFraudsterRegistrationJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFraudsterRegistrationJobsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.ListFraudsterRegistrationJobs") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListFraudsterRegistrationJobsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpListSpeakerEnrollmentJobs struct { +} + +func (*awsAwsjson10_serializeOpListSpeakerEnrollmentJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListSpeakerEnrollmentJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSpeakerEnrollmentJobsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.ListSpeakerEnrollmentJobs") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListSpeakerEnrollmentJobsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpListSpeakers struct { +} + +func (*awsAwsjson10_serializeOpListSpeakers) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListSpeakers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSpeakersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.ListSpeakers") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListSpeakersInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson10_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.ListTagsForResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpOptOutSpeaker struct { +} + +func (*awsAwsjson10_serializeOpOptOutSpeaker) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpOptOutSpeaker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*OptOutSpeakerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.OptOutSpeaker") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentOptOutSpeakerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpStartFraudsterRegistrationJob struct { +} + +func (*awsAwsjson10_serializeOpStartFraudsterRegistrationJob) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpStartFraudsterRegistrationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartFraudsterRegistrationJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.StartFraudsterRegistrationJob") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentStartFraudsterRegistrationJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpStartSpeakerEnrollmentJob struct { +} + +func (*awsAwsjson10_serializeOpStartSpeakerEnrollmentJob) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpStartSpeakerEnrollmentJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartSpeakerEnrollmentJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.StartSpeakerEnrollmentJob") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentStartSpeakerEnrollmentJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpTagResource struct { +} + +func (*awsAwsjson10_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.TagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpUntagResource struct { +} + +func (*awsAwsjson10_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson10_serializeOpUpdateDomain struct { +} + +func (*awsAwsjson10_serializeOpUpdateDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("VoiceID.UpdateDomain") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateDomainInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsAwsjson10_serializeDocumentEnrollmentConfig(v *types.EnrollmentConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ExistingEnrollmentAction) > 0 { + ok := object.Key("ExistingEnrollmentAction") + ok.String(string(v.ExistingEnrollmentAction)) + } + + if v.FraudDetectionConfig != nil { + ok := object.Key("FraudDetectionConfig") + if err := awsAwsjson10_serializeDocumentEnrollmentJobFraudDetectionConfig(v.FraudDetectionConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentEnrollmentJobFraudDetectionConfig(v *types.EnrollmentJobFraudDetectionConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.FraudDetectionAction) > 0 { + ok := object.Key("FraudDetectionAction") + ok.String(string(v.FraudDetectionAction)) + } + + if v.RiskThreshold != nil { + ok := object.Key("RiskThreshold") + ok.Integer(*v.RiskThreshold) + } + + return nil +} + +func awsAwsjson10_serializeDocumentInputDataConfig(v *types.InputDataConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Uri != nil { + ok := object.Key("S3Uri") + ok.String(*v.S3Uri) + } + + return nil +} + +func awsAwsjson10_serializeDocumentOutputDataConfig(v *types.OutputDataConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyId != nil { + ok := object.Key("KmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.S3Uri != nil { + ok := object.Key("S3Uri") + ok.String(*v.S3Uri) + } + + return nil +} + +func awsAwsjson10_serializeDocumentRegistrationConfig(v *types.RegistrationConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.DuplicateRegistrationAction) > 0 { + ok := object.Key("DuplicateRegistrationAction") + ok.String(string(v.DuplicateRegistrationAction)) + } + + if v.FraudsterSimilarityThreshold != nil { + ok := object.Key("FraudsterSimilarityThreshold") + ok.Integer(*v.FraudsterSimilarityThreshold) + } + + return nil +} + +func awsAwsjson10_serializeDocumentServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyId != nil { + ok := object.Key("KmsKeyId") + ok.String(*v.KmsKeyId) + } + + return nil +} + +func awsAwsjson10_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson10_serializeDocumentTagKeyList(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 awsAwsjson10_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeOpDocumentCreateDomainInput(v *CreateDomainInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.ServerSideEncryptionConfiguration != nil { + ok := object.Key("ServerSideEncryptionConfiguration") + if err := awsAwsjson10_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeleteDomainInput(v *DeleteDomainInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeleteFraudsterInput(v *DeleteFraudsterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.FraudsterId != nil { + ok := object.Key("FraudsterId") + ok.String(*v.FraudsterId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeleteSpeakerInput(v *DeleteSpeakerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.SpeakerId != nil { + ok := object.Key("SpeakerId") + ok.String(*v.SpeakerId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDescribeDomainInput(v *DescribeDomainInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDescribeFraudsterInput(v *DescribeFraudsterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.FraudsterId != nil { + ok := object.Key("FraudsterId") + ok.String(*v.FraudsterId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDescribeFraudsterRegistrationJobInput(v *DescribeFraudsterRegistrationJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.JobId != nil { + ok := object.Key("JobId") + ok.String(*v.JobId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDescribeSpeakerEnrollmentJobInput(v *DescribeSpeakerEnrollmentJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.JobId != nil { + ok := object.Key("JobId") + ok.String(*v.JobId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDescribeSpeakerInput(v *DescribeSpeakerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.SpeakerId != nil { + ok := object.Key("SpeakerId") + ok.String(*v.SpeakerId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentEvaluateSessionInput(v *EvaluateSessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.SessionNameOrId != nil { + ok := object.Key("SessionNameOrId") + ok.String(*v.SessionNameOrId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListDomainsInput(v *ListDomainsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListFraudsterRegistrationJobsInput(v *ListFraudsterRegistrationJobsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if len(v.JobStatus) > 0 { + ok := object.Key("JobStatus") + ok.String(string(v.JobStatus)) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListSpeakerEnrollmentJobsInput(v *ListSpeakerEnrollmentJobsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if len(v.JobStatus) > 0 { + ok := object.Key("JobStatus") + ok.String(string(v.JobStatus)) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListSpeakersInput(v *ListSpeakersInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentOptOutSpeakerInput(v *OptOutSpeakerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.SpeakerId != nil { + ok := object.Key("SpeakerId") + ok.String(*v.SpeakerId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentStartFraudsterRegistrationJobInput(v *StartFraudsterRegistrationJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DataAccessRoleArn != nil { + ok := object.Key("DataAccessRoleArn") + ok.String(*v.DataAccessRoleArn) + } + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.InputDataConfig != nil { + ok := object.Key("InputDataConfig") + if err := awsAwsjson10_serializeDocumentInputDataConfig(v.InputDataConfig, ok); err != nil { + return err + } + } + + if v.JobName != nil { + ok := object.Key("JobName") + ok.String(*v.JobName) + } + + if v.OutputDataConfig != nil { + ok := object.Key("OutputDataConfig") + if err := awsAwsjson10_serializeDocumentOutputDataConfig(v.OutputDataConfig, ok); err != nil { + return err + } + } + + if v.RegistrationConfig != nil { + ok := object.Key("RegistrationConfig") + if err := awsAwsjson10_serializeDocumentRegistrationConfig(v.RegistrationConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentStartSpeakerEnrollmentJobInput(v *StartSpeakerEnrollmentJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DataAccessRoleArn != nil { + ok := object.Key("DataAccessRoleArn") + ok.String(*v.DataAccessRoleArn) + } + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.EnrollmentConfig != nil { + ok := object.Key("EnrollmentConfig") + if err := awsAwsjson10_serializeDocumentEnrollmentConfig(v.EnrollmentConfig, ok); err != nil { + return err + } + } + + if v.InputDataConfig != nil { + ok := object.Key("InputDataConfig") + if err := awsAwsjson10_serializeDocumentInputDataConfig(v.InputDataConfig, ok); err != nil { + return err + } + } + + if v.JobName != nil { + ok := object.Key("JobName") + ok.String(*v.JobName) + } + + if v.OutputDataConfig != nil { + ok := object.Key("OutputDataConfig") + if err := awsAwsjson10_serializeDocumentOutputDataConfig(v.OutputDataConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson10_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdateDomainInput(v *UpdateDomainInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.DomainId != nil { + ok := object.Key("DomainId") + ok.String(*v.DomainId) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.ServerSideEncryptionConfiguration != nil { + ok := object.Key("ServerSideEncryptionConfiguration") + if err := awsAwsjson10_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/voiceid/types/enums.go b/service/voiceid/types/enums.go new file mode 100644 index 00000000000..d8f45842c95 --- /dev/null +++ b/service/voiceid/types/enums.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AuthenticationDecision string + +// Enum values for AuthenticationDecision +const ( + AuthenticationDecisionAccept AuthenticationDecision = "ACCEPT" + AuthenticationDecisionReject AuthenticationDecision = "REJECT" + AuthenticationDecisionNotEnoughSpeech AuthenticationDecision = "NOT_ENOUGH_SPEECH" + AuthenticationDecisionSpeakerNotEnrolled AuthenticationDecision = "SPEAKER_NOT_ENROLLED" + AuthenticationDecisionSpeakerOptedOut AuthenticationDecision = "SPEAKER_OPTED_OUT" + AuthenticationDecisionSpeakerIdNotProvided AuthenticationDecision = "SPEAKER_ID_NOT_PROVIDED" +) + +// Values returns all known values for AuthenticationDecision. 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 (AuthenticationDecision) Values() []AuthenticationDecision { + return []AuthenticationDecision{ + "ACCEPT", + "REJECT", + "NOT_ENOUGH_SPEECH", + "SPEAKER_NOT_ENROLLED", + "SPEAKER_OPTED_OUT", + "SPEAKER_ID_NOT_PROVIDED", + } +} + +type ConflictType string + +// Enum values for ConflictType +const ( + ConflictTypeAnotherActiveStream ConflictType = "ANOTHER_ACTIVE_STREAM" + ConflictTypeDomainNotActive ConflictType = "DOMAIN_NOT_ACTIVE" + ConflictTypeCannotChangeSpeakerAfterEnrollment ConflictType = "CANNOT_CHANGE_SPEAKER_AFTER_ENROLLMENT" + ConflictTypeEnrollmentAlreadyExists ConflictType = "ENROLLMENT_ALREADY_EXISTS" + ConflictTypeSpeakerNotSet ConflictType = "SPEAKER_NOT_SET" + ConflictTypeSpeakerOptedOut ConflictType = "SPEAKER_OPTED_OUT" + ConflictTypeConcurrentChanges ConflictType = "CONCURRENT_CHANGES" +) + +// Values returns all known values for ConflictType. 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 (ConflictType) Values() []ConflictType { + return []ConflictType{ + "ANOTHER_ACTIVE_STREAM", + "DOMAIN_NOT_ACTIVE", + "CANNOT_CHANGE_SPEAKER_AFTER_ENROLLMENT", + "ENROLLMENT_ALREADY_EXISTS", + "SPEAKER_NOT_SET", + "SPEAKER_OPTED_OUT", + "CONCURRENT_CHANGES", + } +} + +type DomainStatus string + +// Enum values for DomainStatus +const ( + DomainStatusActive DomainStatus = "ACTIVE" + DomainStatusPending DomainStatus = "PENDING" + DomainStatusSuspended DomainStatus = "SUSPENDED" +) + +// Values returns all known values for DomainStatus. 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 (DomainStatus) Values() []DomainStatus { + return []DomainStatus{ + "ACTIVE", + "PENDING", + "SUSPENDED", + } +} + +type DuplicateRegistrationAction string + +// Enum values for DuplicateRegistrationAction +const ( + DuplicateRegistrationActionSkip DuplicateRegistrationAction = "SKIP" + DuplicateRegistrationActionRegisterAsNew DuplicateRegistrationAction = "REGISTER_AS_NEW" +) + +// Values returns all known values for DuplicateRegistrationAction. 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 (DuplicateRegistrationAction) Values() []DuplicateRegistrationAction { + return []DuplicateRegistrationAction{ + "SKIP", + "REGISTER_AS_NEW", + } +} + +type ExistingEnrollmentAction string + +// Enum values for ExistingEnrollmentAction +const ( + ExistingEnrollmentActionSkip ExistingEnrollmentAction = "SKIP" + ExistingEnrollmentActionOverwrite ExistingEnrollmentAction = "OVERWRITE" +) + +// Values returns all known values for ExistingEnrollmentAction. 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 (ExistingEnrollmentAction) Values() []ExistingEnrollmentAction { + return []ExistingEnrollmentAction{ + "SKIP", + "OVERWRITE", + } +} + +type FraudDetectionAction string + +// Enum values for FraudDetectionAction +const ( + FraudDetectionActionIgnore FraudDetectionAction = "IGNORE" + FraudDetectionActionFail FraudDetectionAction = "FAIL" +) + +// Values returns all known values for FraudDetectionAction. 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 (FraudDetectionAction) Values() []FraudDetectionAction { + return []FraudDetectionAction{ + "IGNORE", + "FAIL", + } +} + +type FraudDetectionDecision string + +// Enum values for FraudDetectionDecision +const ( + FraudDetectionDecisionHighRisk FraudDetectionDecision = "HIGH_RISK" + FraudDetectionDecisionLowRisk FraudDetectionDecision = "LOW_RISK" + FraudDetectionDecisionNotEnoughSpeech FraudDetectionDecision = "NOT_ENOUGH_SPEECH" +) + +// Values returns all known values for FraudDetectionDecision. 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 (FraudDetectionDecision) Values() []FraudDetectionDecision { + return []FraudDetectionDecision{ + "HIGH_RISK", + "LOW_RISK", + "NOT_ENOUGH_SPEECH", + } +} + +type FraudDetectionReason string + +// Enum values for FraudDetectionReason +const ( + FraudDetectionReasonKnownFraudster FraudDetectionReason = "KNOWN_FRAUDSTER" +) + +// Values returns all known values for FraudDetectionReason. 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 (FraudDetectionReason) Values() []FraudDetectionReason { + return []FraudDetectionReason{ + "KNOWN_FRAUDSTER", + } +} + +type FraudsterRegistrationJobStatus string + +// Enum values for FraudsterRegistrationJobStatus +const ( + FraudsterRegistrationJobStatusSubmitted FraudsterRegistrationJobStatus = "SUBMITTED" + FraudsterRegistrationJobStatusInProgress FraudsterRegistrationJobStatus = "IN_PROGRESS" + FraudsterRegistrationJobStatusCompleted FraudsterRegistrationJobStatus = "COMPLETED" + FraudsterRegistrationJobStatusCompletedWithErrors FraudsterRegistrationJobStatus = "COMPLETED_WITH_ERRORS" + FraudsterRegistrationJobStatusFailed FraudsterRegistrationJobStatus = "FAILED" +) + +// Values returns all known values for FraudsterRegistrationJobStatus. 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 (FraudsterRegistrationJobStatus) Values() []FraudsterRegistrationJobStatus { + return []FraudsterRegistrationJobStatus{ + "SUBMITTED", + "IN_PROGRESS", + "COMPLETED", + "COMPLETED_WITH_ERRORS", + "FAILED", + } +} + +type ResourceType string + +// Enum values for ResourceType +const ( + ResourceTypeBatchJob ResourceType = "BATCH_JOB" + ResourceTypeComplianceConsent ResourceType = "COMPLIANCE_CONSENT" + ResourceTypeDomain ResourceType = "DOMAIN" + ResourceTypeFraudster ResourceType = "FRAUDSTER" + ResourceTypeSession ResourceType = "SESSION" + ResourceTypeSpeaker ResourceType = "SPEAKER" +) + +// Values returns all known values for ResourceType. 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 (ResourceType) Values() []ResourceType { + return []ResourceType{ + "BATCH_JOB", + "COMPLIANCE_CONSENT", + "DOMAIN", + "FRAUDSTER", + "SESSION", + "SPEAKER", + } +} + +type SpeakerEnrollmentJobStatus string + +// Enum values for SpeakerEnrollmentJobStatus +const ( + SpeakerEnrollmentJobStatusSubmitted SpeakerEnrollmentJobStatus = "SUBMITTED" + SpeakerEnrollmentJobStatusInProgress SpeakerEnrollmentJobStatus = "IN_PROGRESS" + SpeakerEnrollmentJobStatusCompleted SpeakerEnrollmentJobStatus = "COMPLETED" + SpeakerEnrollmentJobStatusCompletedWithErrors SpeakerEnrollmentJobStatus = "COMPLETED_WITH_ERRORS" + SpeakerEnrollmentJobStatusFailed SpeakerEnrollmentJobStatus = "FAILED" +) + +// Values returns all known values for SpeakerEnrollmentJobStatus. 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 (SpeakerEnrollmentJobStatus) Values() []SpeakerEnrollmentJobStatus { + return []SpeakerEnrollmentJobStatus{ + "SUBMITTED", + "IN_PROGRESS", + "COMPLETED", + "COMPLETED_WITH_ERRORS", + "FAILED", + } +} + +type SpeakerStatus string + +// Enum values for SpeakerStatus +const ( + SpeakerStatusEnrolled SpeakerStatus = "ENROLLED" + SpeakerStatusExpired SpeakerStatus = "EXPIRED" + SpeakerStatusOptedOut SpeakerStatus = "OPTED_OUT" + SpeakerStatusPending SpeakerStatus = "PENDING" +) + +// Values returns all known values for SpeakerStatus. 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 (SpeakerStatus) Values() []SpeakerStatus { + return []SpeakerStatus{ + "ENROLLED", + "EXPIRED", + "OPTED_OUT", + "PENDING", + } +} + +type StreamingStatus string + +// Enum values for StreamingStatus +const ( + StreamingStatusPendingConfiguration StreamingStatus = "PENDING_CONFIGURATION" + StreamingStatusOngoing StreamingStatus = "ONGOING" + StreamingStatusEnded StreamingStatus = "ENDED" +) + +// Values returns all known values for StreamingStatus. 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 (StreamingStatus) Values() []StreamingStatus { + return []StreamingStatus{ + "PENDING_CONFIGURATION", + "ONGOING", + "ENDED", + } +} diff --git a/service/voiceid/types/errors.go b/service/voiceid/types/errors.go new file mode 100644 index 00000000000..208afdb8a06 --- /dev/null +++ b/service/voiceid/types/errors.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient permissions to perform this action. Check the error +// message and try again. +type AccessDeniedException struct { + Message *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 { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed due to a conflict. Check the ConflictType and error message +// for more details. +type ConflictException struct { + Message *string + + ConflictType ConflictType + + 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 { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed due to an unknown error on the server side. +type InternalServerException struct { + Message *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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The specified resource cannot be found. Check the ResourceType and error message +// for more details. +type ResourceNotFoundException struct { + Message *string + + ResourceType ResourceType + + 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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request exceeded the service quota. Refer to Voice ID Service Quotas +// (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#voiceid-quotas) +// and try your request again. +type ServiceQuotaExceededException struct { + Message *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 { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. Please slow down your request +// rate. Refer to Amazon Connect Voice ID Service API throttling quotas +// (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html##voiceid-api-quotas) +// and try your request again. +type ThrottlingException struct { + Message *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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed one or more validations; check the error message for more +// details. +type ValidationException struct { + Message *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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/voiceid/types/types.go b/service/voiceid/types/types.go new file mode 100644 index 00000000000..6ee508b886f --- /dev/null +++ b/service/voiceid/types/types.go @@ -0,0 +1,576 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// The configuration used to authenticate a speaker during a session. +type AuthenticationConfiguration struct { + + // The minimum threshold needed to successfully authenticate a speaker. + // + // This member is required. + AcceptanceThreshold *int32 + + noSmithyDocumentSerde +} + +// The authentication result produced by Voice ID, processed against the current +// session state and streamed audio of the speaker. +type AuthenticationResult struct { + + // A timestamp indicating when audio aggregation ended for this authentication + // result. + AudioAggregationEndedAt *time.Time + + // A timestamp indicating when audio aggregation started for this authentication + // result. + AudioAggregationStartedAt *time.Time + + // The unique identifier for this authentication result. Because there can be + // multiple authentications for a given session, this field helps to identify if + // the returned result is from a previous streaming activity or a new result. Note + // that in absence of any new streaming activity, AcceptanceThreshold changes, or + // SpeakerId changes, Voice ID always returns cached Authentication Result for this + // API. + AuthenticationResultId *string + + // The AuthenticationConfiguration used to generate this authentication result. + Configuration *AuthenticationConfiguration + + // The client-provided identifier for the speaker whose authentication result is + // produced. Only present if a SpeakerId is provided for the session. + CustomerSpeakerId *string + + // The authentication decision produced by Voice ID, processed against the current + // session state and streamed audio of the speaker. + Decision AuthenticationDecision + + // The service-generated identifier for the speaker whose authentication result is + // produced. + GeneratedSpeakerId *string + + // The authentication score for the speaker whose authentication result is + // produced. This value is only present if the authentication decision is either + // ACCEPT or REJECT. + Score *int32 + + noSmithyDocumentSerde +} + +// Contains all the information about a domain. +type Domain struct { + + // The Amazon Resource Name (ARN) for the domain. + Arn *string + + // The timestamp at which the domain is created. + CreatedAt *time.Time + + // The client-provided description of the domain. + Description *string + + // The service-generated identifier for the domain. + DomainId *string + + // The current status of the domain. + DomainStatus DomainStatus + + // The client-provided name for the domain. + Name *string + + // The server-side encryption configuration containing the KMS Key Identifier you + // want Voice ID to use to encrypt your data. + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration + + // The timestamp showing the domain's last update. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Contains a summary of information about a domain. +type DomainSummary struct { + + // The Amazon Resource Name (ARN) for the domain. + Arn *string + + // The timestamp showing when the domain is created. + CreatedAt *time.Time + + // The client-provided description of the domain. + Description *string + + // The service-generated identifier for the domain. + DomainId *string + + // The current status of the domain. + DomainStatus DomainStatus + + // The client-provided name for the domain. + Name *string + + // The server-side encryption configuration containing the KMS Key Identifier you + // want Voice ID to use to encrypt your data.. + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration + + // The timestamp showing the domain's last update. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Contains configurations defining enrollment behavior for the batch job. +type EnrollmentConfig struct { + + // The action to take when the specified speaker is already enrolled in the + // specified domain. The default value is SKIP, which skips the enrollment for the + // existing speaker. Setting the value to OVERWRITE replaces the existing voice + // prints and enrollment audio stored for that speaker with new data generated from + // the latest audio. + ExistingEnrollmentAction ExistingEnrollmentAction + + // The fraud detection configuration to use for the speaker enrollment job. + FraudDetectionConfig *EnrollmentJobFraudDetectionConfig + + noSmithyDocumentSerde +} + +// The configuration defining the action to take when a speaker is flagged by the +// fraud detection system during a batch speaker enrollment job, and the risk +// threshold to use for identification. +type EnrollmentJobFraudDetectionConfig struct { + + // The action to take when the given speaker is flagged by the fraud detection + // system. The default value is FAIL, which fails the speaker enrollment. Changing + // this value to IGNORE results in the speaker being enrolled even if they are + // flagged by the fraud detection system. + FraudDetectionAction FraudDetectionAction + + // Threshold value for determining whether the speaker is a high risk to be + // fraudulent. If the detected risk score calculated by Voice ID is greater than or + // equal to the threshold, the speaker is considered a fraudster. + RiskThreshold *int32 + + noSmithyDocumentSerde +} + +// Contains error details for a failed batch job. +type FailureDetails struct { + + // A description of the error that caused the batch job failure. + Message *string + + // An HTTP status code representing the nature of the error. + StatusCode *int32 + + noSmithyDocumentSerde +} + +// The configuration used for performing fraud detection over a speaker during a +// session. +type FraudDetectionConfiguration struct { + + // Threshold value for determining whether the speaker is a fraudster. If the + // detected risk score calculated by Voice ID is higher than the threshold, the + // speaker is considered a fraudster. + // + // This member is required. + RiskThreshold *int32 + + noSmithyDocumentSerde +} + +// The fraud detection result produced by Voice ID, processed against the current +// session state and streamed audio of the speaker. +type FraudDetectionResult struct { + + // A timestamp indicating when audio aggregation ended for this fraud detection + // result. + AudioAggregationEndedAt *time.Time + + // A timestamp indicating when audio aggregation started for this fraud detection + // result. + AudioAggregationStartedAt *time.Time + + // The FraudDetectionConfiguration used to generate this fraud detection result. + Configuration *FraudDetectionConfiguration + + // The fraud detection decision produced by Voice ID, processed against the current + // session state and streamed audio of the speaker. + Decision FraudDetectionDecision + + // The unique identifier for this fraud detection result. Given there can be + // multiple fraud detections for a given session, this field helps in identifying + // if the returned result is from previous streaming activity or a new result. Note + // that in the absence of any new streaming activity or risk threshold changes, + // Voice ID always returns cached Fraud Detection result for this API. + FraudDetectionResultId *string + + // The reason speaker was flagged by the fraud detection system. This is only be + // populated if fraud detection Decision is HIGH_RISK, and only has one possible + // value: KNOWN_FRAUDSTER. + Reasons []FraudDetectionReason + + // Details about each risk analyzed for this speaker. + RiskDetails *FraudRiskDetails + + noSmithyDocumentSerde +} + +// Details regarding various fraud risk analyses performed against the current +// session state and streamed audio of the speaker. +type FraudRiskDetails struct { + + // The details resulting from 'Known Fraudster Risk' analysis of the speaker. + // + // This member is required. + KnownFraudsterRisk *KnownFraudsterRisk + + noSmithyDocumentSerde +} + +// Contains all the information about a fraudster. +type Fraudster struct { + + // The timestamp when Voice ID identified the fraudster. + CreatedAt *time.Time + + // The identifier for the domain containing the fraudster. + DomainId *string + + // The service-generated identifier for the fraudster. + GeneratedFraudsterId *string + + noSmithyDocumentSerde +} + +// Contains all the information about a fraudster registration job. +type FraudsterRegistrationJob struct { + + // A timestamp showing the creation time of the fraudster registration job. + CreatedAt *time.Time + + // The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to + // access customer's buckets to read the input manifest file and write the job + // output file. + DataAccessRoleArn *string + + // The identifier of the domain containing the fraudster registration job. + DomainId *string + + // A timestamp showing when the fraudster registration job ended. + EndedAt *time.Time + + // Contains details that are populated when an entire batch job fails. In cases of + // individual registration job failures, the batch job as a whole doesn't fail; it + // is completed with a JobStatus of COMPLETED_WITH_ERRORS. You can use the job + // output file to identify the individual registration requests that failed. + FailureDetails *FailureDetails + + // The input data config containing an S3 URI for the input manifest file that + // contains the list of fraudster registration job requests. + InputDataConfig *InputDataConfig + + // The service-generated identifier for the fraudster registration job. + JobId *string + + // The client-provied name for the fraudster registration job. + JobName *string + + // Shows the completed percentage of registration requests listed in the input + // file. + JobProgress *JobProgress + + // The current status of the fraudster registration job. + JobStatus FraudsterRegistrationJobStatus + + // The output data config containing the S3 location where you want Voice ID to + // write your job output file; you must also include a KMS Key ID in order to + // encrypt the file. + OutputDataConfig *OutputDataConfig + + // The registration config containing details such as the action to take when a + // duplicate fraudster is detected, and the similarity threshold to use for + // detecting a duplicate fraudster. + RegistrationConfig *RegistrationConfig + + noSmithyDocumentSerde +} + +// Contains a summary of information about a fraudster registration job. +type FraudsterRegistrationJobSummary struct { + + // A timestamp showing when the fraudster registration job is created. + CreatedAt *time.Time + + // The identifier of the domain containing the fraudster registration job. + DomainId *string + + // A timestamp showing when the fraudster registration job ended. + EndedAt *time.Time + + // Contains details that are populated when an entire batch job fails. In cases of + // individual registration job failures, the batch job as a whole doesn't fail; it + // is completed with a JobStatus of COMPLETED_WITH_ERRORS. You can use the job + // output file to identify the individual registration requests that failed. + FailureDetails *FailureDetails + + // The service-generated identifier for the fraudster registration job. + JobId *string + + // The client-provied name for the fraudster registration job. + JobName *string + + // Shows the completed percentage of registration requests listed in the input + // file. + JobProgress *JobProgress + + // The current status of the fraudster registration job. + JobStatus FraudsterRegistrationJobStatus + + noSmithyDocumentSerde +} + +// The configuration containing input file information for a batch job. +type InputDataConfig struct { + + // The S3 location for the input manifest file that contains the list of individual + // enrollment or registration job requests. + // + // This member is required. + S3Uri *string + + noSmithyDocumentSerde +} + +// Indicates the completion progress for a batch job. +type JobProgress struct { + + // Shows the completed percentage of enrollment or registration requests listed in + // the input file. + PercentComplete *int32 + + noSmithyDocumentSerde +} + +// Contains details produced as a result of performing known fraudster risk +// analysis on a speaker. +type KnownFraudsterRisk struct { + + // The score indicating the likelihood the speaker is a known fraudster. + // + // This member is required. + RiskScore *int32 + + // The identifier of the fraudster that is the closest match to the speaker. If + // there are no fraudsters registered in a given domain, or if there are no + // fraudsters with a non-zero RiskScore, this value is null. + GeneratedFraudsterId *string + + noSmithyDocumentSerde +} + +// The configuration containing output file information for a batch job. +type OutputDataConfig struct { + + // The S3 path of the folder to which Voice ID writes the job output file, which + // has a *.out extension. For example, if the input file name is input-file.json + // and the output folder path is s3://output-bucket/output-folder, the full output + // file path is s3://output-bucket/output-folder/job-Id/input-file.json.out. + // + // This member is required. + S3Uri *string + + // the identifier of the KMS key you want Voice ID to use to encrypt the output + // file of the fraudster registration job. + KmsKeyId *string + + noSmithyDocumentSerde +} + +// The configuration definining the action to take when a duplicate fraudster is +// detected, and the similarity threshold to use for detecting a duplicate +// fraudster during a batch fraudster registration job. +type RegistrationConfig struct { + + // The action to take when a fraudster is identified as a duplicate. The default + // action is SKIP, which skips registering the duplicate fraudster. Setting the + // value to REGISTER_AS_NEW always registers a new fraudster into the specified + // domain. + DuplicateRegistrationAction DuplicateRegistrationAction + + // The minimum similarity score between the new and old fraudsters in order to + // consider the new fraudster a duplicate. + FraudsterSimilarityThreshold *int32 + + noSmithyDocumentSerde +} + +// The configuration containing information about the customer-managed KMS Key used +// for encrypting customer data. +type ServerSideEncryptionConfiguration struct { + + // The identifier of the KMS Key you want Voice ID to use to encrypt your data. + // + // This member is required. + KmsKeyId *string + + noSmithyDocumentSerde +} + +// Contains all the information about a speaker. +type Speaker struct { + + // A timestamp showing when the speaker is created. + CreatedAt *time.Time + + // The client-provided identifier for the speaker. + CustomerSpeakerId *string + + // The identifier of the domain that contains the speaker. + DomainId *string + + // The service-generated identifier for the speaker. + GeneratedSpeakerId *string + + // The current status of the speaker. + Status SpeakerStatus + + // A timestamp showing the speaker's last update. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Contains all the information about a speaker enrollment job. +type SpeakerEnrollmentJob struct { + + // A timestamp showing the creation of the speaker enrollment job. + CreatedAt *time.Time + + // The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to + // access customer's buckets to read the input manifest file and write the job + // output file. + DataAccessRoleArn *string + + // The identifier of the domain that contains the speaker enrollment job. + DomainId *string + + // A timestamp showing when the speaker enrollment job ended. + EndedAt *time.Time + + // The configuration that defines the action to take when the speaker is already + // enrolled in Voice ID, and the FraudDetectionConfig to use. + EnrollmentConfig *EnrollmentConfig + + // Contains details that are populated when an entire batch job fails. In cases of + // individual registration job failures, the batch job as a whole doesn't fail; it + // is completed with a JobStatus of COMPLETED_WITH_ERRORS. You can use the job + // output file to identify the individual registration requests that failed. + FailureDetails *FailureDetails + + // The input data config containing an S3 URI for the input manifest file that + // contains the list of speaker enrollment job requests. + InputDataConfig *InputDataConfig + + // The service-generated identifier for the speaker enrollment job. + JobId *string + + // The client-provided name for the speaker enrollment job. + JobName *string + + // Provides details on job progress. This field shows the completed percentage of + // registration requests listed in the input file. + JobProgress *JobProgress + + // The current status of the speaker enrollment job. + JobStatus SpeakerEnrollmentJobStatus + + // The output data config containing the S3 location where Voice ID writes the job + // output file; you must also include a KMS Key ID to encrypt the file. + OutputDataConfig *OutputDataConfig + + noSmithyDocumentSerde +} + +// Contains a summary of information about a speaker enrollment job. +type SpeakerEnrollmentJobSummary struct { + + // A timestamp showing the creation time of the speaker enrollment job. + CreatedAt *time.Time + + // The identifier of the domain that contains the speaker enrollment job. + DomainId *string + + // A timestamp showing when the speaker enrollment job ended. + EndedAt *time.Time + + // Contains details that are populated when an entire batch job fails. In cases of + // individual registration job failures, the batch job as a whole doesn't fail; it + // is completed with a JobStatus of COMPLETED_WITH_ERRORS. You can use the job + // output file to identify the individual registration requests that failed. + FailureDetails *FailureDetails + + // The service-generated identifier for the speaker enrollment job. + JobId *string + + // The client-provided name for the speaker enrollment job. + JobName *string + + // Provides details regarding job progress. This field shows the completed + // percentage of enrollment requests listed in the input file. + JobProgress *JobProgress + + // The current status of the speaker enrollment job. + JobStatus SpeakerEnrollmentJobStatus + + noSmithyDocumentSerde +} + +// Contains a summary of information about a speaker. +type SpeakerSummary struct { + + // A timestamp showing the speaker's creation time. + CreatedAt *time.Time + + // The client-provided identifier for the speaker. + CustomerSpeakerId *string + + // The identifier of the domain that contains the speaker. + DomainId *string + + // The service-generated identifier for the speaker. + GeneratedSpeakerId *string + + // The current status of the speaker. + Status SpeakerStatus + + // A timestamp showing the speaker's last update. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// A tag that can be assigned to a Voice ID resource. +type Tag struct { + + // The first part of a key:value pair that forms a tag associated with a given + // resource. For example, in the tag ‘Department’:’Sales’, the key is 'Department'. + // + // This member is required. + Key *string + + // The second part of a key:value pair that forms a tag associated with a given + // resource. For example, in the tag ‘Department’:’Sales’, the value is 'Sales'. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/voiceid/validators.go b/service/voiceid/validators.go new file mode 100644 index 00000000000..2af66d81c95 --- /dev/null +++ b/service/voiceid/validators.go @@ -0,0 +1,961 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/voiceid/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateDomain struct { +} + +func (*validateOpCreateDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDomain struct { +} + +func (*validateOpDeleteDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteFraudster struct { +} + +func (*validateOpDeleteFraudster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteFraudster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteFraudsterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteFraudsterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSpeaker struct { +} + +func (*validateOpDeleteSpeaker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSpeaker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSpeakerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSpeakerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDomain struct { +} + +func (*validateOpDescribeDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeFraudster struct { +} + +func (*validateOpDescribeFraudster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeFraudster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeFraudsterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeFraudsterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeFraudsterRegistrationJob struct { +} + +func (*validateOpDescribeFraudsterRegistrationJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeFraudsterRegistrationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeFraudsterRegistrationJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeFraudsterRegistrationJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeSpeakerEnrollmentJob struct { +} + +func (*validateOpDescribeSpeakerEnrollmentJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeSpeakerEnrollmentJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeSpeakerEnrollmentJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeSpeakerEnrollmentJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeSpeaker struct { +} + +func (*validateOpDescribeSpeaker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeSpeaker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeSpeakerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeSpeakerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpEvaluateSession struct { +} + +func (*validateOpEvaluateSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEvaluateSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EvaluateSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEvaluateSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListFraudsterRegistrationJobs struct { +} + +func (*validateOpListFraudsterRegistrationJobs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFraudsterRegistrationJobs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFraudsterRegistrationJobsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFraudsterRegistrationJobsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListSpeakerEnrollmentJobs struct { +} + +func (*validateOpListSpeakerEnrollmentJobs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSpeakerEnrollmentJobs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSpeakerEnrollmentJobsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSpeakerEnrollmentJobsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListSpeakers struct { +} + +func (*validateOpListSpeakers) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSpeakers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSpeakersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSpeakersInput(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 validateOpOptOutSpeaker struct { +} + +func (*validateOpOptOutSpeaker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpOptOutSpeaker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*OptOutSpeakerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpOptOutSpeakerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartFraudsterRegistrationJob struct { +} + +func (*validateOpStartFraudsterRegistrationJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartFraudsterRegistrationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartFraudsterRegistrationJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartFraudsterRegistrationJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartSpeakerEnrollmentJob struct { +} + +func (*validateOpStartSpeakerEnrollmentJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartSpeakerEnrollmentJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartSpeakerEnrollmentJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartSpeakerEnrollmentJobInput(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 validateOpUpdateDomain struct { +} + +func (*validateOpUpdateDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDomain{}, middleware.After) +} + +func addOpDeleteDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDomain{}, middleware.After) +} + +func addOpDeleteFraudsterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteFraudster{}, middleware.After) +} + +func addOpDeleteSpeakerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSpeaker{}, middleware.After) +} + +func addOpDescribeDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDomain{}, middleware.After) +} + +func addOpDescribeFraudsterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeFraudster{}, middleware.After) +} + +func addOpDescribeFraudsterRegistrationJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeFraudsterRegistrationJob{}, middleware.After) +} + +func addOpDescribeSpeakerEnrollmentJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeSpeakerEnrollmentJob{}, middleware.After) +} + +func addOpDescribeSpeakerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeSpeaker{}, middleware.After) +} + +func addOpEvaluateSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEvaluateSession{}, middleware.After) +} + +func addOpListFraudsterRegistrationJobsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFraudsterRegistrationJobs{}, middleware.After) +} + +func addOpListSpeakerEnrollmentJobsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSpeakerEnrollmentJobs{}, middleware.After) +} + +func addOpListSpeakersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSpeakers{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpOptOutSpeakerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpOptOutSpeaker{}, middleware.After) +} + +func addOpStartFraudsterRegistrationJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartFraudsterRegistrationJob{}, middleware.After) +} + +func addOpStartSpeakerEnrollmentJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartSpeakerEnrollmentJob{}, 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 addOpUpdateDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDomain{}, middleware.After) +} + +func validateInputDataConfig(v *types.InputDataConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InputDataConfig"} + if v.S3Uri == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Uri")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOutputDataConfig(v *types.OutputDataConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OutputDataConfig"} + if v.S3Uri == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Uri")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ServerSideEncryptionConfiguration"} + if v.KmsKeyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KmsKeyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDomainInput(v *CreateDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDomainInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ServerSideEncryptionConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServerSideEncryptionConfiguration")) + } else if v.ServerSideEncryptionConfiguration != nil { + if err := validateServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration); err != nil { + invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDomainInput(v *DeleteDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDomainInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteFraudsterInput(v *DeleteFraudsterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteFraudsterInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.FraudsterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FraudsterId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSpeakerInput(v *DeleteSpeakerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSpeakerInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.SpeakerId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpeakerId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDomainInput(v *DescribeDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDomainInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeFraudsterInput(v *DescribeFraudsterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeFraudsterInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.FraudsterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FraudsterId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeFraudsterRegistrationJobInput(v *DescribeFraudsterRegistrationJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeFraudsterRegistrationJobInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.JobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeSpeakerEnrollmentJobInput(v *DescribeSpeakerEnrollmentJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeSpeakerEnrollmentJobInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.JobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeSpeakerInput(v *DescribeSpeakerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeSpeakerInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.SpeakerId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpeakerId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpEvaluateSessionInput(v *EvaluateSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EvaluateSessionInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.SessionNameOrId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionNameOrId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListFraudsterRegistrationJobsInput(v *ListFraudsterRegistrationJobsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFraudsterRegistrationJobsInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListSpeakerEnrollmentJobsInput(v *ListSpeakerEnrollmentJobsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSpeakerEnrollmentJobsInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListSpeakersInput(v *ListSpeakersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSpeakersInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + 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.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpOptOutSpeakerInput(v *OptOutSpeakerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OptOutSpeakerInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.SpeakerId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpeakerId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartFraudsterRegistrationJobInput(v *StartFraudsterRegistrationJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartFraudsterRegistrationJobInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.DataAccessRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataAccessRoleArn")) + } + if v.InputDataConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("InputDataConfig")) + } else if v.InputDataConfig != nil { + if err := validateInputDataConfig(v.InputDataConfig); err != nil { + invalidParams.AddNested("InputDataConfig", err.(smithy.InvalidParamsError)) + } + } + if v.OutputDataConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutputDataConfig")) + } else if v.OutputDataConfig != nil { + if err := validateOutputDataConfig(v.OutputDataConfig); err != nil { + invalidParams.AddNested("OutputDataConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartSpeakerEnrollmentJobInput(v *StartSpeakerEnrollmentJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartSpeakerEnrollmentJobInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.DataAccessRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataAccessRoleArn")) + } + if v.InputDataConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("InputDataConfig")) + } else if v.InputDataConfig != nil { + if err := validateInputDataConfig(v.InputDataConfig); err != nil { + invalidParams.AddNested("InputDataConfig", err.(smithy.InvalidParamsError)) + } + } + if v.OutputDataConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutputDataConfig")) + } else if v.OutputDataConfig != nil { + if err := validateOutputDataConfig(v.OutputDataConfig); err != nil { + invalidParams.AddNested("OutputDataConfig", err.(smithy.InvalidParamsError)) + } + } + 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.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } else if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateDomainInput(v *UpdateDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDomainInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ServerSideEncryptionConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServerSideEncryptionConfiguration")) + } else if v.ServerSideEncryptionConfiguration != nil { + if err := validateServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration); err != nil { + invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/wisdom/LICENSE.txt b/service/wisdom/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/wisdom/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/wisdom/api_client.go b/service/wisdom/api_client.go new file mode 100644 index 00000000000..673349f4171 --- /dev/null +++ b/service/wisdom/api_client.go @@ -0,0 +1,262 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "Wisdom" +const ServiceAPIVersion = "2020-10-19" + +// Client provides the API client to make operations call for Amazon Connect Wisdom +// Service. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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 endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer aws.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "wisdom", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/wisdom/api_op_CreateAssistant.go b/service/wisdom/api_op_CreateAssistant.go new file mode 100644 index 00000000000..904445b2872 --- /dev/null +++ b/service/wisdom/api_op_CreateAssistant.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon Connect Wisdom assistant. +func (c *Client) CreateAssistant(ctx context.Context, params *CreateAssistantInput, optFns ...func(*Options)) (*CreateAssistantOutput, error) { + if params == nil { + params = &CreateAssistantInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAssistant", params, optFns, c.addOperationCreateAssistantMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAssistantOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAssistantInput struct { + + // The name of the assistant. + // + // This member is required. + Name *string + + // The type of assistant. + // + // This member is required. + Type types.AssistantType + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + // The description of the assistant. + Description *string + + // The KMS key used for encryption. + ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAssistantOutput struct { + + // Information about the assistant. + Assistant *types.AssistantData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAssistantMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAssistant{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAssistant{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateAssistantValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssistant(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateAssistant(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "CreateAssistant", + } +} diff --git a/service/wisdom/api_op_CreateAssistantAssociation.go b/service/wisdom/api_op_CreateAssistantAssociation.go new file mode 100644 index 00000000000..a309193821a --- /dev/null +++ b/service/wisdom/api_op_CreateAssistantAssociation.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an association between an Amazon Connect Wisdom assistant and another +// resource. Currently, the only supported association is with a knowledge base. An +// assistant can have only a single association. +func (c *Client) CreateAssistantAssociation(ctx context.Context, params *CreateAssistantAssociationInput, optFns ...func(*Options)) (*CreateAssistantAssociationOutput, error) { + if params == nil { + params = &CreateAssistantAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAssistantAssociation", params, optFns, c.addOperationCreateAssistantAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAssistantAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAssistantAssociationInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The identifier of the associated resource. + // + // This member is required. + Association types.AssistantAssociationInputData + + // The type of association. + // + // This member is required. + AssociationType types.AssociationType + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAssistantAssociationOutput struct { + + // The assistant association. + AssistantAssociation *types.AssistantAssociationData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAssistantAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAssistantAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAssistantAssociation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateAssistantAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssistantAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateAssistantAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "CreateAssistantAssociation", + } +} diff --git a/service/wisdom/api_op_CreateContent.go b/service/wisdom/api_op_CreateContent.go new file mode 100644 index 00000000000..8e2368e1332 --- /dev/null +++ b/service/wisdom/api_op_CreateContent.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates Wisdom content. Before to calling this API, use StartContentUpload +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html) +// to upload an asset. +func (c *Client) CreateContent(ctx context.Context, params *CreateContentInput, optFns ...func(*Options)) (*CreateContentOutput, error) { + if params == nil { + params = &CreateContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateContent", params, optFns, c.addOperationCreateContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateContentInput struct { + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The name of the content. Each piece of content in a knowledge base must have a + // unique name. You can retrieve a piece of content using only its knowledge base + // and its name with the SearchContent + // (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_SearchContent.html) + // API. + // + // This member is required. + Name *string + + // A pointer to the uploaded asset. This value is returned by StartContentUpload + // (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html). + // + // This member is required. + UploadId *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + // A key/value map to store attributes without affecting tagging or + // recommendations. For example, when synchronizing data between an external system + // and Wisdom, you can store an external version identifier as metadata to utilize + // for determining drift. + Metadata map[string]string + + // The URI you want to use for the article. If the knowledge base has a + // templateUri, setting this argument overrides it for this piece of content. + OverrideLinkOutUri *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // The title of the content. If not set, the title is equal to the name. + Title *string + + noSmithyDocumentSerde +} + +type CreateContentOutput struct { + + // The content. + Content *types.ContentData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "CreateContent", + } +} diff --git a/service/wisdom/api_op_CreateKnowledgeBase.go b/service/wisdom/api_op_CreateKnowledgeBase.go new file mode 100644 index 00000000000..1ea3d10fa06 --- /dev/null +++ b/service/wisdom/api_op_CreateKnowledgeBase.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a knowledge base. When using this API, you cannot reuse Amazon +// AppIntegrations +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html) +// DataIntegrations with external knowledge bases such as Salesforce and +// ServiceNow. If you do, you'll get an InvalidRequestException error. For example, +// you're programmatically managing your external knowledge base, and you want to +// add or remove one of the fields that is being ingested from Salesforce. Do the +// following: +// +// * Call DeleteKnowledgeBase +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_DeleteKnowledgeBase.html). +// +// * +// Call DeleteDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html). +// +// * +// Call CreateDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) +// to recreate the DataIntegration or a create different one. +// +// * Call +// CreateKnowledgeBase. +func (c *Client) CreateKnowledgeBase(ctx context.Context, params *CreateKnowledgeBaseInput, optFns ...func(*Options)) (*CreateKnowledgeBaseOutput, error) { + if params == nil { + params = &CreateKnowledgeBaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateKnowledgeBase", params, optFns, c.addOperationCreateKnowledgeBaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateKnowledgeBaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateKnowledgeBaseInput struct { + + // The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your + // own content. EXTERNAL knowledge bases support integrations with third-party + // systems whose content is synchronized automatically. + // + // This member is required. + KnowledgeBaseType types.KnowledgeBaseType + + // The name of the knowledge base. + // + // This member is required. + Name *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + // The description. + Description *string + + // Information about how to render the content. + RenderingConfiguration *types.RenderingConfiguration + + // The KMS key used for encryption. + ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration + + // The source of the knowledge base content. Only set this argument for EXTERNAL + // knowledge bases. + SourceConfiguration types.SourceConfiguration + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateKnowledgeBaseOutput struct { + + // The knowledge base. + KnowledgeBase *types.KnowledgeBaseData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateKnowledgeBaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateKnowledgeBase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateKnowledgeBase{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateKnowledgeBaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateKnowledgeBase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateKnowledgeBase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "CreateKnowledgeBase", + } +} diff --git a/service/wisdom/api_op_CreateSession.go b/service/wisdom/api_op_CreateSession.go new file mode 100644 index 00000000000..bcaf0b20019 --- /dev/null +++ b/service/wisdom/api_op_CreateSession.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a session. A session is a contextual container used for generating +// recommendations. Amazon Connect creates a new Wisdom session for each contact on +// which Wisdom is enabled. +func (c *Client) CreateSession(ctx context.Context, params *CreateSessionInput, optFns ...func(*Options)) (*CreateSessionOutput, error) { + if params == nil { + params = &CreateSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSession", params, optFns, c.addOperationCreateSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSessionInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The name of the session. + // + // This member is required. + Name *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + // The description. + Description *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateSessionOutput struct { + + // The session. + Session *types.SessionData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSession(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "CreateSession", + } +} diff --git a/service/wisdom/api_op_DeleteAssistant.go b/service/wisdom/api_op_DeleteAssistant.go new file mode 100644 index 00000000000..db6bad51b24 --- /dev/null +++ b/service/wisdom/api_op_DeleteAssistant.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an assistant. +func (c *Client) DeleteAssistant(ctx context.Context, params *DeleteAssistantInput, optFns ...func(*Options)) (*DeleteAssistantOutput, error) { + if params == nil { + params = &DeleteAssistantInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAssistant", params, optFns, c.addOperationDeleteAssistantMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAssistantOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAssistantInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type DeleteAssistantOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAssistantMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAssistant{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAssistant{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAssistantValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssistant(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAssistant(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "DeleteAssistant", + } +} diff --git a/service/wisdom/api_op_DeleteAssistantAssociation.go b/service/wisdom/api_op_DeleteAssistantAssociation.go new file mode 100644 index 00000000000..eb3a23564ca --- /dev/null +++ b/service/wisdom/api_op_DeleteAssistantAssociation.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an assistant association. +func (c *Client) DeleteAssistantAssociation(ctx context.Context, params *DeleteAssistantAssociationInput, optFns ...func(*Options)) (*DeleteAssistantAssociationOutput, error) { + if params == nil { + params = &DeleteAssistantAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAssistantAssociation", params, optFns, c.addOperationDeleteAssistantAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAssistantAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAssistantAssociationInput struct { + + // The identifier of the assistant association. Can be either the ID or the ARN. + // URLs cannot contain the ARN. + // + // This member is required. + AssistantAssociationId *string + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type DeleteAssistantAssociationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAssistantAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAssistantAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAssistantAssociation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAssistantAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssistantAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAssistantAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "DeleteAssistantAssociation", + } +} diff --git a/service/wisdom/api_op_DeleteContent.go b/service/wisdom/api_op_DeleteContent.go new file mode 100644 index 00000000000..20650b35d4b --- /dev/null +++ b/service/wisdom/api_op_DeleteContent.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the content. +func (c *Client) DeleteContent(ctx context.Context, params *DeleteContentInput, optFns ...func(*Options)) (*DeleteContentOutput, error) { + if params == nil { + params = &DeleteContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteContent", params, optFns, c.addOperationDeleteContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteContentInput struct { + + // The identifier of the content. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + ContentId *string + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type DeleteContentOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "DeleteContent", + } +} diff --git a/service/wisdom/api_op_DeleteKnowledgeBase.go b/service/wisdom/api_op_DeleteKnowledgeBase.go new file mode 100644 index 00000000000..aa3af8c9626 --- /dev/null +++ b/service/wisdom/api_op_DeleteKnowledgeBase.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the knowledge base. When you use this API to delete an external +// knowledge base such as Salesforce or ServiceNow, you must also delete the Amazon +// AppIntegrations +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html) +// DataIntegration. This is because you can't reuse the DataIntegration after it's +// been associated with an external knowledge base. However, you can delete and +// recreate it. See DeleteDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html) +// and CreateDataIntegration +// (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) +// in the Amazon AppIntegrations API Reference. +func (c *Client) DeleteKnowledgeBase(ctx context.Context, params *DeleteKnowledgeBaseInput, optFns ...func(*Options)) (*DeleteKnowledgeBaseOutput, error) { + if params == nil { + params = &DeleteKnowledgeBaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteKnowledgeBase", params, optFns, c.addOperationDeleteKnowledgeBaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteKnowledgeBaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteKnowledgeBaseInput struct { + + // The knowledge base to delete content from. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type DeleteKnowledgeBaseOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteKnowledgeBaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteKnowledgeBase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteKnowledgeBase{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteKnowledgeBaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteKnowledgeBase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteKnowledgeBase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "DeleteKnowledgeBase", + } +} diff --git a/service/wisdom/api_op_GetAssistant.go b/service/wisdom/api_op_GetAssistant.go new file mode 100644 index 00000000000..b4ad1ce82a0 --- /dev/null +++ b/service/wisdom/api_op_GetAssistant.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about an assistant. +func (c *Client) GetAssistant(ctx context.Context, params *GetAssistantInput, optFns ...func(*Options)) (*GetAssistantOutput, error) { + if params == nil { + params = &GetAssistantInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAssistant", params, optFns, c.addOperationGetAssistantMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAssistantOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAssistantInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type GetAssistantOutput struct { + + // Information about the assistant. + Assistant *types.AssistantData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAssistantMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAssistant{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAssistant{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetAssistantValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssistant(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAssistant(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "GetAssistant", + } +} diff --git a/service/wisdom/api_op_GetAssistantAssociation.go b/service/wisdom/api_op_GetAssistantAssociation.go new file mode 100644 index 00000000000..968d672e02e --- /dev/null +++ b/service/wisdom/api_op_GetAssistantAssociation.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about an assistant association. +func (c *Client) GetAssistantAssociation(ctx context.Context, params *GetAssistantAssociationInput, optFns ...func(*Options)) (*GetAssistantAssociationOutput, error) { + if params == nil { + params = &GetAssistantAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAssistantAssociation", params, optFns, c.addOperationGetAssistantAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAssistantAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAssistantAssociationInput struct { + + // The identifier of the assistant association. Can be either the ID or the ARN. + // URLs cannot contain the ARN. + // + // This member is required. + AssistantAssociationId *string + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + noSmithyDocumentSerde +} + +type GetAssistantAssociationOutput struct { + + // The assistant association. + AssistantAssociation *types.AssistantAssociationData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAssistantAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAssistantAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAssistantAssociation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetAssistantAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssistantAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAssistantAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "GetAssistantAssociation", + } +} diff --git a/service/wisdom/api_op_GetContent.go b/service/wisdom/api_op_GetContent.go new file mode 100644 index 00000000000..086cc81af81 --- /dev/null +++ b/service/wisdom/api_op_GetContent.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves content, including a pre-signed URL to download the content. +func (c *Client) GetContent(ctx context.Context, params *GetContentInput, optFns ...func(*Options)) (*GetContentOutput, error) { + if params == nil { + params = &GetContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetContent", params, optFns, c.addOperationGetContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetContentInput struct { + + // The identifier of the content. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + ContentId *string + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type GetContentOutput struct { + + // The content. + Content *types.ContentData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "GetContent", + } +} diff --git a/service/wisdom/api_op_GetContentSummary.go b/service/wisdom/api_op_GetContentSummary.go new file mode 100644 index 00000000000..90b7ead48f7 --- /dev/null +++ b/service/wisdom/api_op_GetContentSummary.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves summary information about the content. +func (c *Client) GetContentSummary(ctx context.Context, params *GetContentSummaryInput, optFns ...func(*Options)) (*GetContentSummaryOutput, error) { + if params == nil { + params = &GetContentSummaryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetContentSummary", params, optFns, c.addOperationGetContentSummaryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetContentSummaryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetContentSummaryInput struct { + + // The identifier of the content. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + ContentId *string + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type GetContentSummaryOutput struct { + + // The content summary. + ContentSummary *types.ContentSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetContentSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetContentSummary{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetContentSummary{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetContentSummaryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContentSummary(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetContentSummary(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "GetContentSummary", + } +} diff --git a/service/wisdom/api_op_GetKnowledgeBase.go b/service/wisdom/api_op_GetKnowledgeBase.go new file mode 100644 index 00000000000..0550e642b72 --- /dev/null +++ b/service/wisdom/api_op_GetKnowledgeBase.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about the knowledge base. +func (c *Client) GetKnowledgeBase(ctx context.Context, params *GetKnowledgeBaseInput, optFns ...func(*Options)) (*GetKnowledgeBaseOutput, error) { + if params == nil { + params = &GetKnowledgeBaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetKnowledgeBase", params, optFns, c.addOperationGetKnowledgeBaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetKnowledgeBaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetKnowledgeBaseInput struct { + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type GetKnowledgeBaseOutput struct { + + // The knowledge base. + KnowledgeBase *types.KnowledgeBaseData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetKnowledgeBaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetKnowledgeBase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetKnowledgeBase{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetKnowledgeBaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetKnowledgeBase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetKnowledgeBase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "GetKnowledgeBase", + } +} diff --git a/service/wisdom/api_op_GetRecommendations.go b/service/wisdom/api_op_GetRecommendations.go new file mode 100644 index 00000000000..c2caa3a40f5 --- /dev/null +++ b/service/wisdom/api_op_GetRecommendations.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves recommendations for the specified session. To avoid retrieving the +// same recommendations in subsequent calls, use NotifyRecommendationsReceived +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_NotifyRecommendationsReceived.html). +// This API supports long-polling behavior with the waitTimeSeconds parameter. +// Short poll is the default behavior and only returns recommendations already +// available. To perform a manual query against an assistant, use QueryAssistant +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_QueryAssistant.html). +func (c *Client) GetRecommendations(ctx context.Context, params *GetRecommendationsInput, optFns ...func(*Options)) (*GetRecommendationsOutput, error) { + if params == nil { + params = &GetRecommendationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRecommendations", params, optFns, c.addOperationGetRecommendationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRecommendationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRecommendationsInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The identifier of the session. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + SessionId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The duration (in seconds) for which the call waits for a recommendation to be + // made available before returning. If a recommendation is available, the call + // returns sooner than WaitTimeSeconds. If no messages are available and the wait + // time expires, the call returns successfully with an empty list. + WaitTimeSeconds int32 + + noSmithyDocumentSerde +} + +type GetRecommendationsOutput struct { + + // The recommendations. + // + // This member is required. + Recommendations []types.RecommendationData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRecommendations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetRecommendationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRecommendations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "GetRecommendations", + } +} diff --git a/service/wisdom/api_op_GetSession.go b/service/wisdom/api_op_GetSession.go new file mode 100644 index 00000000000..5442f9c6c4c --- /dev/null +++ b/service/wisdom/api_op_GetSession.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information for a specified session. +func (c *Client) GetSession(ctx context.Context, params *GetSessionInput, optFns ...func(*Options)) (*GetSessionOutput, error) { + if params == nil { + params = &GetSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSession", params, optFns, c.addOperationGetSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSessionInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The identifier of the session. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + SessionId *string + + noSmithyDocumentSerde +} + +type GetSessionOutput struct { + + // The session. + Session *types.SessionData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSession(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "GetSession", + } +} diff --git a/service/wisdom/api_op_ListAssistantAssociations.go b/service/wisdom/api_op_ListAssistantAssociations.go new file mode 100644 index 00000000000..3e0c996234f --- /dev/null +++ b/service/wisdom/api_op_ListAssistantAssociations.go @@ -0,0 +1,223 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists information about assistant associations. +func (c *Client) ListAssistantAssociations(ctx context.Context, params *ListAssistantAssociationsInput, optFns ...func(*Options)) (*ListAssistantAssociationsOutput, error) { + if params == nil { + params = &ListAssistantAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAssistantAssociations", params, optFns, c.addOperationListAssistantAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAssistantAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAssistantAssociationsInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAssistantAssociationsOutput struct { + + // Summary information about assistant associations. + // + // This member is required. + AssistantAssociationSummaries []types.AssistantAssociationSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAssistantAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssistantAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssistantAssociations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListAssistantAssociationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssistantAssociations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListAssistantAssociationsAPIClient is a client that implements the +// ListAssistantAssociations operation. +type ListAssistantAssociationsAPIClient interface { + ListAssistantAssociations(context.Context, *ListAssistantAssociationsInput, ...func(*Options)) (*ListAssistantAssociationsOutput, error) +} + +var _ ListAssistantAssociationsAPIClient = (*Client)(nil) + +// ListAssistantAssociationsPaginatorOptions is the paginator options for +// ListAssistantAssociations +type ListAssistantAssociationsPaginatorOptions 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 +} + +// ListAssistantAssociationsPaginator is a paginator for ListAssistantAssociations +type ListAssistantAssociationsPaginator struct { + options ListAssistantAssociationsPaginatorOptions + client ListAssistantAssociationsAPIClient + params *ListAssistantAssociationsInput + nextToken *string + firstPage bool +} + +// NewListAssistantAssociationsPaginator returns a new +// ListAssistantAssociationsPaginator +func NewListAssistantAssociationsPaginator(client ListAssistantAssociationsAPIClient, params *ListAssistantAssociationsInput, optFns ...func(*ListAssistantAssociationsPaginatorOptions)) *ListAssistantAssociationsPaginator { + if params == nil { + params = &ListAssistantAssociationsInput{} + } + + options := ListAssistantAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAssistantAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssistantAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssistantAssociations page. +func (p *ListAssistantAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssistantAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListAssistantAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListAssistantAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "ListAssistantAssociations", + } +} diff --git a/service/wisdom/api_op_ListAssistants.go b/service/wisdom/api_op_ListAssistants.go new file mode 100644 index 00000000000..d4230ce22ed --- /dev/null +++ b/service/wisdom/api_op_ListAssistants.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists information about assistants. +func (c *Client) ListAssistants(ctx context.Context, params *ListAssistantsInput, optFns ...func(*Options)) (*ListAssistantsOutput, error) { + if params == nil { + params = &ListAssistantsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAssistants", params, optFns, c.addOperationListAssistantsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAssistantsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAssistantsInput struct { + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAssistantsOutput struct { + + // Information about the assistants. + // + // This member is required. + AssistantSummaries []types.AssistantSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAssistantsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssistants{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssistants{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssistants(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListAssistantsAPIClient is a client that implements the ListAssistants +// operation. +type ListAssistantsAPIClient interface { + ListAssistants(context.Context, *ListAssistantsInput, ...func(*Options)) (*ListAssistantsOutput, error) +} + +var _ ListAssistantsAPIClient = (*Client)(nil) + +// ListAssistantsPaginatorOptions is the paginator options for ListAssistants +type ListAssistantsPaginatorOptions 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 +} + +// ListAssistantsPaginator is a paginator for ListAssistants +type ListAssistantsPaginator struct { + options ListAssistantsPaginatorOptions + client ListAssistantsAPIClient + params *ListAssistantsInput + nextToken *string + firstPage bool +} + +// NewListAssistantsPaginator returns a new ListAssistantsPaginator +func NewListAssistantsPaginator(client ListAssistantsAPIClient, params *ListAssistantsInput, optFns ...func(*ListAssistantsPaginatorOptions)) *ListAssistantsPaginator { + if params == nil { + params = &ListAssistantsInput{} + } + + options := ListAssistantsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAssistantsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssistantsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssistants page. +func (p *ListAssistantsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssistantsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListAssistants(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListAssistants(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "ListAssistants", + } +} diff --git a/service/wisdom/api_op_ListContents.go b/service/wisdom/api_op_ListContents.go new file mode 100644 index 00000000000..16d15d4bb7b --- /dev/null +++ b/service/wisdom/api_op_ListContents.go @@ -0,0 +1,220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the content. +func (c *Client) ListContents(ctx context.Context, params *ListContentsInput, optFns ...func(*Options)) (*ListContentsOutput, error) { + if params == nil { + params = &ListContentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListContents", params, optFns, c.addOperationListContentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListContentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListContentsInput struct { + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListContentsOutput struct { + + // Information about the content. + // + // This member is required. + ContentSummaries []types.ContentSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListContentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListContents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListContents{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListContentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListContents(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListContentsAPIClient is a client that implements the ListContents operation. +type ListContentsAPIClient interface { + ListContents(context.Context, *ListContentsInput, ...func(*Options)) (*ListContentsOutput, error) +} + +var _ ListContentsAPIClient = (*Client)(nil) + +// ListContentsPaginatorOptions is the paginator options for ListContents +type ListContentsPaginatorOptions 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 +} + +// ListContentsPaginator is a paginator for ListContents +type ListContentsPaginator struct { + options ListContentsPaginatorOptions + client ListContentsAPIClient + params *ListContentsInput + nextToken *string + firstPage bool +} + +// NewListContentsPaginator returns a new ListContentsPaginator +func NewListContentsPaginator(client ListContentsAPIClient, params *ListContentsInput, optFns ...func(*ListContentsPaginatorOptions)) *ListContentsPaginator { + if params == nil { + params = &ListContentsInput{} + } + + options := ListContentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListContentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContents page. +func (p *ListContentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListContents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListContents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "ListContents", + } +} diff --git a/service/wisdom/api_op_ListKnowledgeBases.go b/service/wisdom/api_op_ListKnowledgeBases.go new file mode 100644 index 00000000000..502f4b6a299 --- /dev/null +++ b/service/wisdom/api_op_ListKnowledgeBases.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the knowledge bases. +func (c *Client) ListKnowledgeBases(ctx context.Context, params *ListKnowledgeBasesInput, optFns ...func(*Options)) (*ListKnowledgeBasesOutput, error) { + if params == nil { + params = &ListKnowledgeBasesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListKnowledgeBases", params, optFns, c.addOperationListKnowledgeBasesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListKnowledgeBasesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListKnowledgeBasesInput struct { + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListKnowledgeBasesOutput struct { + + // Information about the knowledge bases. + // + // This member is required. + KnowledgeBaseSummaries []types.KnowledgeBaseSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListKnowledgeBasesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListKnowledgeBases{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListKnowledgeBases{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListKnowledgeBases(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListKnowledgeBasesAPIClient is a client that implements the ListKnowledgeBases +// operation. +type ListKnowledgeBasesAPIClient interface { + ListKnowledgeBases(context.Context, *ListKnowledgeBasesInput, ...func(*Options)) (*ListKnowledgeBasesOutput, error) +} + +var _ ListKnowledgeBasesAPIClient = (*Client)(nil) + +// ListKnowledgeBasesPaginatorOptions is the paginator options for +// ListKnowledgeBases +type ListKnowledgeBasesPaginatorOptions 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 +} + +// ListKnowledgeBasesPaginator is a paginator for ListKnowledgeBases +type ListKnowledgeBasesPaginator struct { + options ListKnowledgeBasesPaginatorOptions + client ListKnowledgeBasesAPIClient + params *ListKnowledgeBasesInput + nextToken *string + firstPage bool +} + +// NewListKnowledgeBasesPaginator returns a new ListKnowledgeBasesPaginator +func NewListKnowledgeBasesPaginator(client ListKnowledgeBasesAPIClient, params *ListKnowledgeBasesInput, optFns ...func(*ListKnowledgeBasesPaginatorOptions)) *ListKnowledgeBasesPaginator { + if params == nil { + params = &ListKnowledgeBasesInput{} + } + + options := ListKnowledgeBasesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListKnowledgeBasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKnowledgeBasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListKnowledgeBases page. +func (p *ListKnowledgeBasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKnowledgeBasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListKnowledgeBases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListKnowledgeBases(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "ListKnowledgeBases", + } +} diff --git a/service/wisdom/api_op_ListTagsForResource.go b/service/wisdom/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..4aa9551179c --- /dev/null +++ b/service/wisdom/api_op_ListTagsForResource.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags for the specified 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 +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The tags used to organize, track, or control access for this resource. + 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) { + 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 = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "ListTagsForResource", + } +} diff --git a/service/wisdom/api_op_NotifyRecommendationsReceived.go b/service/wisdom/api_op_NotifyRecommendationsReceived.go new file mode 100644 index 00000000000..0d2ddd0a7e9 --- /dev/null +++ b/service/wisdom/api_op_NotifyRecommendationsReceived.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the specified recommendations from the specified assistant's queue of +// newly available recommendations. You can use this API in conjunction with +// GetRecommendations +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_GetRecommendations.html) +// and a waitTimeSeconds input for long-polling behavior and avoiding duplicate +// recommendations. +func (c *Client) NotifyRecommendationsReceived(ctx context.Context, params *NotifyRecommendationsReceivedInput, optFns ...func(*Options)) (*NotifyRecommendationsReceivedOutput, error) { + if params == nil { + params = &NotifyRecommendationsReceivedInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "NotifyRecommendationsReceived", params, optFns, c.addOperationNotifyRecommendationsReceivedMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*NotifyRecommendationsReceivedOutput) + out.ResultMetadata = metadata + return out, nil +} + +type NotifyRecommendationsReceivedInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The identifiers of the recommendations. + // + // This member is required. + RecommendationIds []string + + // The identifier of the session. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + SessionId *string + + noSmithyDocumentSerde +} + +type NotifyRecommendationsReceivedOutput struct { + + // The identifiers of recommendations that are causing errors. + Errors []types.NotifyRecommendationsReceivedError + + // The identifiers of the recommendations. + RecommendationIds []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationNotifyRecommendationsReceivedMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpNotifyRecommendationsReceived{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpNotifyRecommendationsReceived{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpNotifyRecommendationsReceivedValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opNotifyRecommendationsReceived(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opNotifyRecommendationsReceived(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "NotifyRecommendationsReceived", + } +} diff --git a/service/wisdom/api_op_QueryAssistant.go b/service/wisdom/api_op_QueryAssistant.go new file mode 100644 index 00000000000..8978b47cf9c --- /dev/null +++ b/service/wisdom/api_op_QueryAssistant.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Performs a manual search against the specified assistant. To retrieve +// recommendations for an assistant, use GetRecommendations +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_GetRecommendations.html). +func (c *Client) QueryAssistant(ctx context.Context, params *QueryAssistantInput, optFns ...func(*Options)) (*QueryAssistantOutput, error) { + if params == nil { + params = &QueryAssistantInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "QueryAssistant", params, optFns, c.addOperationQueryAssistantMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*QueryAssistantOutput) + out.ResultMetadata = metadata + return out, nil +} + +type QueryAssistantInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The text to search for. + // + // This member is required. + QueryText *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type QueryAssistantOutput struct { + + // The results of the query. + // + // This member is required. + Results []types.ResultData + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationQueryAssistantMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpQueryAssistant{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpQueryAssistant{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpQueryAssistantValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opQueryAssistant(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// QueryAssistantAPIClient is a client that implements the QueryAssistant +// operation. +type QueryAssistantAPIClient interface { + QueryAssistant(context.Context, *QueryAssistantInput, ...func(*Options)) (*QueryAssistantOutput, error) +} + +var _ QueryAssistantAPIClient = (*Client)(nil) + +// QueryAssistantPaginatorOptions is the paginator options for QueryAssistant +type QueryAssistantPaginatorOptions 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 +} + +// QueryAssistantPaginator is a paginator for QueryAssistant +type QueryAssistantPaginator struct { + options QueryAssistantPaginatorOptions + client QueryAssistantAPIClient + params *QueryAssistantInput + nextToken *string + firstPage bool +} + +// NewQueryAssistantPaginator returns a new QueryAssistantPaginator +func NewQueryAssistantPaginator(client QueryAssistantAPIClient, params *QueryAssistantInput, optFns ...func(*QueryAssistantPaginatorOptions)) *QueryAssistantPaginator { + if params == nil { + params = &QueryAssistantInput{} + } + + options := QueryAssistantPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &QueryAssistantPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *QueryAssistantPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next QueryAssistant page. +func (p *QueryAssistantPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*QueryAssistantOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.QueryAssistant(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opQueryAssistant(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "QueryAssistant", + } +} diff --git a/service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go b/service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go new file mode 100644 index 00000000000..26cd45352b2 --- /dev/null +++ b/service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes a URI template from a knowledge base. +func (c *Client) RemoveKnowledgeBaseTemplateUri(ctx context.Context, params *RemoveKnowledgeBaseTemplateUriInput, optFns ...func(*Options)) (*RemoveKnowledgeBaseTemplateUriOutput, error) { + if params == nil { + params = &RemoveKnowledgeBaseTemplateUriInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveKnowledgeBaseTemplateUri", params, optFns, c.addOperationRemoveKnowledgeBaseTemplateUriMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveKnowledgeBaseTemplateUriOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveKnowledgeBaseTemplateUriInput struct { + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type RemoveKnowledgeBaseTemplateUriOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveKnowledgeBaseTemplateUriMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRemoveKnowledgeBaseTemplateUriValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveKnowledgeBaseTemplateUri(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveKnowledgeBaseTemplateUri(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "RemoveKnowledgeBaseTemplateUri", + } +} diff --git a/service/wisdom/api_op_SearchContent.go b/service/wisdom/api_op_SearchContent.go new file mode 100644 index 00000000000..7c7ff306285 --- /dev/null +++ b/service/wisdom/api_op_SearchContent.go @@ -0,0 +1,226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches for content in a specified knowledge base. Can be used to get a +// specific content resource by its name. +func (c *Client) SearchContent(ctx context.Context, params *SearchContentInput, optFns ...func(*Options)) (*SearchContentOutput, error) { + if params == nil { + params = &SearchContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchContent", params, optFns, c.addOperationSearchContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchContentInput struct { + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The search expression to filter results. + // + // This member is required. + SearchExpression *types.SearchExpression + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type SearchContentOutput struct { + + // Summary information about the content. + // + // This member is required. + ContentSummaries []types.ContentSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchContentAPIClient is a client that implements the SearchContent operation. +type SearchContentAPIClient interface { + SearchContent(context.Context, *SearchContentInput, ...func(*Options)) (*SearchContentOutput, error) +} + +var _ SearchContentAPIClient = (*Client)(nil) + +// SearchContentPaginatorOptions is the paginator options for SearchContent +type SearchContentPaginatorOptions 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 +} + +// SearchContentPaginator is a paginator for SearchContent +type SearchContentPaginator struct { + options SearchContentPaginatorOptions + client SearchContentAPIClient + params *SearchContentInput + nextToken *string + firstPage bool +} + +// NewSearchContentPaginator returns a new SearchContentPaginator +func NewSearchContentPaginator(client SearchContentAPIClient, params *SearchContentInput, optFns ...func(*SearchContentPaginatorOptions)) *SearchContentPaginator { + if params == nil { + params = &SearchContentInput{} + } + + options := SearchContentPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchContentPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchContentPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchContent page. +func (p *SearchContentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchContentOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchContent(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "SearchContent", + } +} diff --git a/service/wisdom/api_op_SearchSessions.go b/service/wisdom/api_op_SearchSessions.go new file mode 100644 index 00000000000..43c97e0de75 --- /dev/null +++ b/service/wisdom/api_op_SearchSessions.go @@ -0,0 +1,226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches for sessions. +func (c *Client) SearchSessions(ctx context.Context, params *SearchSessionsInput, optFns ...func(*Options)) (*SearchSessionsOutput, error) { + if params == nil { + params = &SearchSessionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchSessions", params, optFns, c.addOperationSearchSessionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchSessionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchSessionsInput struct { + + // The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + AssistantId *string + + // The search expression to filter results. + // + // This member is required. + SearchExpression *types.SearchExpression + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type SearchSessionsOutput struct { + + // Summary information about the sessions. + // + // This member is required. + SessionSummaries []types.SessionSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchSessionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchSessions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchSessions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchSessionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchSessions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchSessionsAPIClient is a client that implements the SearchSessions +// operation. +type SearchSessionsAPIClient interface { + SearchSessions(context.Context, *SearchSessionsInput, ...func(*Options)) (*SearchSessionsOutput, error) +} + +var _ SearchSessionsAPIClient = (*Client)(nil) + +// SearchSessionsPaginatorOptions is the paginator options for SearchSessions +type SearchSessionsPaginatorOptions 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 +} + +// SearchSessionsPaginator is a paginator for SearchSessions +type SearchSessionsPaginator struct { + options SearchSessionsPaginatorOptions + client SearchSessionsAPIClient + params *SearchSessionsInput + nextToken *string + firstPage bool +} + +// NewSearchSessionsPaginator returns a new SearchSessionsPaginator +func NewSearchSessionsPaginator(client SearchSessionsAPIClient, params *SearchSessionsInput, optFns ...func(*SearchSessionsPaginatorOptions)) *SearchSessionsPaginator { + if params == nil { + params = &SearchSessionsInput{} + } + + options := SearchSessionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchSessions page. +func (p *SearchSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchSessions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "SearchSessions", + } +} diff --git a/service/wisdom/api_op_StartContentUpload.go b/service/wisdom/api_op_StartContentUpload.go new file mode 100644 index 00000000000..f96d52b93fb --- /dev/null +++ b/service/wisdom/api_op_StartContentUpload.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Get a URL to upload content to a knowledge base. To upload content, first make a +// PUT request to the returned URL with your file, making sure to include the +// required headers. Then use CreateContent +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_CreateContent.html) +// to finalize the content creation process or UpdateContent +// (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_UpdateContent.html) +// to modify an existing resource. You can only upload content to a knowledge base +// of type CUSTOM. +func (c *Client) StartContentUpload(ctx context.Context, params *StartContentUploadInput, optFns ...func(*Options)) (*StartContentUploadOutput, error) { + if params == nil { + params = &StartContentUploadInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartContentUpload", params, optFns, c.addOperationStartContentUploadMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartContentUploadOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartContentUploadInput struct { + + // The type of content to upload. + // + // This member is required. + ContentType *string + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type StartContentUploadOutput struct { + + // The headers to include in the upload. + // + // This member is required. + HeadersToInclude map[string]string + + // The identifier of the upload. + // + // This member is required. + UploadId *string + + // The URL of the upload. + // + // This member is required. + Url *string + + // The expiration time of the URL as an epoch timestamp. + // + // This member is required. + UrlExpiry *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartContentUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartContentUpload{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartContentUpload{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpStartContentUploadValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartContentUpload(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartContentUpload(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "StartContentUpload", + } +} diff --git a/service/wisdom/api_op_TagResource.go b/service/wisdom/api_op_TagResource.go new file mode 100644 index 00000000000..4dd742aa0ba --- /dev/null +++ b/service/wisdom/api_op_TagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds the specified tags to the specified 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 +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + // The tags used to organize, track, or control access for this resource. + // + // 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) { + 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 = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "TagResource", + } +} diff --git a/service/wisdom/api_op_UntagResource.go b/service/wisdom/api_op_UntagResource.go new file mode 100644 index 00000000000..64568355eb9 --- /dev/null +++ b/service/wisdom/api_op_UntagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the specified tags from the specified 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 +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + // The 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) { + 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 = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "UntagResource", + } +} diff --git a/service/wisdom/api_op_UpdateContent.go b/service/wisdom/api_op_UpdateContent.go new file mode 100644 index 00000000000..01836deb68f --- /dev/null +++ b/service/wisdom/api_op_UpdateContent.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates information about the content. +func (c *Client) UpdateContent(ctx context.Context, params *UpdateContentInput, optFns ...func(*Options)) (*UpdateContentOutput, error) { + if params == nil { + params = &UpdateContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateContent", params, optFns, c.addOperationUpdateContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateContentInput struct { + + // The identifier of the content. Can be either the ID or the ARN. URLs cannot + // contain the ARN. + // + // This member is required. + ContentId *string + + // The the identifier of the knowledge base. Can be either the ID or the ARN + // + // This member is required. + KnowledgeBaseId *string + + // A key/value map to store attributes without affecting tagging or + // recommendations. For example, when synchronizing data between an external system + // and Wisdom, you can store an external version identifier as metadata to utilize + // for determining drift. + Metadata map[string]string + + // The URI for the article. If the knowledge base has a templateUri, setting this + // argument overrides it for this piece of content. To remove an existing + // overrideLinkOurUri, exclude this argument and set removeOverrideLinkOutUri to + // true. + OverrideLinkOutUri *string + + // Unset the existing overrideLinkOutUri if it exists. + RemoveOverrideLinkOutUri *bool + + // The revisionId of the content resource to update, taken from an earlier call to + // GetContent, GetContentSummary, SearchContent, or ListContents. If included, this + // argument acts as an optimistic lock to ensure content was not modified since it + // was last read. If it has been modified, this API throws a + // PreconditionFailedException. + RevisionId *string + + // The title of the content. + Title *string + + // A pointer to the uploaded asset. This value is returned by StartContentUpload + // (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html). + UploadId *string + + noSmithyDocumentSerde +} + +type UpdateContentOutput struct { + + // The content. + Content *types.ContentData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateContent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateContent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "UpdateContent", + } +} diff --git a/service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go b/service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go new file mode 100644 index 00000000000..60071ad81f2 --- /dev/null +++ b/service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the template URI of a knowledge base. This is only supported for +// knowledge bases of type EXTERNAL. Include a single variable in ${variable} +// format; this interpolated by Wisdom using ingested content. For example, if you +// ingest a Salesforce article, it has an Id value, and you can set the template +// URI to +// https://myInstanceName.lightning.force.com/lightning/r/Knowledge__kav/*${Id}*/view. +func (c *Client) UpdateKnowledgeBaseTemplateUri(ctx context.Context, params *UpdateKnowledgeBaseTemplateUriInput, optFns ...func(*Options)) (*UpdateKnowledgeBaseTemplateUriOutput, error) { + if params == nil { + params = &UpdateKnowledgeBaseTemplateUriInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateKnowledgeBaseTemplateUri", params, optFns, c.addOperationUpdateKnowledgeBaseTemplateUriMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateKnowledgeBaseTemplateUriOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateKnowledgeBaseTemplateUriInput struct { + + // The the identifier of the knowledge base. Can be either the ID or the ARN. URLs + // cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The template URI to update. + // + // This member is required. + TemplateUri *string + + noSmithyDocumentSerde +} + +type UpdateKnowledgeBaseTemplateUriOutput struct { + + // The knowledge base to update. + KnowledgeBase *types.KnowledgeBaseData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateKnowledgeBaseTemplateUriMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateKnowledgeBaseTemplateUri{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateKnowledgeBaseTemplateUriValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateKnowledgeBaseTemplateUri(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateKnowledgeBaseTemplateUri(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wisdom", + OperationName: "UpdateKnowledgeBaseTemplateUri", + } +} diff --git a/service/wisdom/deserializers.go b/service/wisdom/deserializers.go new file mode 100644 index 00000000000..88da63d3418 --- /dev/null +++ b/service/wisdom/deserializers.go @@ -0,0 +1,7144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "math" + "strings" +) + +type awsRestjson1_deserializeOpCreateAssistant struct { +} + +func (*awsRestjson1_deserializeOpCreateAssistant) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateAssistant(response, &metadata) + } + output := &CreateAssistantOutput{} + 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_deserializeOpDocumentCreateAssistantOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateAssistant(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateAssistantOutput(v **CreateAssistantOutput, 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 *CreateAssistantOutput + if *v == nil { + sv = &CreateAssistantOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistant": + if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateAssistantAssociation struct { +} + +func (*awsRestjson1_deserializeOpCreateAssistantAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateAssistantAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateAssistantAssociation(response, &metadata) + } + output := &CreateAssistantAssociationOutput{} + 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_deserializeOpDocumentCreateAssistantAssociationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateAssistantAssociation(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateAssistantAssociationOutput(v **CreateAssistantAssociationOutput, 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 *CreateAssistantAssociationOutput + if *v == nil { + sv = &CreateAssistantAssociationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantAssociation": + if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateContent struct { +} + +func (*awsRestjson1_deserializeOpCreateContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateContent(response, &metadata) + } + output := &CreateContentOutput{} + 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_deserializeOpDocumentCreateContentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateContent(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateContentOutput(v **CreateContentOutput, 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 *CreateContentOutput + if *v == nil { + sv = &CreateContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "content": + if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateKnowledgeBase struct { +} + +func (*awsRestjson1_deserializeOpCreateKnowledgeBase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateKnowledgeBase(response, &metadata) + } + output := &CreateKnowledgeBaseOutput{} + 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_deserializeOpDocumentCreateKnowledgeBaseOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateKnowledgeBase(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowledgeBaseOutput, 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 *CreateKnowledgeBaseOutput + if *v == nil { + sv = &CreateKnowledgeBaseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateSession struct { +} + +func (*awsRestjson1_deserializeOpCreateSession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateSession(response, &metadata) + } + output := &CreateSessionOutput{} + 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_deserializeOpDocumentCreateSessionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateSession(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(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_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutput, 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 *CreateSessionOutput + if *v == nil { + sv = &CreateSessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "session": + if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteAssistant struct { +} + +func (*awsRestjson1_deserializeOpDeleteAssistant) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistant(response, &metadata) + } + output := &DeleteAssistantOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteAssistant(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDeleteAssistantAssociation struct { +} + +func (*awsRestjson1_deserializeOpDeleteAssistantAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteAssistantAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response, &metadata) + } + output := &DeleteAssistantAssociationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDeleteContent struct { +} + +func (*awsRestjson1_deserializeOpDeleteContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteContent(response, &metadata) + } + output := &DeleteContentOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteContent(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDeleteKnowledgeBase struct { +} + +func (*awsRestjson1_deserializeOpDeleteKnowledgeBase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response, &metadata) + } + output := &DeleteKnowledgeBaseOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetAssistant struct { +} + +func (*awsRestjson1_deserializeOpGetAssistant) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetAssistant(response, &metadata) + } + output := &GetAssistantOutput{} + 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_deserializeOpDocumentGetAssistantOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetAssistant(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentGetAssistantOutput(v **GetAssistantOutput, 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 *GetAssistantOutput + if *v == nil { + sv = &GetAssistantOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistant": + if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetAssistantAssociation struct { +} + +func (*awsRestjson1_deserializeOpGetAssistantAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAssistantAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetAssistantAssociation(response, &metadata) + } + output := &GetAssistantAssociationOutput{} + 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_deserializeOpDocumentGetAssistantAssociationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetAssistantAssociation(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentGetAssistantAssociationOutput(v **GetAssistantAssociationOutput, 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 *GetAssistantAssociationOutput + if *v == nil { + sv = &GetAssistantAssociationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantAssociation": + if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetContent struct { +} + +func (*awsRestjson1_deserializeOpGetContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetContent(response, &metadata) + } + output := &GetContentOutput{} + 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_deserializeOpDocumentGetContentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetContent(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentGetContentOutput(v **GetContentOutput, 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 *GetContentOutput + if *v == nil { + sv = &GetContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "content": + if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetContentSummary struct { +} + +func (*awsRestjson1_deserializeOpGetContentSummary) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetContentSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetContentSummary(response, &metadata) + } + output := &GetContentSummaryOutput{} + 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_deserializeOpDocumentGetContentSummaryOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetContentSummary(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentGetContentSummaryOutput(v **GetContentSummaryOutput, 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 *GetContentSummaryOutput + if *v == nil { + sv = &GetContentSummaryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentSummary": + if err := awsRestjson1_deserializeDocumentContentSummary(&sv.ContentSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetKnowledgeBase struct { +} + +func (*awsRestjson1_deserializeOpGetKnowledgeBase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetKnowledgeBase(response, &metadata) + } + output := &GetKnowledgeBaseOutput{} + 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_deserializeOpDocumentGetKnowledgeBaseOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetKnowledgeBase(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBaseOutput, 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 *GetKnowledgeBaseOutput + if *v == nil { + sv = &GetKnowledgeBaseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetRecommendations struct { +} + +func (*awsRestjson1_deserializeOpGetRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetRecommendations(response, &metadata) + } + output := &GetRecommendationsOutput{} + 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_deserializeOpDocumentGetRecommendationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetRecommendations(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommendationsOutput, 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 *GetRecommendationsOutput + if *v == nil { + sv = &GetRecommendationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "recommendations": + if err := awsRestjson1_deserializeDocumentRecommendationList(&sv.Recommendations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSession struct { +} + +func (*awsRestjson1_deserializeOpGetSession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetSession(response, &metadata) + } + output := &GetSessionOutput{} + 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_deserializeOpDocumentGetSessionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSession(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, 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 *GetSessionOutput + if *v == nil { + sv = &GetSessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "session": + if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAssistantAssociations struct { +} + +func (*awsRestjson1_deserializeOpListAssistantAssociations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListAssistantAssociations(response, &metadata) + } + output := &ListAssistantAssociationsOutput{} + 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_deserializeOpDocumentListAssistantAssociationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListAssistantAssociations(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentListAssistantAssociationsOutput(v **ListAssistantAssociationsOutput, 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 *ListAssistantAssociationsOutput + if *v == nil { + sv = &ListAssistantAssociationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantAssociationSummaries": + if err := awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(&sv.AssistantAssociationSummaries, 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_deserializeOpListAssistants struct { +} + +func (*awsRestjson1_deserializeOpListAssistants) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListAssistants(response, &metadata) + } + output := &ListAssistantsOutput{} + 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_deserializeOpDocumentListAssistantsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListAssistants(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOutput, 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 *ListAssistantsOutput + if *v == nil { + sv = &ListAssistantsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantSummaries": + if err := awsRestjson1_deserializeDocumentAssistantList(&sv.AssistantSummaries, 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_deserializeOpListContents struct { +} + +func (*awsRestjson1_deserializeOpListContents) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListContents(response, &metadata) + } + output := &ListContentsOutput{} + 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_deserializeOpDocumentListContentsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListContents(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentListContentsOutput(v **ListContentsOutput, 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 *ListContentsOutput + if *v == nil { + sv = &ListContentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentSummaries": + if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, 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_deserializeOpListKnowledgeBases struct { +} + +func (*awsRestjson1_deserializeOpListKnowledgeBases) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListKnowledgeBases(response, &metadata) + } + output := &ListKnowledgeBasesOutput{} + 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_deserializeOpDocumentListKnowledgeBasesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListKnowledgeBases(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledgeBasesOutput, 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 *ListKnowledgeBasesOutput + if *v == nil { + sv = &ListKnowledgeBasesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBaseSummaries": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseList(&sv.KnowledgeBaseSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString 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 + } + + 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(), + } + } + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(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_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpNotifyRecommendationsReceived struct { +} + +func (*awsRestjson1_deserializeOpNotifyRecommendationsReceived) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response, &metadata) + } + output := &NotifyRecommendationsReceivedOutput{} + 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_deserializeOpDocumentNotifyRecommendationsReceivedOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **NotifyRecommendationsReceivedOutput, 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 *NotifyRecommendationsReceivedOutput + if *v == nil { + sv = &NotifyRecommendationsReceivedOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(&sv.Errors, value); err != nil { + return err + } + + case "recommendationIds": + if err := awsRestjson1_deserializeDocumentRecommendationIdList(&sv.RecommendationIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpQueryAssistant struct { +} + +func (*awsRestjson1_deserializeOpQueryAssistant) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorQueryAssistant(response, &metadata) + } + output := &QueryAssistantOutput{} + 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_deserializeOpDocumentQueryAssistantOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorQueryAssistant(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOutput, 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 *QueryAssistantOutput + if *v == nil { + sv = &QueryAssistantOutput{} + } 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 "results": + if err := awsRestjson1_deserializeDocumentQueryResultsList(&sv.Results, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri struct { +} + +func (*awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response, &metadata) + } + output := &RemoveKnowledgeBaseTemplateUriOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpSearchContent struct { +} + +func (*awsRestjson1_deserializeOpSearchContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchContent(response, &metadata) + } + output := &SearchContentOutput{} + 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_deserializeOpDocumentSearchContentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchContent(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentSearchContentOutput(v **SearchContentOutput, 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 *SearchContentOutput + if *v == nil { + sv = &SearchContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentSummaries": + if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, 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_deserializeOpSearchSessions struct { +} + +func (*awsRestjson1_deserializeOpSearchSessions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchSessions(response, &metadata) + } + output := &SearchSessionsOutput{} + 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_deserializeOpDocumentSearchSessionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchSessions(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOutput, 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 *SearchSessionsOutput + if *v == nil { + sv = &SearchSessionsOutput{} + } 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 "sessionSummaries": + if err := awsRestjson1_deserializeDocumentSessionSummaries(&sv.SessionSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartContentUpload struct { +} + +func (*awsRestjson1_deserializeOpStartContentUpload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartContentUpload(response, &metadata) + } + output := &StartContentUploadOutput{} + 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_deserializeOpDocumentStartContentUploadOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartContentUpload(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentStartContentUploadOutput(v **StartContentUploadOutput, 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 *StartContentUploadOutput + if *v == nil { + sv = &StartContentUploadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "headersToInclude": + if err := awsRestjson1_deserializeDocumentHeaders(&sv.HeadersToInclude, value); err != nil { + return err + } + + case "uploadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.UploadId = ptr.String(jtv) + } + + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + case "urlExpiry": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UrlExpiry = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +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 + } + + 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 + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(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 + } + + 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 + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateContent struct { +} + +func (*awsRestjson1_deserializeOpUpdateContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateContent(response, &metadata) + } + output := &UpdateContentOutput{} + 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_deserializeOpDocumentUpdateContentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateContent(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("PreconditionFailedException", errorCode): + return awsRestjson1_deserializeErrorPreconditionFailedException(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_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutput, 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 *UpdateContentOutput + if *v == nil { + sv = &UpdateContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "content": + if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri struct { +} + +func (*awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response, &metadata) + } + output := &UpdateKnowledgeBaseTemplateUriOutput{} + 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_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v **UpdateKnowledgeBaseTemplateUriOutput, 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 *UpdateKnowledgeBaseTemplateUriOutput + if *v == nil { + sv = &UpdateKnowledgeBaseTemplateUriOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + 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) + + 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) + + return output +} + +func awsRestjson1_deserializeErrorPreconditionFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PreconditionFailedException{} + 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_deserializeDocumentPreconditionFailedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func 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) + + 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) + + return output +} + +func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} + 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_deserializeDocumentTooManyTagsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func 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) + + 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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppIntegrationsConfiguration(v **types.AppIntegrationsConfiguration, 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.AppIntegrationsConfiguration + if *v == nil { + sv = &types.AppIntegrationsConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appIntegrationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) + } + sv.AppIntegrationArn = ptr.String(jtv) + } + + case "objectFields": + if err := awsRestjson1_deserializeDocumentObjectFieldsList(&sv.ObjectFields, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssistantAssociationData(v **types.AssistantAssociationData, 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.AssistantAssociationData + if *v == nil { + sv = &types.AssistantAssociationData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantAssociationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantAssociationArn = ptr.String(jtv) + } + + case "assistantAssociationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantAssociationId = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "associationData": + if err := awsRestjson1_deserializeDocumentAssistantAssociationOutputData(&sv.AssociationData, value); err != nil { + return err + } + + case "associationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssociationType to be of type string, got %T instead", value) + } + sv.AssociationType = types.AssociationType(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssistantAssociationOutputData(v *types.AssistantAssociationOutputData, 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.AssistantAssociationOutputData +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "knowledgeBaseAssociation": + var mv types.KnowledgeBaseAssociationData + destAddr := &mv + if err := awsRestjson1_deserializeDocumentKnowledgeBaseAssociationData(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AssistantAssociationOutputDataMemberKnowledgeBaseAssociation{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentAssistantAssociationSummary(v **types.AssistantAssociationSummary, 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.AssistantAssociationSummary + if *v == nil { + sv = &types.AssistantAssociationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantAssociationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantAssociationArn = ptr.String(jtv) + } + + case "assistantAssociationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantAssociationId = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "associationData": + if err := awsRestjson1_deserializeDocumentAssistantAssociationOutputData(&sv.AssociationData, value); err != nil { + return err + } + + case "associationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssociationType to be of type string, got %T instead", value) + } + sv.AssociationType = types.AssociationType(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(v *[]types.AssistantAssociationSummary, 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.AssistantAssociationSummary + if *v == nil { + cv = []types.AssistantAssociationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssistantAssociationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssistantAssociationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssistantData(v **types.AssistantData, 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.AssistantData + if *v == nil { + sv = &types.AssistantData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "serverSideEncryptionConfiguration": + if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssistantStatus to be of type string, got %T instead", value) + } + sv.Status = types.AssistantStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssistantType to be of type string, got %T instead", value) + } + sv.Type = types.AssistantType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssistantList(v *[]types.AssistantSummary, 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.AssistantSummary + if *v == nil { + cv = []types.AssistantSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssistantSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssistantSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary, 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.AssistantSummary + if *v == nil { + sv = &types.AssistantSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "serverSideEncryptionConfiguration": + if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssistantStatus to be of type string, got %T instead", value) + } + sv.Status = types.AssistantStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssistantType to be of type string, got %T instead", value) + } + sv.Type = types.AssistantType(jtv) + } + + 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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContentData(v **types.ContentData, 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.ContentData + if *v == nil { + sv = &types.ContentData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ContentArn = ptr.String(jtv) + } + + case "contentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.ContentId = ptr.String(jtv) + } + + case "contentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) + } + sv.ContentType = ptr.String(jtv) + } + + 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) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "linkOutUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uri to be of type string, got %T instead", value) + } + sv.LinkOutUri = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentContentMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "revisionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RevisionId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentStatus to be of type string, got %T instead", value) + } + sv.Status = types.ContentStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentTitle to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + case "urlExpiry": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UrlExpiry = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContentMetadata(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 NonEmptyString to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentContentReference(v **types.ContentReference, 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.ContentReference + if *v == nil { + sv = &types.ContentReference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ContentArn = ptr.String(jtv) + } + + case "contentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.ContentId = ptr.String(jtv) + } + + 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) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContentSummary(v **types.ContentSummary, 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.ContentSummary + if *v == nil { + sv = &types.ContentSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ContentArn = ptr.String(jtv) + } + + case "contentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.ContentId = ptr.String(jtv) + } + + case "contentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) + } + sv.ContentType = ptr.String(jtv) + } + + 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) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentContentMetadata(&sv.Metadata, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "revisionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RevisionId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentStatus to be of type string, got %T instead", value) + } + sv.Status = types.ContentStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentTitle to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContentSummaryList(v *[]types.ContentSummary, 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.ContentSummary + if *v == nil { + cv = []types.ContentSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ContentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentContentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDocument(v **types.Document, 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.Document + if *v == nil { + sv = &types.Document{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentReference": + if err := awsRestjson1_deserializeDocumentContentReference(&sv.ContentReference, value); err != nil { + return err + } + + case "excerpt": + if err := awsRestjson1_deserializeDocumentDocumentText(&sv.Excerpt, value); err != nil { + return err + } + + case "title": + if err := awsRestjson1_deserializeDocumentDocumentText(&sv.Title, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDocumentText(v **types.DocumentText, 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.DocumentText + if *v == nil { + sv = &types.DocumentText{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "highlights": + if err := awsRestjson1_deserializeDocumentHighlights(&sv.Highlights, value); err != nil { + return err + } + + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHeaders(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 NonEmptyString to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentHighlight(v **types.Highlight, 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.Highlight + if *v == nil { + sv = &types.Highlight{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "beginOffsetInclusive": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HighlightOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BeginOffsetInclusive = int32(i64) + } + + case "endOffsetExclusive": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HighlightOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndOffsetExclusive = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHighlights(v *[]types.Highlight, 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.Highlight + if *v == nil { + cv = []types.Highlight{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Highlight + destAddr := &col + if err := awsRestjson1_deserializeDocumentHighlight(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentKnowledgeBaseAssociationData(v **types.KnowledgeBaseAssociationData, 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.KnowledgeBaseAssociationData + if *v == nil { + sv = &types.KnowledgeBaseAssociationData{} + } 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) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseData, 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.KnowledgeBaseData + if *v == nil { + sv = &types.KnowledgeBaseData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + 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) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "knowledgeBaseType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseType to be of type string, got %T instead", value) + } + sv.KnowledgeBaseType = types.KnowledgeBaseType(jtv) + } + + case "lastContentModificationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastContentModificationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "renderingConfiguration": + if err := awsRestjson1_deserializeDocumentRenderingConfiguration(&sv.RenderingConfiguration, value); err != nil { + return err + } + + case "serverSideEncryptionConfiguration": + if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + return err + } + + case "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) + } + sv.Status = types.KnowledgeBaseStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKnowledgeBaseList(v *[]types.KnowledgeBaseSummary, 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.KnowledgeBaseSummary + if *v == nil { + cv = []types.KnowledgeBaseSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.KnowledgeBaseSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentKnowledgeBaseSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBaseSummary, 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.KnowledgeBaseSummary + if *v == nil { + sv = &types.KnowledgeBaseSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + 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) + } + + case "knowledgeBaseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.KnowledgeBaseId = ptr.String(jtv) + } + + case "knowledgeBaseType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseType to be of type string, got %T instead", value) + } + sv.KnowledgeBaseType = types.KnowledgeBaseType(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "renderingConfiguration": + if err := awsRestjson1_deserializeDocumentRenderingConfiguration(&sv.RenderingConfiguration, value); err != nil { + return err + } + + case "serverSideEncryptionConfiguration": + if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + return err + } + + case "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) + } + sv.Status = types.KnowledgeBaseStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedError(v **types.NotifyRecommendationsReceivedError, 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.NotifyRecommendationsReceivedError + if *v == nil { + sv = &types.NotifyRecommendationsReceivedError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotifyRecommendationsReceivedErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "recommendationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecommendationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(v *[]types.NotifyRecommendationsReceivedError, 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.NotifyRecommendationsReceivedError + if *v == nil { + cv = []types.NotifyRecommendationsReceivedError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotifyRecommendationsReceivedError + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentObjectFieldsList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPreconditionFailedException(v **types.PreconditionFailedException, 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.PreconditionFailedException + if *v == nil { + sv = &types.PreconditionFailedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQueryResultsList(v *[]types.ResultData, 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.ResultData + if *v == nil { + cv = []types.ResultData{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResultData + destAddr := &col + if err := awsRestjson1_deserializeDocumentResultData(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationData(v **types.RecommendationData, 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.RecommendationData + if *v == nil { + sv = &types.RecommendationData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "document": + if err := awsRestjson1_deserializeDocumentDocument(&sv.Document, value); err != nil { + return err + } + + case "recommendationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecommendationId = ptr.String(jtv) + } + + case "relevanceLevel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RelevanceLevel to be of type string, got %T instead", value) + } + sv.RelevanceLevel = types.RelevanceLevel(jtv) + } + + case "relevanceScore": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RelevanceScore = 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.RelevanceScore = f64 + + default: + return fmt.Errorf("expected RelevanceScore to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationIdList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationList(v *[]types.RecommendationData, 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.RecommendationData + if *v == nil { + cv = []types.RecommendationData{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationData + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationData(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRenderingConfiguration(v **types.RenderingConfiguration, 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.RenderingConfiguration + if *v == nil { + sv = &types.RenderingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "templateUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uri to be of type string, got %T instead", value) + } + sv.TemplateUri = 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": + 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 "resourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResultData(v **types.ResultData, 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.ResultData + if *v == nil { + sv = &types.ResultData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "document": + if err := awsRestjson1_deserializeDocumentDocument(&sv.Document, value); err != nil { + return err + } + + case "relevanceScore": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RelevanceScore = 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.RelevanceScore = f64 + + default: + return fmt.Errorf("expected RelevanceScore to be a JSON Number, got %T instead", value) + + } + } + + case "resultId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.ResultId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(v **types.ServerSideEncryptionConfiguration, 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.ServerSideEncryptionConfiguration + if *v == nil { + sv = &types.ServerSideEncryptionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + 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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSessionData(v **types.SessionData, 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.SessionData + if *v == nil { + sv = &types.SessionData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "sessionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.SessionArn = ptr.String(jtv) + } + + case "sessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSessionSummaries(v *[]types.SessionSummary, 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.SessionSummary + if *v == nil { + cv = []types.SessionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SessionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentSessionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSessionSummary(v **types.SessionSummary, 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.SessionSummary + if *v == nil { + sv = &types.SessionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assistantArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AssistantArn = ptr.String(jtv) + } + + case "assistantId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssistantId = ptr.String(jtv) + } + + case "sessionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.SessionArn = ptr.String(jtv) + } + + case "sessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSourceConfiguration(v *types.SourceConfiguration, 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.SourceConfiguration +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "appIntegrations": + var mv types.AppIntegrationsConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAppIntegrationsConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.SourceConfigurationMemberAppIntegrations{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentTags(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_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, 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.TooManyTagsException + if *v == nil { + sv = &types.TooManyTagsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + 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": + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/wisdom/doc.go b/service/wisdom/doc.go new file mode 100644 index 00000000000..2e197f0eac7 --- /dev/null +++ b/service/wisdom/doc.go @@ -0,0 +1,10 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package wisdom provides the API client, operations, and parameter types for +// Amazon Connect Wisdom Service. +// +// All Amazon Connect Wisdom functionality is accessible using the API. For +// example, you can create an assistant and a knowledge base. Some more advanced +// features are only accessible using the Wisdom API. For example, you can manually +// manage content by uploading custom files and control their lifecycle. +package wisdom diff --git a/service/wisdom/endpoints.go b/service/wisdom/endpoints.go new file mode 100644 index 00000000000..91a9bd9e95d --- /dev/null +++ b/service/wisdom/endpoints.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/wisdom/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + if err != nil { + 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 = "wisdom" + } + 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.EndpointResolver + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint +// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError +// error, the resolver will use the the provided fallbackResolver for resolution. +// awsResolver and fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/wisdom/generated.json b/service/wisdom/generated.json new file mode 100644 index 00000000000..909495a1e71 --- /dev/null +++ b/service/wisdom/generated.json @@ -0,0 +1,56 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_op_CreateAssistant.go", + "api_op_CreateAssistantAssociation.go", + "api_op_CreateContent.go", + "api_op_CreateKnowledgeBase.go", + "api_op_CreateSession.go", + "api_op_DeleteAssistant.go", + "api_op_DeleteAssistantAssociation.go", + "api_op_DeleteContent.go", + "api_op_DeleteKnowledgeBase.go", + "api_op_GetAssistant.go", + "api_op_GetAssistantAssociation.go", + "api_op_GetContent.go", + "api_op_GetContentSummary.go", + "api_op_GetKnowledgeBase.go", + "api_op_GetRecommendations.go", + "api_op_GetSession.go", + "api_op_ListAssistantAssociations.go", + "api_op_ListAssistants.go", + "api_op_ListContents.go", + "api_op_ListKnowledgeBases.go", + "api_op_ListTagsForResource.go", + "api_op_NotifyRecommendationsReceived.go", + "api_op_QueryAssistant.go", + "api_op_RemoveKnowledgeBaseTemplateUri.go", + "api_op_SearchContent.go", + "api_op_SearchSessions.go", + "api_op_StartContentUpload.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateContent.go", + "api_op_UpdateKnowledgeBaseTemplateUri.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.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/wisdom", + "unstable": false +} diff --git a/service/wisdom/go.mod b/service/wisdom/go.mod new file mode 100644 index 00000000000..7287d3bec2f --- /dev/null +++ b/service/wisdom/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/wisdom + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.9.1 + github.com/aws/smithy-go v1.8.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/wisdom/go.sum b/service/wisdom/go.sum new file mode 100644 index 00000000000..779915f8ab7 --- /dev/null +++ b/service/wisdom/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/wisdom/go_module_metadata.go b/service/wisdom/go_module_metadata.go new file mode 100644 index 00000000000..4a93fac835f --- /dev/null +++ b/service/wisdom/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package wisdom + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/wisdom/internal/endpoints/endpoints.go b/service/wisdom/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..c72ce0f3fcc --- /dev/null +++ b/service/wisdom/internal/endpoints/endpoints.go @@ -0,0 +1,106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver Wisdom 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + 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 + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "wisdom.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "wisdom.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "wisdom.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "wisdom.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "wisdom.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/wisdom/internal/endpoints/endpoints_test.go b/service/wisdom/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/wisdom/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/wisdom/protocol_test.go b/service/wisdom/protocol_test.go new file mode 100644 index 00000000000..313d5968f42 --- /dev/null +++ b/service/wisdom/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom diff --git a/service/wisdom/serializers.go b/service/wisdom/serializers.go new file mode 100644 index 00000000000..f61276ba157 --- /dev/null +++ b/service/wisdom/serializers.go @@ -0,0 +1,2568 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateAssistant struct { +} + +func (*awsRestjson1_serializeOpCreateAssistant) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateAssistantInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateAssistantInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateAssistantInput(v *CreateAssistantInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAssistantInput(v *CreateAssistantInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.ServerSideEncryptionConfiguration != nil { + ok := object.Key("serverSideEncryptionConfiguration") + if err := awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpCreateAssistantAssociation struct { +} + +func (*awsRestjson1_serializeOpCreateAssistantAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateAssistantAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateAssistantAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateAssistantAssociationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateAssistantAssociationInput(v *CreateAssistantAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAssistantAssociationInput(v *CreateAssistantAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Association != nil { + ok := object.Key("association") + if err := awsRestjson1_serializeDocumentAssistantAssociationInputData(v.Association, ok); err != nil { + return err + } + } + + if len(v.AssociationType) > 0 { + ok := object.Key("associationType") + ok.String(string(v.AssociationType)) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateContent struct { +} + +func (*awsRestjson1_serializeOpCreateContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateContentInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateContentInput(v *CreateContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateContentInput(v *CreateContentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Metadata != nil { + ok := object.Key("metadata") + if err := awsRestjson1_serializeDocumentContentMetadata(v.Metadata, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.OverrideLinkOutUri != nil { + ok := object.Key("overrideLinkOutUri") + ok.String(*v.OverrideLinkOutUri) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + if v.Title != nil { + ok := object.Key("title") + ok.String(*v.Title) + } + + if v.UploadId != nil { + ok := object.Key("uploadId") + ok.String(*v.UploadId) + } + + return nil +} + +type awsRestjson1_serializeOpCreateKnowledgeBase struct { +} + +func (*awsRestjson1_serializeOpCreateKnowledgeBase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateKnowledgeBaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if len(v.KnowledgeBaseType) > 0 { + ok := object.Key("knowledgeBaseType") + ok.String(string(v.KnowledgeBaseType)) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RenderingConfiguration != nil { + ok := object.Key("renderingConfiguration") + if err := awsRestjson1_serializeDocumentRenderingConfiguration(v.RenderingConfiguration, ok); err != nil { + return err + } + } + + if v.ServerSideEncryptionConfiguration != nil { + ok := object.Key("serverSideEncryptionConfiguration") + if err := awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v.ServerSideEncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.SourceConfiguration != nil { + ok := object.Key("sourceConfiguration") + if err := awsRestjson1_serializeDocumentSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateSession struct { +} + +func (*awsRestjson1_serializeOpCreateSession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateSessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSessionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateSessionInput(v *CreateSessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSessionInput(v *CreateSessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAssistant struct { +} + +func (*awsRestjson1_serializeOpDeleteAssistant) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAssistantInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteAssistantInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAssistantInput(v *DeleteAssistantInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAssistantAssociation struct { +} + +func (*awsRestjson1_serializeOpDeleteAssistantAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAssistantAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations/{assistantAssociationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteAssistantAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAssistantAssociationInput(v *DeleteAssistantAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantAssociationId == nil || len(*v.AssistantAssociationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantAssociationId must not be empty")} + } + if v.AssistantAssociationId != nil { + if err := encoder.SetURI("assistantAssociationId").String(*v.AssistantAssociationId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteContent struct { +} + +func (*awsRestjson1_serializeOpDeleteContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteContentInput(v *DeleteContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteKnowledgeBase struct { +} + +func (*awsRestjson1_serializeOpDeleteKnowledgeBase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteKnowledgeBaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetAssistant struct { +} + +func (*awsRestjson1_serializeOpGetAssistant) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAssistantInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetAssistantInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetAssistantInput(v *GetAssistantInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetAssistantAssociation struct { +} + +func (*awsRestjson1_serializeOpGetAssistantAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAssistantAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAssistantAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations/{assistantAssociationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetAssistantAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetAssistantAssociationInput(v *GetAssistantAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantAssociationId == nil || len(*v.AssistantAssociationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantAssociationId must not be empty")} + } + if v.AssistantAssociationId != nil { + if err := encoder.SetURI("assistantAssociationId").String(*v.AssistantAssociationId); err != nil { + return err + } + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetContent struct { +} + +func (*awsRestjson1_serializeOpGetContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetContentInput(v *GetContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetContentSummary struct { +} + +func (*awsRestjson1_serializeOpGetContentSummary) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetContentSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetContentSummaryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetContentSummaryInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetContentSummaryInput(v *GetContentSummaryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetKnowledgeBase struct { +} + +func (*awsRestjson1_serializeOpGetKnowledgeBase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetKnowledgeBaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(v *GetKnowledgeBaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetRecommendations struct { +} + +func (*awsRestjson1_serializeOpGetRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}/recommendations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetRecommendationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetRecommendationsInput(v *GetRecommendationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.SessionId == nil || len(*v.SessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} + } + if v.SessionId != nil { + if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { + return err + } + } + + if v.WaitTimeSeconds != 0 { + encoder.SetQuery("waitTimeSeconds").Integer(v.WaitTimeSeconds) + } + + return nil +} + +type awsRestjson1_serializeOpGetSession struct { +} + +func (*awsRestjson1_serializeOpGetSession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetSessionInput(v *GetSessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + if v.SessionId == nil || len(*v.SessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} + } + if v.SessionId != nil { + if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListAssistantAssociations struct { +} + +func (*awsRestjson1_serializeOpListAssistantAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAssistantAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAssistantAssociationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/associations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAssistantAssociationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListAssistantAssociationsInput(v *ListAssistantAssociationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); 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_serializeOpListAssistants struct { +} + +func (*awsRestjson1_serializeOpListAssistants) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAssistants) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAssistantsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAssistantsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListAssistantsInput(v *ListAssistantsInput, 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) + } + + return nil +} + +type awsRestjson1_serializeOpListContents struct { +} + +func (*awsRestjson1_serializeOpListContents) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListContents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListContentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListContentsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListContentsInput(v *ListContentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); 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_serializeOpListKnowledgeBases struct { +} + +func (*awsRestjson1_serializeOpListKnowledgeBases) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListKnowledgeBasesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledgeBasesInput, 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) + } + + 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, +) { + 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("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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 + + 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.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpNotifyRecommendationsReceived struct { +} + +func (*awsRestjson1_serializeOpNotifyRecommendationsReceived) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*NotifyRecommendationsReceivedInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsNotifyRecommendationsReceivedInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentNotifyRecommendationsReceivedInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + if v.SessionId == nil || len(*v.SessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")} + } + if v.SessionId != nil { + if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RecommendationIds != nil { + ok := object.Key("recommendationIds") + if err := awsRestjson1_serializeDocumentRecommendationIdList(v.RecommendationIds, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpQueryAssistant struct { +} + +func (*awsRestjson1_serializeOpQueryAssistant) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*QueryAssistantInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/query") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsQueryAssistantInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentQueryAssistantInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsQueryAssistantInput(v *QueryAssistantInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentQueryAssistantInput(v *QueryAssistantInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.QueryText != nil { + ok := object.Key("queryText") + ok.String(*v.QueryText) + } + + return nil +} + +type awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri struct { +} + +func (*awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRemoveKnowledgeBaseTemplateUri) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveKnowledgeBaseTemplateUriInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/templateUri") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsRemoveKnowledgeBaseTemplateUriInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsRemoveKnowledgeBaseTemplateUriInput(v *RemoveKnowledgeBaseTemplateUriInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSearchContent struct { +} + +func (*awsRestjson1_serializeOpSearchContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/search") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchContentInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchContentInput(v *SearchContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); 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 +} + +func awsRestjson1_serializeOpDocumentSearchContentInput(v *SearchContentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SearchExpression != nil { + ok := object.Key("searchExpression") + if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSearchSessions struct { +} + +func (*awsRestjson1_serializeOpSearchSessions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchSessionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assistants/{assistantId}/searchSessions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchSessionsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(v *SearchSessionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} + } + if v.AssistantId != nil { + if err := encoder.SetURI("assistantId").String(*v.AssistantId); 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 +} + +func awsRestjson1_serializeOpDocumentSearchSessionsInput(v *SearchSessionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SearchExpression != nil { + ok := object.Key("searchExpression") + if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStartContentUpload struct { +} + +func (*awsRestjson1_serializeOpStartContentUpload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartContentUploadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/upload") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartContentUploadInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(v *StartContentUploadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartContentUploadInput(v *StartContentUploadInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContentType != nil { + ok := object.Key("contentType") + ok.String(*v.ContentType) + } + + 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, +) { + 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("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + 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 + + 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.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); 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_serializeDocumentTags(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, +) { + 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("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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 + + 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.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateContent struct { +} + +func (*awsRestjson1_serializeOpUpdateContent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/contents/{contentId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateContentInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateContentInput(v *UpdateContentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContentId == nil || len(*v.ContentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member contentId must not be empty")} + } + if v.ContentId != nil { + if err := encoder.SetURI("contentId").String(*v.ContentId); err != nil { + return err + } + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateContentInput(v *UpdateContentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Metadata != nil { + ok := object.Key("metadata") + if err := awsRestjson1_serializeDocumentContentMetadata(v.Metadata, ok); err != nil { + return err + } + } + + if v.OverrideLinkOutUri != nil { + ok := object.Key("overrideLinkOutUri") + ok.String(*v.OverrideLinkOutUri) + } + + if v.RemoveOverrideLinkOutUri != nil { + ok := object.Key("removeOverrideLinkOutUri") + ok.Boolean(*v.RemoveOverrideLinkOutUri) + } + + if v.RevisionId != nil { + ok := object.Key("revisionId") + ok.String(*v.RevisionId) + } + + if v.Title != nil { + ok := object.Key("title") + ok.String(*v.Title) + } + + if v.UploadId != nil { + ok := object.Key("uploadId") + ok.String(*v.UploadId) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateKnowledgeBaseTemplateUri struct { +} + +func (*awsRestjson1_serializeOpUpdateKnowledgeBaseTemplateUri) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateKnowledgeBaseTemplateUri) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateKnowledgeBaseTemplateUriInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/templateUri") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateKnowledgeBaseTemplateUriInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateKnowledgeBaseTemplateUriInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateKnowledgeBaseTemplateUriInput(v *UpdateKnowledgeBaseTemplateUriInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} + } + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateKnowledgeBaseTemplateUriInput(v *UpdateKnowledgeBaseTemplateUriInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TemplateUri != nil { + ok := object.Key("templateUri") + ok.String(*v.TemplateUri) + } + + return nil +} + +func awsRestjson1_serializeDocumentAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppIntegrationArn != nil { + ok := object.Key("appIntegrationArn") + ok.String(*v.AppIntegrationArn) + } + + if v.ObjectFields != nil { + ok := object.Key("objectFields") + if err := awsRestjson1_serializeDocumentObjectFieldsList(v.ObjectFields, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAssistantAssociationInputData(v types.AssistantAssociationInputData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.AssistantAssociationInputDataMemberKnowledgeBaseId: + av := object.Key("knowledgeBaseId") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentContentMetadata(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_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Field) > 0 { + ok := object.Key("field") + ok.String(string(v.Field)) + } + + 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_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentObjectFieldsList(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_serializeDocumentRecommendationIdList(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_serializeDocumentRenderingConfiguration(v *types.RenderingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TemplateUri != nil { + ok := object.Key("templateUri") + ok.String(*v.TemplateUri) + } + + return nil +} + +func awsRestjson1_serializeDocumentSearchExpression(v *types.SearchExpression, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + return nil +} + +func awsRestjson1_serializeDocumentSourceConfiguration(v types.SourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SourceConfigurationMemberAppIntegrations: + av := object.Key("appIntegrations") + if err := awsRestjson1_serializeDocumentAppIntegrationsConfiguration(&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_serializeDocumentTags(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 +} diff --git a/service/wisdom/types/enums.go b/service/wisdom/types/enums.go new file mode 100644 index 00000000000..d7c2be7cf72 --- /dev/null +++ b/service/wisdom/types/enums.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AssistantStatus string + +// Enum values for AssistantStatus +const ( + AssistantStatusCreateInProgress AssistantStatus = "CREATE_IN_PROGRESS" + AssistantStatusCreateFailed AssistantStatus = "CREATE_FAILED" + AssistantStatusActive AssistantStatus = "ACTIVE" + AssistantStatusDeleteInProgress AssistantStatus = "DELETE_IN_PROGRESS" + AssistantStatusDeleteFailed AssistantStatus = "DELETE_FAILED" + AssistantStatusDeleted AssistantStatus = "DELETED" +) + +// Values returns all known values for AssistantStatus. 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 (AssistantStatus) Values() []AssistantStatus { + return []AssistantStatus{ + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "ACTIVE", + "DELETE_IN_PROGRESS", + "DELETE_FAILED", + "DELETED", + } +} + +type AssistantType string + +// Enum values for AssistantType +const ( + AssistantTypeAgent AssistantType = "AGENT" +) + +// Values returns all known values for AssistantType. 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 (AssistantType) Values() []AssistantType { + return []AssistantType{ + "AGENT", + } +} + +type AssociationType string + +// Enum values for AssociationType +const ( + AssociationTypeKnowledgeBase AssociationType = "KNOWLEDGE_BASE" +) + +// Values returns all known values for AssociationType. 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 (AssociationType) Values() []AssociationType { + return []AssociationType{ + "KNOWLEDGE_BASE", + } +} + +type ContentStatus string + +// Enum values for ContentStatus +const ( + ContentStatusCreateInProgress ContentStatus = "CREATE_IN_PROGRESS" + ContentStatusCreateFailed ContentStatus = "CREATE_FAILED" + ContentStatusActive ContentStatus = "ACTIVE" + ContentStatusDeleteInProgress ContentStatus = "DELETE_IN_PROGRESS" + ContentStatusDeleteFailed ContentStatus = "DELETE_FAILED" + ContentStatusDeleted ContentStatus = "DELETED" + ContentStatusUpdateFailed ContentStatus = "UPDATE_FAILED" +) + +// Values returns all known values for ContentStatus. 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 (ContentStatus) Values() []ContentStatus { + return []ContentStatus{ + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "ACTIVE", + "DELETE_IN_PROGRESS", + "DELETE_FAILED", + "DELETED", + "UPDATE_FAILED", + } +} + +type FilterField string + +// Enum values for FilterField +const ( + FilterFieldName FilterField = "NAME" +) + +// Values returns all known values for FilterField. 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 (FilterField) Values() []FilterField { + return []FilterField{ + "NAME", + } +} + +type FilterOperator string + +// Enum values for FilterOperator +const ( + FilterOperatorEquals FilterOperator = "EQUALS" +) + +// Values returns all known values for FilterOperator. 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 (FilterOperator) Values() []FilterOperator { + return []FilterOperator{ + "EQUALS", + } +} + +type KnowledgeBaseStatus string + +// Enum values for KnowledgeBaseStatus +const ( + KnowledgeBaseStatusCreateInProgress KnowledgeBaseStatus = "CREATE_IN_PROGRESS" + KnowledgeBaseStatusCreateFailed KnowledgeBaseStatus = "CREATE_FAILED" + KnowledgeBaseStatusActive KnowledgeBaseStatus = "ACTIVE" + KnowledgeBaseStatusDeleteInProgress KnowledgeBaseStatus = "DELETE_IN_PROGRESS" + KnowledgeBaseStatusDeleteFailed KnowledgeBaseStatus = "DELETE_FAILED" + KnowledgeBaseStatusDeleted KnowledgeBaseStatus = "DELETED" +) + +// Values returns all known values for KnowledgeBaseStatus. 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 (KnowledgeBaseStatus) Values() []KnowledgeBaseStatus { + return []KnowledgeBaseStatus{ + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "ACTIVE", + "DELETE_IN_PROGRESS", + "DELETE_FAILED", + "DELETED", + } +} + +type KnowledgeBaseType string + +// Enum values for KnowledgeBaseType +const ( + KnowledgeBaseTypeExternal KnowledgeBaseType = "EXTERNAL" + KnowledgeBaseTypeCustom KnowledgeBaseType = "CUSTOM" +) + +// Values returns all known values for KnowledgeBaseType. 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 (KnowledgeBaseType) Values() []KnowledgeBaseType { + return []KnowledgeBaseType{ + "EXTERNAL", + "CUSTOM", + } +} + +type RelevanceLevel string + +// Enum values for RelevanceLevel +const ( + RelevanceLevelHigh RelevanceLevel = "HIGH" + RelevanceLevelMedium RelevanceLevel = "MEDIUM" + RelevanceLevelLow RelevanceLevel = "LOW" +) + +// Values returns all known values for RelevanceLevel. 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 (RelevanceLevel) Values() []RelevanceLevel { + return []RelevanceLevel{ + "HIGH", + "MEDIUM", + "LOW", + } +} diff --git a/service/wisdom/types/errors.go b/service/wisdom/types/errors.go new file mode 100644 index 00000000000..8f28e619555 --- /dev/null +++ b/service/wisdom/types/errors.go @@ -0,0 +1,152 @@ +// 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 + + 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 { return "AccessDeniedException" } +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. For example, if you're using a Create API (such as +// CreateAssistant) that accepts name, a conflicting resource (usually with the +// same name) is being created or mutated. +type ConflictException struct { + Message *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 { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The provided revisionId does not match, indicating the content has been modified +// since it was last read. +type PreconditionFailedException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *PreconditionFailedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PreconditionFailedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PreconditionFailedException) ErrorCode() string { return "PreconditionFailedException" } +func (e *PreconditionFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified resource does not exist. +type ResourceNotFoundException struct { + Message *string + + ResourceName *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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You've exceeded your service quota. To perform the requested action, remove some +// of the relevant resources, or use service quotas to request a service quota +// increase. +type ServiceQuotaExceededException struct { + Message *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 { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Amazon Connect Wisdom throws this exception if you have too many tags in your +// tag set. +type TooManyTagsException struct { + Message *string + + ResourceName *string + + noSmithyDocumentSerde +} + +func (e *TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyTagsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyTagsException) ErrorCode() string { return "TooManyTagsException" } +func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/wisdom/types/types.go b/service/wisdom/types/types.go new file mode 100644 index 00000000000..b0a40925cea --- /dev/null +++ b/service/wisdom/types/types.go @@ -0,0 +1,741 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Configuration information for Amazon AppIntegrations to automatically ingest +// content. +type AppIntegrationsConfiguration struct { + + // The Amazon Resource Name (ARN) of the AppIntegrations DataIntegration to use for + // ingesting content. + // + // This member is required. + AppIntegrationArn *string + + // The fields from the source that are made available to your agents in Wisdom. + // + // * + // For Salesforce + // (https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/sforce_api_objects_knowledge__kav.htm), + // you must include at least Id, ArticleNumber, VersionNumber, Title, + // PublishStatus, and IsDeleted. + // + // * For ServiceNow + // (https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/knowledge-management-api), + // you must include at least number, short_description, sys_mod_count, + // workflow_state, and active. + // + // Make sure to include additional field(s); these are + // indexed and used to source recommendations. + // + // This member is required. + ObjectFields []string + + noSmithyDocumentSerde +} + +// Information about the assistant association. +type AssistantAssociationData struct { + + // The Amazon Resource Name (ARN) of the Wisdom assistant + // + // This member is required. + AssistantArn *string + + // The Amazon Resource Name (ARN) of the assistant association. + // + // This member is required. + AssistantAssociationArn *string + + // The identifier of the assistant association. + // + // This member is required. + AssistantAssociationId *string + + // The identifier of the Wisdom assistant. + // + // This member is required. + AssistantId *string + + // A union type that currently has a single argument, the knowledge base ID. + // + // This member is required. + AssociationData AssistantAssociationOutputData + + // The type of association. + // + // This member is required. + AssociationType AssociationType + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The data that is input into Wisdom as a result of the assistant association. +// +// The following types satisfy this interface: +// AssistantAssociationInputDataMemberKnowledgeBaseId +type AssistantAssociationInputData interface { + isAssistantAssociationInputData() +} + +// The the identifier of the knowledge base. +type AssistantAssociationInputDataMemberKnowledgeBaseId struct { + Value string + + noSmithyDocumentSerde +} + +func (*AssistantAssociationInputDataMemberKnowledgeBaseId) isAssistantAssociationInputData() {} + +// The data that is output as a result of the assistant association. +// +// The following types satisfy this interface: +// AssistantAssociationOutputDataMemberKnowledgeBaseAssociation +type AssistantAssociationOutputData interface { + isAssistantAssociationOutputData() +} + +// The knowledge base where output data is sent. +type AssistantAssociationOutputDataMemberKnowledgeBaseAssociation struct { + Value KnowledgeBaseAssociationData + + noSmithyDocumentSerde +} + +func (*AssistantAssociationOutputDataMemberKnowledgeBaseAssociation) isAssistantAssociationOutputData() { +} + +// Summary information about the assistant association. +type AssistantAssociationSummary struct { + + // The Amazon Resource Name (ARN) of the Wisdom assistant + // + // This member is required. + AssistantArn *string + + // The Amazon Resource Name (ARN) of the assistant association. + // + // This member is required. + AssistantAssociationArn *string + + // The identifier of the assistant association. + // + // This member is required. + AssistantAssociationId *string + + // The identifier of the Wisdom assistant. + // + // This member is required. + AssistantId *string + + // The association data. + // + // This member is required. + AssociationData AssistantAssociationOutputData + + // The type of association. + // + // This member is required. + AssociationType AssociationType + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The assistant data. +type AssistantData struct { + + // The Amazon Resource Name (ARN) of the Wisdom assistant + // + // This member is required. + AssistantArn *string + + // The identifier of the Wisdom assistant. + // + // This member is required. + AssistantId *string + + // The name. + // + // This member is required. + Name *string + + // The status of the assistant. + // + // This member is required. + Status AssistantStatus + + // The type of assistant. + // + // This member is required. + Type AssistantType + + // The description. + Description *string + + // The KMS key used for encryption. + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Summary information about the assistant. +type AssistantSummary struct { + + // The Amazon Resource Name (ARN) of the Wisdom assistant + // + // This member is required. + AssistantArn *string + + // The identifier of the Wisdom assistant. + // + // This member is required. + AssistantId *string + + // The name of the assistant. + // + // This member is required. + Name *string + + // The status of the assistant. + // + // This member is required. + Status AssistantStatus + + // The type of the assistant. + // + // This member is required. + Type AssistantType + + // The description of the assistant. + Description *string + + // The KMS key used for encryption. + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Information about the content. +type ContentData struct { + + // The Amazon Resource Name (ARN) of the content. + // + // This member is required. + ContentArn *string + + // The identifier of the content. + // + // This member is required. + ContentId *string + + // The media type of the content. + // + // This member is required. + ContentType *string + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The the identifier of the knowledge base. + // + // This member is required. + KnowledgeBaseId *string + + // A key/value map to store attributes without affecting tagging or + // recommendations. For example, when synchronizing data between an external system + // and Wisdom, you can store an external version identifier as metadata to utilize + // for determining drift. + // + // This member is required. + Metadata map[string]string + + // The name of the content. + // + // This member is required. + Name *string + + // The identifier of the content revision. + // + // This member is required. + RevisionId *string + + // The status of the content. + // + // This member is required. + Status ContentStatus + + // The title of the content. + // + // This member is required. + Title *string + + // The URL of the content. + // + // This member is required. + Url *string + + // The expiration time of the URL as an epoch timestamp. + // + // This member is required. + UrlExpiry *time.Time + + // The URI of the content. + LinkOutUri *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Reference information about the content. +type ContentReference struct { + + // The Amazon Resource Name (ARN) of the content. + ContentArn *string + + // The identifier of the content. + ContentId *string + + // The Amazon Resource Name (ARN) of the knowledge base. + KnowledgeBaseArn *string + + // The the identifier of the knowledge base. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +// Summary information about the content. +type ContentSummary struct { + + // The Amazon Resource Name (ARN) of the content. + // + // This member is required. + ContentArn *string + + // The identifier of the content. + // + // This member is required. + ContentId *string + + // The media type of the content. + // + // This member is required. + ContentType *string + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The the identifier of the knowledge base. + // + // This member is required. + KnowledgeBaseId *string + + // A key/value map to store attributes without affecting tagging or + // recommendations. For example, when synchronizing data between an external system + // and Wisdom, you can store an external version identifier as metadata to utilize + // for determining drift. + // + // This member is required. + Metadata map[string]string + + // The name of the content. + // + // This member is required. + Name *string + + // The identifier of the revision of the content. + // + // This member is required. + RevisionId *string + + // The status of the content. + // + // This member is required. + Status ContentStatus + + // The title of the content. + // + // This member is required. + Title *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The document. +type Document struct { + + // A reference to the content resource. + // + // This member is required. + ContentReference *ContentReference + + // The excerpt from the document. + Excerpt *DocumentText + + // The title of the document. + Title *DocumentText + + noSmithyDocumentSerde +} + +// The text of the document. +type DocumentText struct { + + // Highlights in the document text. + Highlights []Highlight + + // Text in the document. + Text *string + + noSmithyDocumentSerde +} + +// A search filter. +type Filter struct { + + // The field on which to filter. + // + // This member is required. + Field FilterField + + // The operator to use for comparing the field’s value with the provided value. + // + // This member is required. + Operator FilterOperator + + // The desired field value on which to filter. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Offset specification to describe highlighting of document excerpts for rendering +// search results and recommendations. +type Highlight struct { + + // The offset for the start of the highlight. + BeginOffsetInclusive int32 + + // The offset for the end of the highlight. + EndOffsetExclusive int32 + + noSmithyDocumentSerde +} + +// Association information about the knowledge base. +type KnowledgeBaseAssociationData struct { + + // The Amazon Resource Name (ARN) of the knowledge base. + KnowledgeBaseArn *string + + // The the identifier of the knowledge base. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +// Information about the knowledge base. +type KnowledgeBaseData struct { + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The the identifier of the knowledge base. + // + // This member is required. + KnowledgeBaseId *string + + // The type of knowledge base. + // + // This member is required. + KnowledgeBaseType KnowledgeBaseType + + // The name of the knowledge base. + // + // This member is required. + Name *string + + // The status of the knowledge base. + // + // This member is required. + Status KnowledgeBaseStatus + + // The description. + Description *string + + // An epoch timestamp indicating the most recent content modification inside the + // knowledge base. If no content exists in a knowledge base, this value is unset. + LastContentModificationTime *time.Time + + // Information about how to render the content. + RenderingConfiguration *RenderingConfiguration + + // The KMS key used for encryption. + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration + + // Source configuration information about the knowledge base. + SourceConfiguration SourceConfiguration + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Summary information about the knowledge base. +type KnowledgeBaseSummary struct { + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The the identifier of the knowledge base. + // + // This member is required. + KnowledgeBaseId *string + + // The type of knowledge base. + // + // This member is required. + KnowledgeBaseType KnowledgeBaseType + + // The name of the knowledge base. + // + // This member is required. + Name *string + + // The status of the knowledge base summary. + // + // This member is required. + Status KnowledgeBaseStatus + + // The description of the knowledge base. + Description *string + + // Information about how to render the content. + RenderingConfiguration *RenderingConfiguration + + // The KMS key used for encryption. + ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration + + // [KEVIN] + SourceConfiguration SourceConfiguration + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// An error occurred when creating a recommendation. +type NotifyRecommendationsReceivedError struct { + + // A recommendation is causing an error. + Message *string + + // The identifier of the recommendation that is in error. + RecommendationId *string + + noSmithyDocumentSerde +} + +// Information about the recommendation. +type RecommendationData struct { + + // The recommended document. + // + // This member is required. + Document *Document + + // The identifier of the recommendation. + // + // This member is required. + RecommendationId *string + + // The relevance level of the recommendation. + RelevanceLevel RelevanceLevel + + // The relevance score of the recommendation. + RelevanceScore float64 + + noSmithyDocumentSerde +} + +// Information about how to render the content. +type RenderingConfiguration struct { + + // A URI template containing exactly one variable in ${variableName} format. This + // can only be set for EXTERNAL knowledge bases. For Salesforce and ServiceNow, the + // variable must be one of the following: + // + // * Salesforce: Id, ArticleNumber, + // VersionNumber, Title, PublishStatus, or IsDeleted + // + // * ServiceNow: number, + // short_description, sys_mod_count, workflow_state, or active + // + // The variable is + // replaced with the actual value for a piece of content when calling GetContent + // (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_GetContent.html). + TemplateUri *string + + noSmithyDocumentSerde +} + +// Information about the result. +type ResultData struct { + + // The document. + // + // This member is required. + Document *Document + + // The identifier of the result data. + // + // This member is required. + ResultId *string + + // The relevance score of the results. + RelevanceScore float64 + + noSmithyDocumentSerde +} + +// The search expression. +type SearchExpression struct { + + // The search expression filters. + // + // This member is required. + Filters []Filter + + noSmithyDocumentSerde +} + +// The KMS key used for encryption. +type ServerSideEncryptionConfiguration struct { + + // The KMS key. For information about valid ID values, see Key identifiers (KeyId) + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id) in + // the AWS Key Management Service Developer Guide. + KmsKeyId *string + + noSmithyDocumentSerde +} + +// Information about the session. +type SessionData struct { + + // The name of the session. + // + // This member is required. + Name *string + + // The Amazon Resource Name (ARN) of the session. + // + // This member is required. + SessionArn *string + + // The identifier of the session. + // + // This member is required. + SessionId *string + + // The description of the session. + Description *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Summary information about the session. +type SessionSummary struct { + + // The Amazon Resource Name (ARN) of the Wisdom assistant + // + // This member is required. + AssistantArn *string + + // The identifier of the Wisdom assistant. + // + // This member is required. + AssistantId *string + + // The Amazon Resource Name (ARN) of the session. + // + // This member is required. + SessionArn *string + + // The identifier of the session. + // + // This member is required. + SessionId *string + + noSmithyDocumentSerde +} + +// Configuration information about the external data source. +// +// The following types satisfy this interface: +// SourceConfigurationMemberAppIntegrations +type SourceConfiguration interface { + isSourceConfiguration() +} + +// Configuration information for Amazon AppIntegrations to automatically ingest +// content. +type SourceConfigurationMemberAppIntegrations struct { + Value AppIntegrationsConfiguration + + noSmithyDocumentSerde +} + +func (*SourceConfigurationMemberAppIntegrations) isSourceConfiguration() {} + +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) isAssistantAssociationInputData() {} +func (*UnknownUnionMember) isAssistantAssociationOutputData() {} +func (*UnknownUnionMember) isSourceConfiguration() {} diff --git a/service/wisdom/types/types_exported_test.go b/service/wisdom/types/types_exported_test.go new file mode 100644 index 00000000000..aba998a6f87 --- /dev/null +++ b/service/wisdom/types/types_exported_test.go @@ -0,0 +1,62 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" +) + +func ExampleAssistantAssociationInputData_outputUsage() { + var union types.AssistantAssociationInputData + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AssistantAssociationInputDataMemberKnowledgeBaseId: + _ = 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 ExampleAssistantAssociationOutputData_outputUsage() { + var union types.AssistantAssociationOutputData + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AssistantAssociationOutputDataMemberKnowledgeBaseAssociation: + _ = v.Value // Value is types.KnowledgeBaseAssociationData + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.KnowledgeBaseAssociationData + +func ExampleSourceConfiguration_outputUsage() { + var union types.SourceConfiguration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SourceConfigurationMemberAppIntegrations: + _ = v.Value // Value is types.AppIntegrationsConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.AppIntegrationsConfiguration diff --git a/service/wisdom/validators.go b/service/wisdom/validators.go new file mode 100644 index 00000000000..d8722da2d1c --- /dev/null +++ b/service/wisdom/validators.go @@ -0,0 +1,1321 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/wisdom/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateAssistantAssociation struct { +} + +func (*validateOpCreateAssistantAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAssistantAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAssistantAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAssistantAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAssistant struct { +} + +func (*validateOpCreateAssistant) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAssistant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAssistantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAssistantInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateContent struct { +} + +func (*validateOpCreateContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateKnowledgeBase struct { +} + +func (*validateOpCreateKnowledgeBase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateKnowledgeBase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateKnowledgeBaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateKnowledgeBaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSession struct { +} + +func (*validateOpCreateSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAssistantAssociation struct { +} + +func (*validateOpDeleteAssistantAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAssistantAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAssistantAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAssistantAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAssistant struct { +} + +func (*validateOpDeleteAssistant) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAssistant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAssistantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAssistantInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteContent struct { +} + +func (*validateOpDeleteContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteKnowledgeBase struct { +} + +func (*validateOpDeleteKnowledgeBase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteKnowledgeBase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteKnowledgeBaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteKnowledgeBaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAssistantAssociation struct { +} + +func (*validateOpGetAssistantAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAssistantAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAssistantAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAssistantAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAssistant struct { +} + +func (*validateOpGetAssistant) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAssistant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAssistantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAssistantInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetContent struct { +} + +func (*validateOpGetContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetContentSummary struct { +} + +func (*validateOpGetContentSummary) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetContentSummary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetContentSummaryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetContentSummaryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetKnowledgeBase struct { +} + +func (*validateOpGetKnowledgeBase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetKnowledgeBase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetKnowledgeBaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetKnowledgeBaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRecommendations struct { +} + +func (*validateOpGetRecommendations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRecommendationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRecommendationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSession struct { +} + +func (*validateOpGetSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAssistantAssociations struct { +} + +func (*validateOpListAssistantAssociations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAssistantAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAssistantAssociationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAssistantAssociationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListContents struct { +} + +func (*validateOpListContents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListContents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListContentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListContentsInput(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 validateOpNotifyRecommendationsReceived struct { +} + +func (*validateOpNotifyRecommendationsReceived) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpNotifyRecommendationsReceived) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*NotifyRecommendationsReceivedInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpNotifyRecommendationsReceivedInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpQueryAssistant struct { +} + +func (*validateOpQueryAssistant) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpQueryAssistant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*QueryAssistantInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpQueryAssistantInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRemoveKnowledgeBaseTemplateUri struct { +} + +func (*validateOpRemoveKnowledgeBaseTemplateUri) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveKnowledgeBaseTemplateUri) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveKnowledgeBaseTemplateUriInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveKnowledgeBaseTemplateUriInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchContent struct { +} + +func (*validateOpSearchContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchSessions struct { +} + +func (*validateOpSearchSessions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchSessions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchSessionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchSessionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartContentUpload struct { +} + +func (*validateOpStartContentUpload) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartContentUpload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartContentUploadInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartContentUploadInput(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 validateOpUpdateContent struct { +} + +func (*validateOpUpdateContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateKnowledgeBaseTemplateUri struct { +} + +func (*validateOpUpdateKnowledgeBaseTemplateUri) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateKnowledgeBaseTemplateUri) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateKnowledgeBaseTemplateUriInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateKnowledgeBaseTemplateUriInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAssistantAssociation{}, middleware.After) +} + +func addOpCreateAssistantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAssistant{}, middleware.After) +} + +func addOpCreateContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateContent{}, middleware.After) +} + +func addOpCreateKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateKnowledgeBase{}, middleware.After) +} + +func addOpCreateSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSession{}, middleware.After) +} + +func addOpDeleteAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAssistantAssociation{}, middleware.After) +} + +func addOpDeleteAssistantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAssistant{}, middleware.After) +} + +func addOpDeleteContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteContent{}, middleware.After) +} + +func addOpDeleteKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteKnowledgeBase{}, middleware.After) +} + +func addOpGetAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAssistantAssociation{}, middleware.After) +} + +func addOpGetAssistantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAssistant{}, middleware.After) +} + +func addOpGetContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetContent{}, middleware.After) +} + +func addOpGetContentSummaryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetContentSummary{}, middleware.After) +} + +func addOpGetKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetKnowledgeBase{}, middleware.After) +} + +func addOpGetRecommendationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRecommendations{}, middleware.After) +} + +func addOpGetSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSession{}, middleware.After) +} + +func addOpListAssistantAssociationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAssistantAssociations{}, middleware.After) +} + +func addOpListContentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListContents{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpNotifyRecommendationsReceivedValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpNotifyRecommendationsReceived{}, middleware.After) +} + +func addOpQueryAssistantValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpQueryAssistant{}, middleware.After) +} + +func addOpRemoveKnowledgeBaseTemplateUriValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveKnowledgeBaseTemplateUri{}, middleware.After) +} + +func addOpSearchContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchContent{}, middleware.After) +} + +func addOpSearchSessionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchSessions{}, middleware.After) +} + +func addOpStartContentUploadValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartContentUpload{}, 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 addOpUpdateContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateContent{}, middleware.After) +} + +func addOpUpdateKnowledgeBaseTemplateUriValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateKnowledgeBaseTemplateUri{}, middleware.After) +} + +func validateAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AppIntegrationsConfiguration"} + if v.AppIntegrationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppIntegrationArn")) + } + if v.ObjectFields == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectFields")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilter(v *types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Filter"} + if len(v.Field) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Field")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilterList(v []types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FilterList"} + for i := range v { + if err := validateFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSearchExpression(v *types.SearchExpression) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchExpression"} + if v.Filters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Filters")) + } else if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSourceConfiguration(v types.SourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceConfiguration"} + switch uv := v.(type) { + case *types.SourceConfigurationMemberAppIntegrations: + if err := validateAppIntegrationsConfiguration(&uv.Value); err != nil { + invalidParams.AddNested("[appIntegrations]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAssistantAssociationInput(v *CreateAssistantAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAssistantAssociationInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if len(v.AssociationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AssociationType")) + } + if v.Association == nil { + invalidParams.Add(smithy.NewErrParamRequired("Association")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAssistantInput(v *CreateAssistantInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAssistantInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateContentInput(v *CreateContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateContentInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.UploadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UploadId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateKnowledgeBaseInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.KnowledgeBaseType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseType")) + } + if v.SourceConfiguration != nil { + if err := validateSourceConfiguration(v.SourceConfiguration); err != nil { + invalidParams.AddNested("SourceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSessionInput(v *CreateSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSessionInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAssistantAssociationInput(v *DeleteAssistantAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAssistantAssociationInput"} + if v.AssistantAssociationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantAssociationId")) + } + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAssistantInput(v *DeleteAssistantInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAssistantInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteContentInput(v *DeleteContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteContentInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.ContentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteKnowledgeBaseInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAssistantAssociationInput(v *GetAssistantAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAssistantAssociationInput"} + if v.AssistantAssociationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantAssociationId")) + } + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAssistantInput(v *GetAssistantInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAssistantInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetContentInput(v *GetContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetContentInput"} + if v.ContentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContentId")) + } + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetContentSummaryInput(v *GetContentSummaryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetContentSummaryInput"} + if v.ContentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContentId")) + } + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetKnowledgeBaseInput(v *GetKnowledgeBaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetKnowledgeBaseInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRecommendationsInput(v *GetRecommendationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRecommendationsInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.SessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSessionInput(v *GetSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSessionInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.SessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAssistantAssociationsInput(v *ListAssistantAssociationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAssistantAssociationsInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListContentsInput(v *ListContentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListContentsInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + 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.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NotifyRecommendationsReceivedInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.SessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionId")) + } + if v.RecommendationIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecommendationIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpQueryAssistantInput(v *QueryAssistantInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueryAssistantInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.QueryText == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryText")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveKnowledgeBaseTemplateUriInput(v *RemoveKnowledgeBaseTemplateUriInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveKnowledgeBaseTemplateUriInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchContentInput(v *SearchContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchContentInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.SearchExpression == nil { + invalidParams.Add(smithy.NewErrParamRequired("SearchExpression")) + } else if v.SearchExpression != nil { + if err := validateSearchExpression(v.SearchExpression); err != nil { + invalidParams.AddNested("SearchExpression", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchSessionsInput(v *SearchSessionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchSessionsInput"} + if v.AssistantId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssistantId")) + } + if v.SearchExpression == nil { + invalidParams.Add(smithy.NewErrParamRequired("SearchExpression")) + } else if v.SearchExpression != nil { + if err := validateSearchExpression(v.SearchExpression); err != nil { + invalidParams.AddNested("SearchExpression", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartContentUploadInput(v *StartContentUploadInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartContentUploadInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.ContentType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContentType")) + } + 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.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + 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.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateContentInput(v *UpdateContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateContentInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.ContentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateKnowledgeBaseTemplateUriInput(v *UpdateKnowledgeBaseTemplateUriInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateKnowledgeBaseTemplateUriInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.TemplateUri == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateUri")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/workmail/api_op_DeleteMobileDeviceAccessOverride.go b/service/workmail/api_op_DeleteMobileDeviceAccessOverride.go new file mode 100644 index 00000000000..b882829319a --- /dev/null +++ b/service/workmail/api_op_DeleteMobileDeviceAccessOverride.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the mobile device access override for the given WorkMail organization, +// user, and device. +func (c *Client) DeleteMobileDeviceAccessOverride(ctx context.Context, params *DeleteMobileDeviceAccessOverrideInput, optFns ...func(*Options)) (*DeleteMobileDeviceAccessOverrideOutput, error) { + if params == nil { + params = &DeleteMobileDeviceAccessOverrideInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteMobileDeviceAccessOverride", params, optFns, c.addOperationDeleteMobileDeviceAccessOverrideMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteMobileDeviceAccessOverrideOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteMobileDeviceAccessOverrideInput struct { + + // The mobile device for which you delete the override. DeviceId is case + // insensitive. + // + // This member is required. + DeviceId *string + + // The Amazon WorkMail organization for which the access override will be deleted. + // + // This member is required. + OrganizationId *string + + // The WorkMail user for which you want to delete the override. Accepts the + // following types of user identities: + // + // * User ID: + // 12345678-1234-1234-1234-123456789012 or + // S-1-1-12-1234567890-123456789-123456789-1234 + // + // * Email address: + // user@domain.tld + // + // * User name: user + // + // This member is required. + UserId *string + + noSmithyDocumentSerde +} + +type DeleteMobileDeviceAccessOverrideOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteMobileDeviceAccessOverrideMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMobileDeviceAccessOverride{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteMobileDeviceAccessOverrideValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMobileDeviceAccessOverride(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteMobileDeviceAccessOverride(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "DeleteMobileDeviceAccessOverride", + } +} diff --git a/service/workmail/api_op_GetMobileDeviceAccessOverride.go b/service/workmail/api_op_GetMobileDeviceAccessOverride.go new file mode 100644 index 00000000000..7c7b01385e3 --- /dev/null +++ b/service/workmail/api_op_GetMobileDeviceAccessOverride.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets the mobile device access override for the given WorkMail organization, +// user, and device. +func (c *Client) GetMobileDeviceAccessOverride(ctx context.Context, params *GetMobileDeviceAccessOverrideInput, optFns ...func(*Options)) (*GetMobileDeviceAccessOverrideOutput, error) { + if params == nil { + params = &GetMobileDeviceAccessOverrideInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetMobileDeviceAccessOverride", params, optFns, c.addOperationGetMobileDeviceAccessOverrideMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetMobileDeviceAccessOverrideOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetMobileDeviceAccessOverrideInput struct { + + // The mobile device to which the override applies. DeviceId is case insensitive. + // + // This member is required. + DeviceId *string + + // The Amazon WorkMail organization to which you want to apply the override. + // + // This member is required. + OrganizationId *string + + // Identifies the WorkMail user for the override. Accepts the following types of + // user identities: + // + // * User ID: 12345678-1234-1234-1234-123456789012 or + // S-1-1-12-1234567890-123456789-123456789-1234 + // + // * Email address: + // user@domain.tld + // + // * User name: user + // + // This member is required. + UserId *string + + noSmithyDocumentSerde +} + +type GetMobileDeviceAccessOverrideOutput struct { + + // The date the override was first created. + DateCreated *time.Time + + // The date the description was last modified. + DateModified *time.Time + + // A description of the override. + Description *string + + // The device to which the access override applies. + DeviceId *string + + // The effect of the override, ALLOW or DENY. + Effect types.MobileDeviceAccessRuleEffect + + // The WorkMail user to which the access override applies. + UserId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetMobileDeviceAccessOverrideMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMobileDeviceAccessOverride{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetMobileDeviceAccessOverrideValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMobileDeviceAccessOverride(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetMobileDeviceAccessOverride(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "GetMobileDeviceAccessOverride", + } +} diff --git a/service/workmail/api_op_ListMobileDeviceAccessOverrides.go b/service/workmail/api_op_ListMobileDeviceAccessOverrides.go new file mode 100644 index 00000000000..f7272119a55 --- /dev/null +++ b/service/workmail/api_op_ListMobileDeviceAccessOverrides.go @@ -0,0 +1,241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the mobile device access overrides for any given combination of +// WorkMail organization, user, or device. +func (c *Client) ListMobileDeviceAccessOverrides(ctx context.Context, params *ListMobileDeviceAccessOverridesInput, optFns ...func(*Options)) (*ListMobileDeviceAccessOverridesOutput, error) { + if params == nil { + params = &ListMobileDeviceAccessOverridesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListMobileDeviceAccessOverrides", params, optFns, c.addOperationListMobileDeviceAccessOverridesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListMobileDeviceAccessOverridesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListMobileDeviceAccessOverridesInput struct { + + // The Amazon WorkMail organization under which to list mobile device access + // overrides. + // + // This member is required. + OrganizationId *string + + // The mobile device to which the access override applies. + DeviceId *string + + // The maximum number of results to return in a single call. + MaxResults *int32 + + // The token to use to retrieve the next page of results. The first call does not + // require a token. + NextToken *string + + // The WorkMail user under which you list the mobile device access overrides. + // Accepts the following types of user identities: + // + // * User ID: + // 12345678-1234-1234-1234-123456789012 or + // S-1-1-12-1234567890-123456789-123456789-1234 + // + // * Email address: + // user@domain.tld + // + // * User name: user + UserId *string + + noSmithyDocumentSerde +} + +type ListMobileDeviceAccessOverridesOutput struct { + + // The token to use to retrieve the next page of results. The value is “null” when + // there are no more results to return. + NextToken *string + + // The list of mobile device access overrides that exist for the specified Amazon + // WorkMail organization and user. + Overrides []types.MobileDeviceAccessOverride + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListMobileDeviceAccessOverridesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMobileDeviceAccessOverrides{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListMobileDeviceAccessOverridesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMobileDeviceAccessOverrides(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListMobileDeviceAccessOverridesAPIClient is a client that implements the +// ListMobileDeviceAccessOverrides operation. +type ListMobileDeviceAccessOverridesAPIClient interface { + ListMobileDeviceAccessOverrides(context.Context, *ListMobileDeviceAccessOverridesInput, ...func(*Options)) (*ListMobileDeviceAccessOverridesOutput, error) +} + +var _ ListMobileDeviceAccessOverridesAPIClient = (*Client)(nil) + +// ListMobileDeviceAccessOverridesPaginatorOptions is the paginator options for +// ListMobileDeviceAccessOverrides +type ListMobileDeviceAccessOverridesPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListMobileDeviceAccessOverridesPaginator is a paginator for +// ListMobileDeviceAccessOverrides +type ListMobileDeviceAccessOverridesPaginator struct { + options ListMobileDeviceAccessOverridesPaginatorOptions + client ListMobileDeviceAccessOverridesAPIClient + params *ListMobileDeviceAccessOverridesInput + nextToken *string + firstPage bool +} + +// NewListMobileDeviceAccessOverridesPaginator returns a new +// ListMobileDeviceAccessOverridesPaginator +func NewListMobileDeviceAccessOverridesPaginator(client ListMobileDeviceAccessOverridesAPIClient, params *ListMobileDeviceAccessOverridesInput, optFns ...func(*ListMobileDeviceAccessOverridesPaginatorOptions)) *ListMobileDeviceAccessOverridesPaginator { + if params == nil { + params = &ListMobileDeviceAccessOverridesInput{} + } + + options := ListMobileDeviceAccessOverridesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListMobileDeviceAccessOverridesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMobileDeviceAccessOverridesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMobileDeviceAccessOverrides page. +func (p *ListMobileDeviceAccessOverridesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMobileDeviceAccessOverridesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListMobileDeviceAccessOverrides(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListMobileDeviceAccessOverrides(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "ListMobileDeviceAccessOverrides", + } +} diff --git a/service/workmail/api_op_PutMobileDeviceAccessOverride.go b/service/workmail/api_op_PutMobileDeviceAccessOverride.go new file mode 100644 index 00000000000..f5440b6882e --- /dev/null +++ b/service/workmail/api_op_PutMobileDeviceAccessOverride.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a mobile device access override for the given WorkMail +// organization, user, and device. +func (c *Client) PutMobileDeviceAccessOverride(ctx context.Context, params *PutMobileDeviceAccessOverrideInput, optFns ...func(*Options)) (*PutMobileDeviceAccessOverrideOutput, error) { + if params == nil { + params = &PutMobileDeviceAccessOverrideInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutMobileDeviceAccessOverride", params, optFns, c.addOperationPutMobileDeviceAccessOverrideMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutMobileDeviceAccessOverrideOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutMobileDeviceAccessOverrideInput struct { + + // The mobile device for which you create the override. DeviceId is case + // insensitive. + // + // This member is required. + DeviceId *string + + // The effect of the override, ALLOW or DENY. + // + // This member is required. + Effect types.MobileDeviceAccessRuleEffect + + // Identifies the Amazon WorkMail organization for which you create the override. + // + // This member is required. + OrganizationId *string + + // The WorkMail user for which you create the override. Accepts the following types + // of user identities: + // + // * User ID: 12345678-1234-1234-1234-123456789012 or + // S-1-1-12-1234567890-123456789-123456789-1234 + // + // * Email address: + // user@domain.tld + // + // * User name: user + // + // This member is required. + UserId *string + + // A description of the override. + Description *string + + noSmithyDocumentSerde +} + +type PutMobileDeviceAccessOverrideOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutMobileDeviceAccessOverrideMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutMobileDeviceAccessOverride{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutMobileDeviceAccessOverrideValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutMobileDeviceAccessOverride(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutMobileDeviceAccessOverride(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "PutMobileDeviceAccessOverride", + } +} diff --git a/service/workmail/deserializers.go b/service/workmail/deserializers.go index cdb81c52e7a..56cf6eea32e 100644 --- a/service/workmail/deserializers.go +++ b/service/workmail/deserializers.go @@ -1658,6 +1658,126 @@ func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhtt } } +type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride struct { +} + +func (*awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response, &metadata) + } + output := &DeleteMobileDeviceAccessOverrideOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessOverrideOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule struct { } @@ -3704,6 +3824,129 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithy } } +type awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride struct { +} + +func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response, &metadata) + } + output := &GetMobileDeviceAccessOverrideOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessOverrideOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListAccessControlRules struct { } @@ -3944,11 +4187,134 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m type awsAwsjson11_deserializeOpListGroupMembers struct { } -func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { +func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) + } + output := &ListGroupMembersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListGroupMembers(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListGroups struct { +} + +func (*awsAwsjson11_deserializeOpListGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroups) 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) @@ -3962,9 +4328,9 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) } - output := &ListGroupMembersOutput{} + output := &ListGroupsOutput{} out.Result = output var buff [1024]byte @@ -3984,7 +4350,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3998,7 +4364,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroups(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)} @@ -4042,9 +4408,6 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4064,14 +4427,14 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpListGroups struct { +type awsAwsjson11_deserializeOpListMailboxExportJobs struct { } -func (*awsAwsjson11_deserializeOpListGroups) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxExportJobs) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) 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) @@ -4085,9 +4448,9 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response, &metadata) } - output := &ListGroupsOutput{} + output := &ListMailboxExportJobsOutput{} out.Result = output var buff [1024]byte @@ -4107,7 +4470,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4121,7 +4484,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(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)} @@ -4162,9 +4525,6 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4184,14 +4544,14 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpListMailboxExportJobs struct { +type awsAwsjson11_deserializeOpListMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpListMailboxExportJobs) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxPermissions) 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) @@ -4205,9 +4565,9 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) } - output := &ListMailboxExportJobsOutput{} + output := &ListMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -4227,7 +4587,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4241,7 +4601,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxPermissions(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)} @@ -4282,6 +4642,9 @@ func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.R } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4301,14 +4664,14 @@ func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpListMailboxPermissions struct { +type awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides struct { } -func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) 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) @@ -4322,9 +4685,9 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response, &metadata) } - output := &ListMailboxPermissionsOutput{} + output := &ListMobileDeviceAccessOverridesOutput{} out.Result = output var buff [1024]byte @@ -4344,7 +4707,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessOverridesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4358,7 +4721,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(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)} @@ -5363,6 +5726,129 @@ func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.R } } +type awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride struct { +} + +func (*awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response, &metadata) + } + output := &PutMobileDeviceAccessOverrideOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutMobileDeviceAccessOverrideOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpPutRetentionPolicy struct { } @@ -8927,7 +9413,90 @@ func awsAwsjson11_deserializeDocumentMembers(v *[]types.Member, value interface{ return nil } -func awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRule(v **types.MobileDeviceAccessMatchedRule, value interface{}) error { +func awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRule(v **types.MobileDeviceAccessMatchedRule, 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.MobileDeviceAccessMatchedRule + if *v == nil { + sv = &types.MobileDeviceAccessMatchedRule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MobileDeviceAccessRuleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MobileDeviceAccessRuleId to be of type string, got %T instead", value) + } + sv.MobileDeviceAccessRuleId = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MobileDeviceAccessRuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRuleList(v *[]types.MobileDeviceAccessMatchedRule, 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.MobileDeviceAccessMatchedRule + if *v == nil { + cv = []types.MobileDeviceAccessMatchedRule{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MobileDeviceAccessMatchedRule + destAddr := &col + if err := awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRule(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentMobileDeviceAccessOverride(v **types.MobileDeviceAccessOverride, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8940,31 +9509,81 @@ func awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRule(v **types.Mob return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MobileDeviceAccessMatchedRule + var sv *types.MobileDeviceAccessOverride if *v == nil { - sv = &types.MobileDeviceAccessMatchedRule{} + sv = &types.MobileDeviceAccessOverride{} } else { sv = *v } for key, value := range shape { switch key { - case "MobileDeviceAccessRuleId": + case "DateCreated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateCreated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DateModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MobileDeviceAccessRuleId to be of type string, got %T instead", value) + return fmt.Errorf("expected MobileDeviceAccessRuleDescription to be of type string, got %T instead", value) } - sv.MobileDeviceAccessRuleId = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "Name": + case "DeviceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MobileDeviceAccessRuleName to be of type string, got %T instead", value) + return fmt.Errorf("expected DeviceId to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.DeviceId = ptr.String(jtv) + } + + case "Effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MobileDeviceAccessRuleEffect to be of type string, got %T instead", value) + } + sv.Effect = types.MobileDeviceAccessRuleEffect(jtv) + } + + case "UserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.UserId = ptr.String(jtv) } default: @@ -8976,7 +9595,7 @@ func awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRule(v **types.Mob return nil } -func awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRuleList(v *[]types.MobileDeviceAccessMatchedRule, value interface{}) error { +func awsAwsjson11_deserializeDocumentMobileDeviceAccessOverridesList(v *[]types.MobileDeviceAccessOverride, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8989,17 +9608,17 @@ func awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRuleList(v *[]type return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.MobileDeviceAccessMatchedRule + var cv []types.MobileDeviceAccessOverride if *v == nil { - cv = []types.MobileDeviceAccessMatchedRule{} + cv = []types.MobileDeviceAccessOverride{} } else { cv = *v } for _, value := range shape { - var col types.MobileDeviceAccessMatchedRule + var col types.MobileDeviceAccessOverride destAddr := &col - if err := awsAwsjson11_deserializeDocumentMobileDeviceAccessMatchedRule(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentMobileDeviceAccessOverride(&destAddr, value); err != nil { return err } col = *destAddr @@ -10591,6 +11210,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(v **Delete return nil } +func awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessOverrideOutput(v **DeleteMobileDeviceAccessOverrideOutput, 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 *DeleteMobileDeviceAccessOverrideOutput + if *v == nil { + sv = &DeleteMobileDeviceAccessOverrideOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessRuleOutput(v **DeleteMobileDeviceAccessRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11693,6 +12343,105 @@ func awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessEffectOutput(v **Get return nil } +func awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessOverrideOutput(v **GetMobileDeviceAccessOverrideOutput, 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 *GetMobileDeviceAccessOverrideOutput + if *v == nil { + sv = &GetMobileDeviceAccessOverrideOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DateCreated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateCreated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DateModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MobileDeviceAccessRuleDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "DeviceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceId to be of type string, got %T instead", value) + } + sv.DeviceId = ptr.String(jtv) + } + + case "Effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MobileDeviceAccessRuleEffect to be of type string, got %T instead", value) + } + sv.Effect = types.MobileDeviceAccessRuleEffect(jtv) + } + + case "UserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.UserId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(v **ListAccessControlRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11954,6 +12703,51 @@ func awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(v **ListMail return nil } +func awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessOverridesOutput(v **ListMobileDeviceAccessOverridesOutput, 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 *ListMobileDeviceAccessOverridesOutput + if *v == nil { + sv = &ListMobileDeviceAccessOverridesOutput{} + } 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 "Overrides": + if err := awsAwsjson11_deserializeDocumentMobileDeviceAccessOverridesList(&sv.Overrides, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessRulesOutput(v **ListMobileDeviceAccessRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12268,6 +13062,37 @@ func awsAwsjson11_deserializeOpDocumentPutMailboxPermissionsOutput(v **PutMailbo return nil } +func awsAwsjson11_deserializeOpDocumentPutMobileDeviceAccessOverrideOutput(v **PutMobileDeviceAccessOverrideOutput, 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 *PutMobileDeviceAccessOverrideOutput + if *v == nil { + sv = &PutMobileDeviceAccessOverrideOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentPutRetentionPolicyOutput(v **PutRetentionPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/workmail/generated.json b/service/workmail/generated.json index 68dfe2561ac..c44286b2959 100644 --- a/service/workmail/generated.json +++ b/service/workmail/generated.json @@ -18,6 +18,7 @@ "api_op_DeleteAlias.go", "api_op_DeleteGroup.go", "api_op_DeleteMailboxPermissions.go", + "api_op_DeleteMobileDeviceAccessOverride.go", "api_op_DeleteMobileDeviceAccessRule.go", "api_op_DeleteOrganization.go", "api_op_DeleteResource.go", @@ -35,12 +36,14 @@ "api_op_GetDefaultRetentionPolicy.go", "api_op_GetMailboxDetails.go", "api_op_GetMobileDeviceAccessEffect.go", + "api_op_GetMobileDeviceAccessOverride.go", "api_op_ListAccessControlRules.go", "api_op_ListAliases.go", "api_op_ListGroupMembers.go", "api_op_ListGroups.go", "api_op_ListMailboxExportJobs.go", "api_op_ListMailboxPermissions.go", + "api_op_ListMobileDeviceAccessOverrides.go", "api_op_ListMobileDeviceAccessRules.go", "api_op_ListOrganizations.go", "api_op_ListResourceDelegates.go", @@ -49,6 +52,7 @@ "api_op_ListUsers.go", "api_op_PutAccessControlRule.go", "api_op_PutMailboxPermissions.go", + "api_op_PutMobileDeviceAccessOverride.go", "api_op_PutRetentionPolicy.go", "api_op_RegisterToWorkMail.go", "api_op_ResetPassword.go", diff --git a/service/workmail/serializers.go b/service/workmail/serializers.go index e586588dc79..8946f67009d 100644 --- a/service/workmail/serializers.go +++ b/service/workmail/serializers.go @@ -625,6 +625,53 @@ func (m *awsAwsjson11_serializeOpDeleteMailboxPermissions) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteMobileDeviceAccessOverride struct { +} + +func (*awsAwsjson11_serializeOpDeleteMobileDeviceAccessOverride) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteMobileDeviceAccessOverride) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteMobileDeviceAccessOverrideInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteMobileDeviceAccessOverride") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteMobileDeviceAccessOverrideInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteMobileDeviceAccessRule struct { } @@ -1424,6 +1471,53 @@ func (m *awsAwsjson11_serializeOpGetMobileDeviceAccessEffect) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetMobileDeviceAccessOverride struct { +} + +func (*awsAwsjson11_serializeOpGetMobileDeviceAccessOverride) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetMobileDeviceAccessOverride) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetMobileDeviceAccessOverrideInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.GetMobileDeviceAccessOverride") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetMobileDeviceAccessOverrideInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListAccessControlRules struct { } @@ -1706,6 +1800,53 @@ func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListMobileDeviceAccessOverrides struct { +} + +func (*awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListMobileDeviceAccessOverridesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMobileDeviceAccessOverrides") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListMobileDeviceAccessOverridesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListMobileDeviceAccessRules struct { } @@ -2082,6 +2223,53 @@ func (m *awsAwsjson11_serializeOpPutMailboxPermissions) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpPutMobileDeviceAccessOverride struct { +} + +func (*awsAwsjson11_serializeOpPutMobileDeviceAccessOverride) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutMobileDeviceAccessOverride) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutMobileDeviceAccessOverrideInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.PutMobileDeviceAccessOverride") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutMobileDeviceAccessOverrideInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpPutRetentionPolicy struct { } @@ -3126,6 +3314,28 @@ func awsAwsjson11_serializeOpDocumentDeleteMailboxPermissionsInput(v *DeleteMail return nil } +func awsAwsjson11_serializeOpDocumentDeleteMobileDeviceAccessOverrideInput(v *DeleteMobileDeviceAccessOverrideInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeviceId != nil { + ok := object.Key("DeviceId") + ok.String(*v.DeviceId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.UserId != nil { + ok := object.Key("UserId") + ok.String(*v.UserId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteMobileDeviceAccessRuleInput(v *DeleteMobileDeviceAccessRuleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3445,6 +3655,28 @@ func awsAwsjson11_serializeOpDocumentGetMobileDeviceAccessEffectInput(v *GetMobi return nil } +func awsAwsjson11_serializeOpDocumentGetMobileDeviceAccessOverrideInput(v *GetMobileDeviceAccessOverrideInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeviceId != nil { + ok := object.Key("DeviceId") + ok.String(*v.DeviceId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.UserId != nil { + ok := object.Key("UserId") + ok.String(*v.UserId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListAccessControlRulesInput(v *ListAccessControlRulesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3582,6 +3814,38 @@ func awsAwsjson11_serializeOpDocumentListMailboxPermissionsInput(v *ListMailboxP return nil } +func awsAwsjson11_serializeOpDocumentListMobileDeviceAccessOverridesInput(v *ListMobileDeviceAccessOverridesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeviceId != nil { + ok := object.Key("DeviceId") + ok.String(*v.DeviceId) + } + + 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.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.UserId != nil { + ok := object.Key("UserId") + ok.String(*v.UserId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListMobileDeviceAccessRulesInput(v *ListMobileDeviceAccessRulesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3792,6 +4056,38 @@ func awsAwsjson11_serializeOpDocumentPutMailboxPermissionsInput(v *PutMailboxPer return nil } +func awsAwsjson11_serializeOpDocumentPutMobileDeviceAccessOverrideInput(v *PutMobileDeviceAccessOverrideInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.DeviceId != nil { + ok := object.Key("DeviceId") + ok.String(*v.DeviceId) + } + + if len(v.Effect) > 0 { + ok := object.Key("Effect") + ok.String(string(v.Effect)) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.UserId != nil { + ok := object.Key("UserId") + ok.String(*v.UserId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentPutRetentionPolicyInput(v *PutRetentionPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/workmail/types/types.go b/service/workmail/types/types.go index 048b13010ff..1d546d9e122 100644 --- a/service/workmail/types/types.go +++ b/service/workmail/types/types.go @@ -214,6 +214,30 @@ type MobileDeviceAccessMatchedRule struct { noSmithyDocumentSerde } +// The override object. +type MobileDeviceAccessOverride struct { + + // The date the override was first created. + DateCreated *time.Time + + // The date the override was last modified. + DateModified *time.Time + + // A description of the override. + Description *string + + // The device to which the override applies. + DeviceId *string + + // The effect of the override, ALLOW or DENY. + Effect MobileDeviceAccessRuleEffect + + // The WorkMail user to which the access override applies. + UserId *string + + noSmithyDocumentSerde +} + // A rule that controls access to mobile devices for an Amazon WorkMail group. type MobileDeviceAccessRule struct { diff --git a/service/workmail/validators.go b/service/workmail/validators.go index 739271b1820..2b882aa613f 100644 --- a/service/workmail/validators.go +++ b/service/workmail/validators.go @@ -270,6 +270,26 @@ func (m *validateOpDeleteMailboxPermissions) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpDeleteMobileDeviceAccessOverride struct { +} + +func (*validateOpDeleteMobileDeviceAccessOverride) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteMobileDeviceAccessOverride) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteMobileDeviceAccessOverrideInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteMobileDeviceAccessOverrideInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteMobileDeviceAccessRule struct { } @@ -610,6 +630,26 @@ func (m *validateOpGetMobileDeviceAccessEffect) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpGetMobileDeviceAccessOverride struct { +} + +func (*validateOpGetMobileDeviceAccessOverride) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetMobileDeviceAccessOverride) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetMobileDeviceAccessOverrideInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetMobileDeviceAccessOverrideInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAccessControlRules struct { } @@ -730,6 +770,26 @@ func (m *validateOpListMailboxPermissions) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpListMobileDeviceAccessOverrides struct { +} + +func (*validateOpListMobileDeviceAccessOverrides) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListMobileDeviceAccessOverrides) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListMobileDeviceAccessOverridesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListMobileDeviceAccessOverridesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListMobileDeviceAccessRules struct { } @@ -870,6 +930,26 @@ func (m *validateOpPutMailboxPermissions) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpPutMobileDeviceAccessOverride struct { +} + +func (*validateOpPutMobileDeviceAccessOverride) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutMobileDeviceAccessOverride) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutMobileDeviceAccessOverrideInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutMobileDeviceAccessOverrideInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutRetentionPolicy struct { } @@ -1122,6 +1202,10 @@ func addOpDeleteMailboxPermissionsValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDeleteMailboxPermissions{}, middleware.After) } +func addOpDeleteMobileDeviceAccessOverrideValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteMobileDeviceAccessOverride{}, middleware.After) +} + func addOpDeleteMobileDeviceAccessRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMobileDeviceAccessRule{}, middleware.After) } @@ -1190,6 +1274,10 @@ func addOpGetMobileDeviceAccessEffectValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpGetMobileDeviceAccessEffect{}, middleware.After) } +func addOpGetMobileDeviceAccessOverrideValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetMobileDeviceAccessOverride{}, middleware.After) +} + func addOpListAccessControlRulesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAccessControlRules{}, middleware.After) } @@ -1214,6 +1302,10 @@ func addOpListMailboxPermissionsValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpListMailboxPermissions{}, middleware.After) } +func addOpListMobileDeviceAccessOverridesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListMobileDeviceAccessOverrides{}, middleware.After) +} + func addOpListMobileDeviceAccessRulesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMobileDeviceAccessRules{}, middleware.After) } @@ -1242,6 +1334,10 @@ func addOpPutMailboxPermissionsValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpPutMailboxPermissions{}, middleware.After) } +func addOpPutMobileDeviceAccessOverrideValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutMobileDeviceAccessOverride{}, middleware.After) +} + func addOpPutRetentionPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutRetentionPolicy{}, middleware.After) } @@ -1613,6 +1709,27 @@ func validateOpDeleteMailboxPermissionsInput(v *DeleteMailboxPermissionsInput) e } } +func validateOpDeleteMobileDeviceAccessOverrideInput(v *DeleteMobileDeviceAccessOverrideInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteMobileDeviceAccessOverrideInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if v.DeviceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteMobileDeviceAccessRuleInput(v *DeleteMobileDeviceAccessRuleInput) error { if v == nil { return nil @@ -1919,6 +2036,27 @@ func validateOpGetMobileDeviceAccessEffectInput(v *GetMobileDeviceAccessEffectIn } } +func validateOpGetMobileDeviceAccessOverrideInput(v *GetMobileDeviceAccessOverrideInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetMobileDeviceAccessOverrideInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if v.DeviceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAccessControlRulesInput(v *ListAccessControlRulesInput) error { if v == nil { return nil @@ -2018,6 +2156,21 @@ func validateOpListMailboxPermissionsInput(v *ListMailboxPermissionsInput) error } } +func validateOpListMobileDeviceAccessOverridesInput(v *ListMobileDeviceAccessOverridesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListMobileDeviceAccessOverridesInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListMobileDeviceAccessRulesInput(v *ListMobileDeviceAccessRulesInput) error { if v == nil { return nil @@ -2144,6 +2297,30 @@ func validateOpPutMailboxPermissionsInput(v *PutMailboxPermissionsInput) error { } } +func validateOpPutMobileDeviceAccessOverrideInput(v *PutMobileDeviceAccessOverrideInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutMobileDeviceAccessOverrideInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if v.DeviceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) + } + if len(v.Effect) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Effect")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutRetentionPolicyInput(v *PutRetentionPolicyInput) error { if v == nil { return nil diff --git a/service/workspaces/api_op_CopyWorkspaceImage.go b/service/workspaces/api_op_CopyWorkspaceImage.go index 80eb5a020c8..3e895747018 100644 --- a/service/workspaces/api_op_CopyWorkspaceImage.go +++ b/service/workspaces/api_op_CopyWorkspaceImage.go @@ -15,11 +15,11 @@ import ( // more information about copying images, see Copy a Custom WorkSpaces Image // (https://docs.aws.amazon.com/workspaces/latest/adminguide/copy-custom-image.html). // In the China (Ningxia) Region, you can copy images only within the same Region. -// In the AWS GovCloud (US-West) Region, to copy images to and from other AWS -// Regions, contact AWS Support. Before copying a shared image, be sure to verify -// that it has been shared from the correct AWS account. To determine if an image -// has been shared and to see the AWS account ID that owns an image, use the -// DescribeWorkSpaceImages +// In Amazon Web Services GovCloud (US), to copy images to and from other Regions, +// contact Amazon Web Services Support. Before copying a shared image, be sure to +// verify that it has been shared from the correct Amazon Web Services account. To +// determine if an image has been shared and to see the ID of the Amazon Web +// Services account that owns an image, use the DescribeWorkSpaceImages // (https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImages.html) // and DescribeWorkspaceImagePermissions // (https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImagePermissions.html) diff --git a/service/workspaces/api_op_CreateConnectionAlias.go b/service/workspaces/api_op_CreateConnectionAlias.go index dda6be63a46..46e753b5cf3 100644 --- a/service/workspaces/api_op_CreateConnectionAlias.go +++ b/service/workspaces/api_op_CreateConnectionAlias.go @@ -33,9 +33,9 @@ type CreateConnectionAliasInput struct { // A connection string in the form of a fully qualified domain name (FQDN), such as // www.example.com. After you create a connection string, it is always associated - // to your AWS account. You cannot recreate the same connection string with a - // different account, even if you delete all instances of it from the original - // account. The connection string is globally reserved for your account. + // to your Amazon Web Services account. You cannot recreate the same connection + // string with a different account, even if you delete all instances of it from the + // original account. The connection string is globally reserved for your account. // // This member is required. ConnectionString *string diff --git a/service/workspaces/api_op_CreateUpdatedWorkspaceImage.go b/service/workspaces/api_op_CreateUpdatedWorkspaceImage.go new file mode 100644 index 00000000000..64b25903d59 --- /dev/null +++ b/service/workspaces/api_op_CreateUpdatedWorkspaceImage.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspaces + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workspaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new updated WorkSpace image based on the specified source image. The +// new updated WorkSpace image has the latest drivers and other updates required by +// the Amazon WorkSpaces components. To determine which WorkSpace images need to be +// updated with the latest Amazon WorkSpaces requirements, use +// DescribeWorkspaceImages +// (https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImages.html). +// +// * +// Only Windows 10 WorkSpace images can be programmatically updated at this +// time. +// +// * Microsoft Windows updates and other application updates are not +// included in the update process. +// +// * The source WorkSpace image is not deleted. +// You can delete the source image after you've verified your new updated image and +// created a new bundle. +func (c *Client) CreateUpdatedWorkspaceImage(ctx context.Context, params *CreateUpdatedWorkspaceImageInput, optFns ...func(*Options)) (*CreateUpdatedWorkspaceImageOutput, error) { + if params == nil { + params = &CreateUpdatedWorkspaceImageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateUpdatedWorkspaceImage", params, optFns, c.addOperationCreateUpdatedWorkspaceImageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateUpdatedWorkspaceImageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateUpdatedWorkspaceImageInput struct { + + // A description of whether updates for the WorkSpace image are available. + // + // This member is required. + Description *string + + // The name of the new updated WorkSpace image. + // + // This member is required. + Name *string + + // The identifier of the source WorkSpace image. + // + // This member is required. + SourceImageId *string + + // The tags that you want to add to the new updated WorkSpace image. To add tags at + // the same time when you're creating the updated image, you must create an IAM + // policy that grants your IAM user permissions to use workspaces:CreateTags. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateUpdatedWorkspaceImageOutput struct { + + // The identifier of the new updated WorkSpace image. + ImageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateUpdatedWorkspaceImageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateUpdatedWorkspaceImage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateUpdatedWorkspaceImage{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateUpdatedWorkspaceImageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateUpdatedWorkspaceImage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateUpdatedWorkspaceImage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workspaces", + OperationName: "CreateUpdatedWorkspaceImage", + } +} diff --git a/service/workspaces/api_op_DeregisterWorkspaceDirectory.go b/service/workspaces/api_op_DeregisterWorkspaceDirectory.go index 1dee87e5ccb..f43a291e161 100644 --- a/service/workspaces/api_op_DeregisterWorkspaceDirectory.go +++ b/service/workspaces/api_op_DeregisterWorkspaceDirectory.go @@ -17,7 +17,7 @@ import ( // WorkSpaces. If there are no WorkSpaces being used with your Simple AD or AD // Connector directory for 30 consecutive days, this directory will be // automatically deregistered for use with Amazon WorkSpaces, and you will be -// charged for this directory as per the AWS Directory Services pricing terms +// charged for this directory as per the Directory Service pricing terms // (http://aws.amazon.com/directoryservice/pricing/). To delete empty directories, // see Delete the Directory for Your WorkSpaces // (https://docs.aws.amazon.com/workspaces/latest/adminguide/delete-workspaces-directory.html). diff --git a/service/workspaces/api_op_DescribeConnectionAliasPermissions.go b/service/workspaces/api_op_DescribeConnectionAliasPermissions.go index 7993b2502e7..67f28e07cd7 100644 --- a/service/workspaces/api_op_DescribeConnectionAliasPermissions.go +++ b/service/workspaces/api_op_DescribeConnectionAliasPermissions.go @@ -12,8 +12,8 @@ import ( ) // Describes the permissions that the owner of a connection alias has granted to -// another AWS account for the specified connection alias. For more information, -// see Cross-Region Redirection for Amazon WorkSpaces +// another Amazon Web Services account for the specified connection alias. For more +// information, see Cross-Region Redirection for Amazon WorkSpaces // (https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html). func (c *Client) DescribeConnectionAliasPermissions(ctx context.Context, params *DescribeConnectionAliasPermissionsInput, optFns ...func(*Options)) (*DescribeConnectionAliasPermissionsOutput, error) { if params == nil { diff --git a/service/workspaces/api_op_DescribeWorkspaceBundles.go b/service/workspaces/api_op_DescribeWorkspaceBundles.go index 41355de8948..81f87b9b66a 100644 --- a/service/workspaces/api_op_DescribeWorkspaceBundles.go +++ b/service/workspaces/api_op_DescribeWorkspaceBundles.go @@ -40,8 +40,8 @@ type DescribeWorkspaceBundlesInput struct { NextToken *string // The owner of the bundles. You cannot combine this parameter with any other - // filter. To describe the bundles provided by AWS, specify AMAZON. To describe the - // bundles that belong to your account, don't specify a value. + // filter. To describe the bundles provided by Amazon Web Services, specify AMAZON. + // To describe the bundles that belong to your account, don't specify a value. Owner *string noSmithyDocumentSerde diff --git a/service/workspaces/api_op_DescribeWorkspaceImagePermissions.go b/service/workspaces/api_op_DescribeWorkspaceImagePermissions.go index ef2242a9df4..8ac967787bf 100644 --- a/service/workspaces/api_op_DescribeWorkspaceImagePermissions.go +++ b/service/workspaces/api_op_DescribeWorkspaceImagePermissions.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes the permissions that the owner of an image has granted to other AWS -// accounts for an image. +// Describes the permissions that the owner of an image has granted to other Amazon +// Web Services accounts for an image. func (c *Client) DescribeWorkspaceImagePermissions(ctx context.Context, params *DescribeWorkspaceImagePermissionsInput, optFns ...func(*Options)) (*DescribeWorkspaceImagePermissionsOutput, error) { if params == nil { params = &DescribeWorkspaceImagePermissionsInput{} @@ -50,7 +50,8 @@ type DescribeWorkspaceImagePermissionsOutput struct { // The identifier of the image. ImageId *string - // The identifiers of the AWS accounts that the image has been shared with. + // The identifiers of the Amazon Web Services accounts that the image has been + // shared with. ImagePermissions []types.ImagePermission // The token to use to retrieve the next page of results. This value is null when diff --git a/service/workspaces/api_op_DisassociateConnectionAlias.go b/service/workspaces/api_op_DisassociateConnectionAlias.go index ff4937aa9e7..d8066548d4a 100644 --- a/service/workspaces/api_op_DisassociateConnectionAlias.go +++ b/service/workspaces/api_op_DisassociateConnectionAlias.go @@ -11,7 +11,7 @@ import ( ) // Disassociates a connection alias from a directory. Disassociating a connection -// alias disables cross-Region redirection between two directories in different AWS +// alias disables cross-Region redirection between two directories in different // Regions. For more information, see Cross-Region Redirection for Amazon // WorkSpaces // (https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html). diff --git a/service/workspaces/api_op_ImportWorkspaceImage.go b/service/workspaces/api_op_ImportWorkspaceImage.go index c8c1759c9a0..092d107e2e1 100644 --- a/service/workspaces/api_op_ImportWorkspaceImage.go +++ b/service/workspaces/api_op_ImportWorkspaceImage.go @@ -13,8 +13,9 @@ import ( // Imports the specified Windows 10 Bring Your Own License (BYOL) image into Amazon // WorkSpaces. The image must be an already licensed Amazon EC2 image that is in -// your AWS account, and you must own the image. For more information about -// creating BYOL images, see Bring Your Own Windows Desktop Licenses +// your Amazon Web Services account, and you must own the image. For more +// information about creating BYOL images, see Bring Your Own Windows Desktop +// Licenses // (https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html). func (c *Client) ImportWorkspaceImage(ctx context.Context, params *ImportWorkspaceImageInput, optFns ...func(*Options)) (*ImportWorkspaceImageOutput, error) { if params == nil { diff --git a/service/workspaces/api_op_ListAvailableManagementCidrRanges.go b/service/workspaces/api_op_ListAvailableManagementCidrRanges.go index 5876cebefda..6d1b8800870 100644 --- a/service/workspaces/api_op_ListAvailableManagementCidrRanges.go +++ b/service/workspaces/api_op_ListAvailableManagementCidrRanges.go @@ -12,12 +12,12 @@ import ( // Retrieves a list of IP address ranges, specified as IPv4 CIDR blocks, that you // can use for the network management interface when you enable Bring Your Own -// License (BYOL). This operation can be run only by AWS accounts that are enabled -// for BYOL. If your account isn't enabled for BYOL, you'll receive an -// AccessDeniedException error. The management network interface is connected to a -// secure Amazon WorkSpaces management network. It is used for interactive -// streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and to allow -// Amazon WorkSpaces to manage the WorkSpace. +// License (BYOL). This operation can be run only by Amazon Web Services accounts +// that are enabled for BYOL. If your account isn't enabled for BYOL, you'll +// receive an AccessDeniedException error. The management network interface is +// connected to a secure Amazon WorkSpaces management network. It is used for +// interactive streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and +// to allow Amazon WorkSpaces to manage the WorkSpace. func (c *Client) ListAvailableManagementCidrRanges(ctx context.Context, params *ListAvailableManagementCidrRangesInput, optFns ...func(*Options)) (*ListAvailableManagementCidrRangesOutput, error) { if params == nil { params = &ListAvailableManagementCidrRangesInput{} diff --git a/service/workspaces/api_op_RegisterWorkspaceDirectory.go b/service/workspaces/api_op_RegisterWorkspaceDirectory.go index 6b84fb2dc64..8bc77cc42f5 100644 --- a/service/workspaces/api_op_RegisterWorkspaceDirectory.go +++ b/service/workspaces/api_op_RegisterWorkspaceDirectory.go @@ -65,10 +65,11 @@ type RegisterWorkspaceDirectoryInput struct { Tags []types.Tag // Indicates whether your WorkSpace directory is dedicated or shared. To use Bring - // Your Own License (BYOL) images, this value must be set to DEDICATED and your AWS - // account must be enabled for BYOL. If your account has not been enabled for BYOL, - // you will receive an InvalidParameterValuesException error. For more information - // about BYOL images, see Bring Your Own Windows Desktop Images + // Your Own License (BYOL) images, this value must be set to DEDICATED and your + // Amazon Web Services account must be enabled for BYOL. If your account has not + // been enabled for BYOL, you will receive an InvalidParameterValuesException + // error. For more information about BYOL images, see Bring Your Own Windows + // Desktop Images // (https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html). Tenancy types.Tenancy diff --git a/service/workspaces/api_op_TerminateWorkspaces.go b/service/workspaces/api_op_TerminateWorkspaces.go index 12c619216e8..79c888f1679 100644 --- a/service/workspaces/api_op_TerminateWorkspaces.go +++ b/service/workspaces/api_op_TerminateWorkspaces.go @@ -13,20 +13,20 @@ import ( // Terminates the specified WorkSpaces. Terminating a WorkSpace is a permanent // action and cannot be undone. The user's data is destroyed. If you need to -// archive any user data, contact AWS Support before terminating the WorkSpace. You -// can terminate a WorkSpace that is in any state except SUSPENDED. This operation -// is asynchronous and returns before the WorkSpaces have been completely -// terminated. After a WorkSpace is terminated, the TERMINATED state is returned -// only briefly before the WorkSpace directory metadata is cleaned up, so this -// state is rarely returned. To confirm that a WorkSpace is terminated, check for -// the WorkSpace ID by using DescribeWorkSpaces +// archive any user data, contact Amazon Web Services Support before terminating +// the WorkSpace. You can terminate a WorkSpace that is in any state except +// SUSPENDED. This operation is asynchronous and returns before the WorkSpaces have +// been completely terminated. After a WorkSpace is terminated, the TERMINATED +// state is returned only briefly before the WorkSpace directory metadata is +// cleaned up, so this state is rarely returned. To confirm that a WorkSpace is +// terminated, check for the WorkSpace ID by using DescribeWorkSpaces // (https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaces.html). // If the WorkSpace ID isn't returned, then the WorkSpace has been successfully // terminated. Simple AD and AD Connector are made available to you free of charge // to use with WorkSpaces. If there are no WorkSpaces being used with your Simple // AD or AD Connector directory for 30 consecutive days, this directory will be // automatically deregistered for use with Amazon WorkSpaces, and you will be -// charged for this directory as per the AWS Directory Services pricing terms +// charged for this directory as per the Directory Service pricing terms // (http://aws.amazon.com/directoryservice/pricing/). To delete empty directories, // see Delete the Directory for Your WorkSpaces // (https://docs.aws.amazon.com/workspaces/latest/adminguide/delete-workspaces-directory.html). diff --git a/service/workspaces/api_op_UpdateConnectionAliasPermission.go b/service/workspaces/api_op_UpdateConnectionAliasPermission.go index 476cd78f9cf..bf8b07845df 100644 --- a/service/workspaces/api_op_UpdateConnectionAliasPermission.go +++ b/service/workspaces/api_op_UpdateConnectionAliasPermission.go @@ -53,7 +53,7 @@ type UpdateConnectionAliasPermissionInput struct { AliasId *string // Indicates whether to share or unshare the connection alias with the specified - // AWS account. + // Amazon Web Services account. // // This member is required. ConnectionAliasPermission *types.ConnectionAliasPermission diff --git a/service/workspaces/api_op_UpdateWorkspaceImagePermission.go b/service/workspaces/api_op_UpdateWorkspaceImagePermission.go index 0657d11e781..d6cf63d0880 100644 --- a/service/workspaces/api_op_UpdateWorkspaceImagePermission.go +++ b/service/workspaces/api_op_UpdateWorkspaceImagePermission.go @@ -10,25 +10,26 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Shares or unshares an image with one account in the same AWS Region by -// specifying whether that account has permission to copy the image. If the copy -// image permission is granted, the image is shared with that account. If the copy -// image permission is revoked, the image is unshared with the account. After an -// image has been shared, the recipient account can copy the image to other AWS -// Regions as needed. In the China (Ningxia) Region, you can copy images only -// within the same Region. In the AWS GovCloud (US-West) Region, to copy images to -// and from other AWS Regions, contact AWS Support. For more information about -// sharing images, see Share or Unshare a Custom WorkSpaces Image +// Shares or unshares an image with one account in the same Amazon Web Services +// Region by specifying whether that account has permission to copy the image. If +// the copy image permission is granted, the image is shared with that account. If +// the copy image permission is revoked, the image is unshared with the account. +// After an image has been shared, the recipient account can copy the image to +// other Regions as needed. In the China (Ningxia) Region, you can copy images only +// within the same Region. In Amazon Web Services GovCloud (US), to copy images to +// and from other Regions, contact Amazon Web Services Support. For more +// information about sharing images, see Share or Unshare a Custom WorkSpaces +// Image // (https://docs.aws.amazon.com/workspaces/latest/adminguide/share-custom-image.html). // // * // To delete an image that has been shared, you must unshare the image before you // delete it. // -// * Sharing Bring Your Own License (BYOL) images across AWS accounts -// isn't supported at this time in the AWS GovCloud (US-West) Region. To share BYOL -// images across accounts in the AWS GovCloud (US-West) Region, contact AWS -// Support. +// * Sharing Bring Your Own License (BYOL) images across Amazon Web +// Services accounts isn't supported at this time in Amazon Web Services GovCloud +// (US). To share BYOL images across accounts in Amazon Web Services GovCloud (US), +// contact Amazon Web Services Support. func (c *Client) UpdateWorkspaceImagePermission(ctx context.Context, params *UpdateWorkspaceImagePermissionInput, optFns ...func(*Options)) (*UpdateWorkspaceImagePermissionOutput, error) { if params == nil { params = &UpdateWorkspaceImagePermissionInput{} @@ -57,8 +58,9 @@ type UpdateWorkspaceImagePermissionInput struct { // This member is required. ImageId *string - // The identifier of the AWS account to share or unshare the image with. Before - // sharing the image, confirm that you are sharing to the correct AWS account ID. + // The identifier of the Amazon Web Services account to share or unshare the image + // with. Before sharing the image, confirm that you are sharing to the correct + // Amazon Web Services account ID. // // This member is required. SharedAccountId *string diff --git a/service/workspaces/deserializers.go b/service/workspaces/deserializers.go index 5c76b551412..0db62114937 100644 --- a/service/workspaces/deserializers.go +++ b/service/workspaces/deserializers.go @@ -889,6 +889,135 @@ func awsAwsjson11_deserializeOpErrorCreateTags(response *smithyhttp.Response, me } } +type awsAwsjson11_deserializeOpCreateUpdatedWorkspaceImage struct { +} + +func (*awsAwsjson11_deserializeOpCreateUpdatedWorkspaceImage) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateUpdatedWorkspaceImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorCreateUpdatedWorkspaceImage(response, &metadata) + } + output := &CreateUpdatedWorkspaceImageOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentCreateUpdatedWorkspaceImageOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateUpdatedWorkspaceImage(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InvalidParameterValuesException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterValuesException(response, errorBody) + + case strings.EqualFold("InvalidResourceStateException", errorCode): + return awsAwsjson11_deserializeErrorInvalidResourceStateException(response, errorBody) + + case strings.EqualFold("OperationNotSupportedException", errorCode): + return awsAwsjson11_deserializeErrorOperationNotSupportedException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateWorkspaceBundle struct { } @@ -9068,6 +9197,55 @@ func awsAwsjson11_deserializeDocumentUnsupportedWorkspaceConfigurationException( return nil } +func awsAwsjson11_deserializeDocumentUpdateResult(v **types.UpdateResult, 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.UpdateResult + if *v == nil { + sv = &types.UpdateResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "UpdateAvailable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) + } + sv.UpdateAvailable = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentUserStorage(v **types.UserStorage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9873,6 +10051,11 @@ func awsAwsjson11_deserializeDocumentWorkspaceImage(v **types.WorkspaceImage, va sv.State = types.WorkspaceImageState(jtv) } + case "Updates": + if err := awsAwsjson11_deserializeDocumentUpdateResult(&sv.Updates, value); err != nil { + return err + } + default: _, _ = key, value @@ -10523,6 +10706,46 @@ func awsAwsjson11_deserializeOpDocumentCreateTagsOutput(v **CreateTagsOutput, va return nil } +func awsAwsjson11_deserializeOpDocumentCreateUpdatedWorkspaceImageOutput(v **CreateUpdatedWorkspaceImageOutput, 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 *CreateUpdatedWorkspaceImageOutput + if *v == nil { + sv = &CreateUpdatedWorkspaceImageOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ImageId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkspaceImageId to be of type string, got %T instead", value) + } + sv.ImageId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateWorkspaceBundleOutput(v **CreateWorkspaceBundleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/workspaces/generated.json b/service/workspaces/generated.json index 6ae1f1383de..6e9bffa46f5 100644 --- a/service/workspaces/generated.json +++ b/service/workspaces/generated.json @@ -12,6 +12,7 @@ "api_op_CreateConnectionAlias.go", "api_op_CreateIpGroup.go", "api_op_CreateTags.go", + "api_op_CreateUpdatedWorkspaceImage.go", "api_op_CreateWorkspaceBundle.go", "api_op_CreateWorkspaces.go", "api_op_DeleteConnectionAlias.go", diff --git a/service/workspaces/serializers.go b/service/workspaces/serializers.go index 12bcd8a0309..1d10b9950ad 100644 --- a/service/workspaces/serializers.go +++ b/service/workspaces/serializers.go @@ -343,6 +343,53 @@ func (m *awsAwsjson11_serializeOpCreateTags) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateUpdatedWorkspaceImage struct { +} + +func (*awsAwsjson11_serializeOpCreateUpdatedWorkspaceImage) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateUpdatedWorkspaceImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateUpdatedWorkspaceImageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkspacesService.CreateUpdatedWorkspaceImage") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateUpdatedWorkspaceImageInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateWorkspaceBundle struct { } @@ -3245,6 +3292,35 @@ func awsAwsjson11_serializeOpDocumentCreateTagsInput(v *CreateTagsInput, value s return nil } +func awsAwsjson11_serializeOpDocumentCreateUpdatedWorkspaceImageInput(v *CreateUpdatedWorkspaceImageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.SourceImageId != nil { + ok := object.Key("SourceImageId") + ok.String(*v.SourceImageId) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateWorkspaceBundleInput(v *CreateWorkspaceBundleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/workspaces/types/types.go b/service/workspaces/types/types.go index 908d563de2d..fa700f62fe1 100644 --- a/service/workspaces/types/types.go +++ b/service/workspaces/types/types.go @@ -83,7 +83,8 @@ type ConnectionAlias struct { // www.example.com. ConnectionString *string - // The identifier of the AWS account that owns the connection alias. + // The identifier of the Amazon Web Services account that owns the connection + // alias. OwnerAccountId *string // The current state of the connection alias. @@ -98,8 +99,8 @@ type ConnectionAlias struct { // (https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html). type ConnectionAliasAssociation struct { - // The identifier of the AWS account that associated the connection alias with a - // directory. + // The identifier of the Amazon Web Services account that associated the connection + // alias with a directory. AssociatedAccountId *string // The association status of the connection alias. @@ -122,13 +123,14 @@ type ConnectionAliasAssociation struct { // (https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html). type ConnectionAliasPermission struct { - // Indicates whether the specified AWS account is allowed to associate the - // connection alias with a directory. + // Indicates whether the specified Amazon Web Services account is allowed to + // associate the connection alias with a directory. // // This member is required. AllowAssociation *bool - // The identifier of the AWS account that the connection alias is shared with. + // The identifier of the Amazon Web Services account that the connection alias is + // shared with. // // This member is required. SharedAccountId *string @@ -210,13 +212,14 @@ type FailedWorkspaceChangeRequest struct { noSmithyDocumentSerde } -// Describes the AWS accounts that have been granted permission to use a shared -// image. For more information about sharing images, see Share or Unshare a Custom -// WorkSpaces Image +// Describes the Amazon Web Services accounts that have been granted permission to +// use a shared image. For more information about sharing images, see Share or +// Unshare a Custom WorkSpaces Image // (https://docs.aws.amazon.com/workspaces/latest/adminguide/share-custom-image.html). type ImagePermission struct { - // The identifier of the AWS account that an image has been shared with. + // The identifier of the Amazon Web Services account that an image has been shared + // with. SharedAccountId *string noSmithyDocumentSerde @@ -364,6 +367,22 @@ type TerminateRequest struct { noSmithyDocumentSerde } +// Describes whether a WorkSpace image needs to be updated with the latest drivers +// and other components required by Amazon WorkSpaces. Only Windows 10 WorkSpace +// images can be programmatically updated at this time. +type UpdateResult struct { + + // A description of whether updates for the WorkSpace image are pending or + // available. + Description *string + + // Indicates whether updated drivers or other components are available for the + // specified WorkSpace image. + UpdateAvailable *bool + + noSmithyDocumentSerde +} + // Describes the user volume for a WorkSpace bundle. type UserStorage struct { @@ -384,7 +403,7 @@ type Workspace struct { // (https://docs.aws.amazon.com/workspaces/latest/adminguide/launch-workspaces-tutorials.html). ComputerName *string - // The identifier of the AWS Directory Service directory for the WorkSpace. + // The identifier of the Directory Service directory for the WorkSpace. DirectoryId *string // The error code that is returned if the WorkSpace cannot be created. @@ -421,8 +440,8 @@ type Workspace struct { // Indicates whether the data stored on the user volume is encrypted. UserVolumeEncryptionEnabled *bool - // The symmetric AWS KMS customer master key (CMK) used to encrypt data stored on - // your WorkSpace. Amazon WorkSpaces does not support asymmetric CMKs. + // The symmetric KMS key used to encrypt data stored on your WorkSpace. Amazon + // WorkSpaces does not support asymmetric KMS keys. VolumeEncryptionKey *string // The identifier of the WorkSpace. @@ -439,7 +458,8 @@ type Workspace struct { // (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-network-requirements.html). type WorkspaceAccessProperties struct { - // Indicates whether users can use Android devices to access their WorkSpaces. + // Indicates whether users can use Android and Android-compatible Chrome OS devices + // to access their WorkSpaces. DeviceTypeAndroid AccessPropertyValue // Indicates whether users can use Chromebooks to access their WorkSpaces. @@ -451,21 +471,13 @@ type WorkspaceAccessProperties struct { // Indicates whether users can use Linux clients to access their WorkSpaces. DeviceTypeLinux AccessPropertyValue - // Indicates whether users can use macOS clients to access their WorkSpaces. To - // restrict WorkSpaces access to trusted devices (also known as managed devices) - // with valid certificates, specify a value of TRUST. For more information, see - // Restrict WorkSpaces Access to Trusted Devices - // (https://docs.aws.amazon.com/workspaces/latest/adminguide/trusted-devices.html). + // Indicates whether users can use macOS clients to access their WorkSpaces. DeviceTypeOsx AccessPropertyValue // Indicates whether users can access their WorkSpaces through a web browser. DeviceTypeWeb AccessPropertyValue - // Indicates whether users can use Windows clients to access their WorkSpaces. To - // restrict WorkSpaces access to trusted devices (also known as managed devices) - // with valid certificates, specify a value of TRUST. For more information, see - // Restrict WorkSpaces Access to Trusted Devices - // (https://docs.aws.amazon.com/workspaces/latest/adminguide/trusted-devices.html). + // Indicates whether users can use Windows clients to access their WorkSpaces. DeviceTypeWindows AccessPropertyValue // Indicates whether users can use zero client devices to access their WorkSpaces. @@ -500,7 +512,7 @@ type WorkspaceBundle struct { Name *string // The owner of the bundle. This is the account identifier of the owner, or AMAZON - // if the bundle is provided by AWS. + // if the bundle is provided by Amazon Web Services. Owner *string // The size of the root volume. @@ -656,9 +668,9 @@ type WorkspaceDirectory struct { // Describes a WorkSpace image. type WorkspaceImage struct { - // The date when the image was created. If the image has been shared, the AWS - // account that the image has been shared with sees the original creation date of - // the image. + // The date when the image was created. If the image has been shared, the Amazon + // Web Services account that the image has been shared with sees the original + // creation date of the image. Created *time.Time // The description of the image. @@ -679,7 +691,7 @@ type WorkspaceImage struct { // The operating system that the image is running. OperatingSystem *OperatingSystem - // The identifier of the AWS account that owns the image. + // The identifier of the Amazon Web Services account that owns the image. OwnerAccountId *string // Specifies whether the image is running on dedicated hardware. When Bring Your @@ -691,6 +703,9 @@ type WorkspaceImage struct { // The status of the image. State WorkspaceImageState + // The updates (if any) that are available for the specified image. + Updates *UpdateResult + noSmithyDocumentSerde } @@ -731,14 +746,14 @@ type WorkspaceRequest struct { // This member is required. BundleId *string - // The identifier of the AWS Directory Service directory for the WorkSpace. You can - // use DescribeWorkspaceDirectories to list the available directories. + // The identifier of the Directory Service directory for the WorkSpace. You can use + // DescribeWorkspaceDirectories to list the available directories. // // This member is required. DirectoryId *string // The user name of the user for the WorkSpace. This user name must exist in the - // AWS Directory Service directory for the WorkSpace. + // Directory Service directory for the WorkSpace. // // This member is required. UserName *string @@ -752,8 +767,8 @@ type WorkspaceRequest struct { // Indicates whether the data stored on the user volume is encrypted. UserVolumeEncryptionEnabled *bool - // The symmetric AWS KMS customer master key (CMK) used to encrypt data stored on - // your WorkSpace. Amazon WorkSpaces does not support asymmetric CMKs. + // The symmetric KMS key used to encrypt data stored on your WorkSpace. Amazon + // WorkSpaces does not support asymmetric KMS keys. VolumeEncryptionKey *string // The WorkSpace properties. diff --git a/service/workspaces/validators.go b/service/workspaces/validators.go index d05c494f557..7e154caefbb 100644 --- a/service/workspaces/validators.go +++ b/service/workspaces/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCreateTags) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpCreateUpdatedWorkspaceImage struct { +} + +func (*validateOpCreateUpdatedWorkspaceImage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateUpdatedWorkspaceImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateUpdatedWorkspaceImageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateUpdatedWorkspaceImageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateWorkspaceBundle struct { } @@ -858,6 +878,10 @@ func addOpCreateTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateTags{}, middleware.After) } +func addOpCreateUpdatedWorkspaceImageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateUpdatedWorkspaceImage{}, middleware.After) +} + func addOpCreateWorkspaceBundleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorkspaceBundle{}, middleware.After) } @@ -1325,6 +1349,32 @@ func validateOpCreateTagsInput(v *CreateTagsInput) error { } } +func validateOpCreateUpdatedWorkspaceImageInput(v *CreateUpdatedWorkspaceImageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateUpdatedWorkspaceImageInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if v.SourceImageId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceImageId")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateWorkspaceBundleInput(v *CreateWorkspaceBundleInput) error { if v == nil { return nil