From d0c9d422756e7eb30b9937468e659b140fc5e578 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Fri, 17 Nov 2023 20:13:47 +0000 Subject: [PATCH] Regenerated Clients --- .../0382649a3f0f4dca894836fac1e27e20.json | 8 + .../21845a2628474bd1aed734d74cecbf07.json | 8 + .../2b0f85ca51eb4281ae41ca98caf3feff.json | 8 + .../41575353444b40ffbf474f4155544f00.json | 8 + .../43bd0dfdb219418ebce39a10eb85d448.json | 8 + .../46b8786876f8471cbf4a12d956cabac5.json | 8 + .../4c34b0c605d94b56b8f02aa794986ffc.json | 8 + .../5581ba3dfa0f422bbde694754cdd5e19.json | 8 + .../5812092b9e684c598ce9510281ab2473.json | 8 + .../613883c687bc4a01bab94743db388839.json | 8 + .../7349608a8af84dd5891e986c74621005.json | 8 + .../7533f0edb760415face907ab7d664ee4.json | 8 + .../82eafa5396374425afca8f7e2d6081f1.json | 8 + .../923c0b8eb1534a88ae0fc48e3f5cafbe.json | 8 + .../9660ef8a8ecb45c2ae8b14d0405109a3.json | 8 + .../9b35722f0b394296bf5ae86bb534c833.json | 8 + .../a1b28c8de2494063aee8f28dff1bfc88.json | 8 + .../a294cf4c613543ebb50b79555c9747dc.json | 8 + .../a654e00f7cf241f69def8f62ab585385.json | 8 + .../ab2b3d85f4f44f239976c7606336e3a5.json | 8 + .../acce893783fd440ea20062f8f39e19fd.json | 8 + .../ae8a9c106c394c93a26ebfdb8963bbad.json | 8 + .../b0bd854919fe40368f5518f7ee549482.json | 8 + .../b5f10bed114649c8b603c2ecb8b33421.json | 8 + .../b6a416288317450a92d6edc5bbf9bd27.json | 8 + .../b8e1ec02a95f40f7814fe198d25cea68.json | 8 + .../ba0f541676454adba5b5d4e326beed54.json | 8 + .../e2c8f56cc7414153aa611284bd7e1ec5.json | 8 + .../ee5d39fd907246529b02a449581344b6.json | 8 + .../ef6c9060feee479b990e601af91cf8c7.json | 8 + .../ef758d1922764ee1ad3013fd04a72d6f.json | 8 + .../ffdfdb3ae63444d696fb3d9dfc485448.json | 8 + service/appmesh/deserializers.go | 30 +- service/appmesh/endpoints.go | 2 +- service/appmesh/serializers.go | 60 +- service/appmesh/types/types.go | 32 +- service/appmesh/validators.go | 39 + service/athena/api_op_CreateDataCatalog.go | 4 - service/athena/api_op_CreateNamedQuery.go | 4 +- service/athena/api_op_DeleteNamedQuery.go | 4 +- service/athena/api_op_ListNamedQueries.go | 3 - service/athena/api_op_ListQueryExecutions.go | 8 +- .../api_op_StartCalculationExecution.go | 9 +- service/athena/api_op_StopQueryExecution.go | 4 +- service/athena/deserializers.go | 26 + service/athena/doc.go | 4 +- service/athena/types/types.go | 32 +- service/cloud9/api_op_CreateEnvironmentEC2.go | 2 +- .../cloudformation/api_op_CreateChangeSet.go | 9 + .../api_op_DescribeChangeSet.go | 7 + service/cloudformation/deserializers.go | 32 + service/cloudformation/endpoints_test.go | 20 - service/cloudformation/serializers.go | 5 + service/cloudformation/types/types.go | 23 +- .../api_op_StartPipelineExecution.go | 6 + service/codepipeline/serializers.go | 42 + service/codepipeline/types/enums.go | 20 + service/codepipeline/types/types.go | 60 +- service/codepipeline/validators.go | 43 + .../codestarconnections/api_op_CreateHost.go | 2 + .../api_op_CreateRepositoryLink.go | 159 + .../api_op_CreateSyncConfiguration.go | 175 + .../api_op_DeleteRepositoryLink.go | 133 + .../api_op_DeleteSyncConfiguration.go | 139 + .../api_op_GetRepositoryLink.go | 140 + .../api_op_GetRepositorySyncStatus.go | 150 + .../api_op_GetResourceSyncStatus.go | 154 + .../api_op_GetSyncBlockerSummary.go | 145 + .../api_op_GetSyncConfiguration.go | 150 + .../api_op_ListRepositoryLinks.go | 229 + .../api_op_ListRepositorySyncDefinitions.go | 152 + .../api_op_ListSyncConfigurations.go | 242 + .../api_op_UpdateRepositoryLink.go | 150 + .../api_op_UpdateSyncBlocker.go | 163 + .../api_op_UpdateSyncConfiguration.go | 158 + service/codestarconnections/deserializers.go | 5500 ++++++++++++++-- service/codestarconnections/endpoints.go | 2 +- service/codestarconnections/generated.json | 15 + service/codestarconnections/serializers.go | 1229 +++- service/codestarconnections/types/enums.go | 96 + service/codestarconnections/types/errors.go | 316 + service/codestarconnections/types/types.go | 361 ++ service/codestarconnections/validators.go | 608 ++ service/connect/types/enums.go | 20 +- service/dlm/types/types.go | 5 +- service/ec2/api_op_AdvertiseByoipCidr.go | 3 + service/ec2/api_op_AllocateIpamPoolCidr.go | 4 + service/ec2/api_op_AssociateIpamByoasn.go | 154 + .../ec2/api_op_AssociateSubnetCidrBlock.go | 17 +- service/ec2/api_op_AssociateTrunkInterface.go | 6 +- service/ec2/api_op_AssociateVpcCidrBlock.go | 11 +- service/ec2/api_op_CreateIpam.go | 5 + service/ec2/api_op_CreateIpamPool.go | 3 + service/ec2/api_op_CreateNetworkInterface.go | 3 + service/ec2/api_op_CreateSubnet.go | 29 +- service/ec2/api_op_CreateVpc.go | 2 +- service/ec2/api_op_DeleteIpamPool.go | 7 + service/ec2/api_op_DeprovisionIpamByoasn.go | 152 + service/ec2/api_op_DescribeIpamByoasn.go | 149 + ...i_op_DescribeTrunkInterfaceAssociations.go | 4 +- service/ec2/api_op_DisassociateIpamByoasn.go | 152 + .../ec2/api_op_DisassociateTrunkInterface.go | 5 +- ...api_op_GetIpamDiscoveredPublicAddresses.go | 166 + service/ec2/api_op_ModifyIpam.go | 5 + .../api_op_ModifyNetworkInterfaceAttribute.go | 3 + service/ec2/api_op_ProvisionIpamByoasn.go | 157 + service/ec2/deserializers.go | 2462 ++++++- service/ec2/generated.json | 6 + service/ec2/serializers.go | 740 ++- service/ec2/types/enums.go | 165 + service/ec2/types/types.go | 340 +- service/ec2/validators.go | 238 +- .../ecr/api_op_CreatePullThroughCacheRule.go | 30 +- .../ecr/api_op_DeletePullThroughCacheRule.go | 4 + service/ecr/api_op_DeleteRepository.go | 8 +- .../ecr/api_op_UpdatePullThroughCacheRule.go | 159 + .../api_op_ValidatePullThroughCacheRule.go | 164 + service/ecr/deserializers.go | 926 ++- service/ecr/endpoints.go | 6 +- service/ecr/generated.json | 2 + service/ecr/serializers.go | 159 + service/ecr/types/enums.go | 32 + service/ecr/types/errors.go | 138 + service/ecr/types/types.go | 12 + service/ecr/validators.go | 81 + service/emr/api_op_AddInstanceFleet.go | 2 +- service/emr/api_op_CancelSteps.go | 4 +- service/emr/api_op_CreateStudio.go | 16 + ...pi_op_GetBlockPublicAccessConfiguration.go | 12 +- service/emr/api_op_ListInstanceFleets.go | 2 +- service/emr/api_op_ModifyInstanceFleet.go | 2 +- .../emr/api_op_PutAutoTerminationPolicy.go | 2 +- service/emr/api_op_RunJobFlow.go | 53 +- service/emr/api_op_UpdateStudio.go | 4 + service/emr/deserializers.go | 36 + service/emr/serializers.go | 25 + service/emr/types/enums.go | 18 + service/emr/types/types.go | 127 +- .../api_op_CreateApiDestination.go | 4 +- .../api_op_CreatePartnerEventSource.go | 16 +- .../eventbridge/api_op_DescribeEndpoint.go | 2 +- service/eventbridge/api_op_ListEndpoints.go | 2 +- .../api_op_ListRuleNamesByTarget.go | 3 +- service/eventbridge/api_op_ListRules.go | 6 +- .../eventbridge/api_op_ListTargetsByRule.go | 3 +- service/eventbridge/api_op_PutEvents.go | 7 + .../eventbridge/api_op_PutPartnerEvents.go | 12 +- service/eventbridge/api_op_PutRule.go | 19 +- service/eventbridge/api_op_PutTargets.go | 74 +- service/eventbridge/api_op_RemoveTargets.go | 3 +- service/eventbridge/api_op_UpdateEndpoint.go | 2 +- service/eventbridge/endpoints.go | 2 +- service/eventbridge/types/enums.go | 6 +- service/eventbridge/types/types.go | 106 +- .../internetmonitor/api_op_CreateMonitor.go | 4 +- .../internetmonitor/api_op_GetHealthEvent.go | 4 +- service/internetmonitor/api_op_GetMonitor.go | 4 +- .../internetmonitor/api_op_GetQueryResults.go | 260 + .../internetmonitor/api_op_GetQueryStatus.go | 153 + .../api_op_ListHealthEvents.go | 12 +- .../internetmonitor/api_op_ListMonitors.go | 12 +- service/internetmonitor/api_op_StartQuery.go | 180 + service/internetmonitor/api_op_StopQuery.go | 138 + .../internetmonitor/api_op_UpdateMonitor.go | 4 +- service/internetmonitor/deserializers.go | 979 ++- service/internetmonitor/endpoints.go | 2 +- service/internetmonitor/generated.json | 4 + service/internetmonitor/serializers.go | 407 +- service/internetmonitor/types/enums.go | 62 + service/internetmonitor/types/types.go | 57 +- service/internetmonitor/validators.go | 174 + service/ivs/api_op_ListChannels.go | 12 +- service/ivs/api_op_ListPlaybackKeyPairs.go | 12 +- .../ivs/api_op_ListRecordingConfigurations.go | 12 +- service/ivs/api_op_ListStreamKeys.go | 12 +- service/ivs/api_op_ListStreamSessions.go | 12 +- service/ivs/api_op_ListStreams.go | 12 +- service/ivs/deserializers.go | 2 +- service/ivs/endpoints.go | 2 +- service/ivs/serializers.go | 28 +- service/ivs/types/types.go | 2 +- service/ivschat/api_op_CreateChatToken.go | 2 +- service/ivschat/api_op_CreateRoom.go | 8 +- service/ivschat/api_op_GetRoom.go | 4 +- .../api_op_ListLoggingConfigurations.go | 12 +- service/ivschat/api_op_ListRooms.go | 12 +- service/ivschat/api_op_UpdateRoom.go | 8 +- service/ivschat/deserializers.go | 12 +- service/ivschat/endpoints.go | 2 +- service/ivschat/serializers.go | 28 +- ...pi_op_DescribeMediaStorageConfiguration.go | 6 +- .../api_op_UpdateDataRetention.go | 13 +- .../api_op_UpdateMediaStorageConfiguration.go | 12 +- service/kinesisvideo/endpoints.go | 2 +- service/kinesisvideo/types/types.go | 7 +- .../api_op_SearchPlaceIndexForPosition.go | 2 +- .../api_op_SearchPlaceIndexForText.go | 2 +- service/location/deserializers.go | 4 +- service/location/endpoints.go | 2 +- service/location/serializers.go | 8 +- service/location/types/types.go | 4 +- .../api_op_DescribeAccountConfiguration.go | 2 +- service/medialive/api_op_StartInputDevice.go | 2 +- service/medialive/api_op_StopInputDevice.go | 2 +- service/medialive/deserializers.go | 239 + service/medialive/serializers.go | 109 + service/medialive/types/enums.go | 19 + service/medialive/types/types.go | 95 +- service/medialive/validators.go | 47 + service/mgn/api_op_DescribeJobLogItems.go | 12 +- service/mgn/api_op_DescribeJobs.go | 12 +- ...op_DescribeLaunchConfigurationTemplates.go | 12 +- ...scribeReplicationConfigurationTemplates.go | 12 +- service/mgn/api_op_DescribeSourceServers.go | 12 +- service/mgn/api_op_DescribeVcenterClients.go | 12 +- service/mgn/api_op_ListApplications.go | 12 +- service/mgn/api_op_ListConnectors.go | 12 +- service/mgn/api_op_ListExportErrors.go | 12 +- service/mgn/api_op_ListExports.go | 12 +- service/mgn/api_op_ListImportErrors.go | 12 +- service/mgn/api_op_ListImports.go | 12 +- service/mgn/api_op_ListManagedAccounts.go | 12 +- service/mgn/api_op_ListSourceServerActions.go | 12 +- service/mgn/api_op_ListTemplateActions.go | 12 +- service/mgn/api_op_ListWaves.go | 12 +- service/mgn/api_op_PutSourceServerAction.go | 8 +- service/mgn/api_op_PutTemplateAction.go | 8 +- service/mgn/deserializers.go | 24 +- service/mgn/endpoints.go | 2 +- service/mgn/serializers.go | 92 +- service/mgn/types/errors.go | 2 +- service/mgn/types/types.go | 14 +- service/mgn/validators.go | 6 + service/osis/api_op_CreatePipeline.go | 7 + service/osis/api_op_UpdatePipeline.go | 7 + service/osis/deserializers.go | 191 + service/osis/endpoints.go | 2 +- service/osis/serializers.go | 52 + service/osis/types/enums.go | 16 + service/osis/types/types.go | 54 + service/osis/validators.go | 50 + service/pipes/deserializers.go | 6 +- service/pipes/serializers.go | 12 +- service/pipes/types/types.go | 6 +- service/pipes/validators.go | 3 + .../rds/api_op_CopyDBClusterParameterGroup.go | 5 +- service/rds/api_op_CopyDBParameterGroup.go | 4 +- service/rds/deserializers.go | 187 + service/rds/serializers.go | 5 + service/rds/types/types.go | 24 + service/redshift/api_op_CreateCluster.go | 4 + .../api_op_CreateRedshiftIdcApplication.go | 168 + .../api_op_DeleteRedshiftIdcApplication.go | 132 + .../api_op_DescribeRedshiftIdcApplications.go | 248 + .../api_op_ModifyRedshiftIdcApplication.go | 157 + service/redshift/deserializers.go | 1908 +++++- service/redshift/generated.json | 5 + service/redshift/serializers.go | 499 ++ service/redshift/types/enums.go | 18 + service/redshift/types/errors.go | 110 + service/redshift/types/types.go | 114 + service/redshift/types/types_exported_test.go | 44 + service/redshift/validators.go | 223 + .../api_op_CreateNamespace.go | 3 + service/redshiftserverless/serializers.go | 5 + .../internal/endpoints/endpoints.go | 3 + service/ssoadmin/deserializers.go | 82 + service/ssoadmin/serializers.go | 26 + service/ssoadmin/types/types.go | 62 +- service/ssoadmin/types/types_exported_test.go | 8 + service/ssooidc/api_op_CreateToken.go | 81 +- service/ssooidc/api_op_CreateTokenWithIAM.go | 230 + service/ssooidc/api_op_RegisterClient.go | 4 +- .../api_op_StartDeviceAuthorization.go | 4 +- service/ssooidc/auth.go | 2 +- service/ssooidc/deserializers.go | 377 ++ service/ssooidc/doc.go | 44 +- service/ssooidc/endpoints.go | 6 +- service/ssooidc/generated.json | 1 + service/ssooidc/serializers.go | 122 + service/ssooidc/types/errors.go | 32 + service/ssooidc/validators.go | 42 + service/sts/api_op_AssumeRole.go | 7 +- service/sts/endpoints.go | 4 +- service/sts/endpoints_test.go | 180 +- service/sts/types/types.go | 10 +- service/trustedadvisor/LICENSE.txt | 202 + service/trustedadvisor/api_client.go | 455 ++ service/trustedadvisor/api_client_test.go | 123 + .../api_op_GetOrganizationRecommendation.go | 138 + .../api_op_GetRecommendation.go | 137 + service/trustedadvisor/api_op_ListChecks.go | 243 + ..._ListOrganizationRecommendationAccounts.go | 247 + ...ListOrganizationRecommendationResources.go | 253 + .../api_op_ListOrganizationRecommendations.go | 261 + .../api_op_ListRecommendationResources.go | 249 + .../api_op_ListRecommendations.go | 258 + ...dateOrganizationRecommendationLifecycle.go | 145 + .../api_op_UpdateRecommendationLifecycle.go | 145 + service/trustedadvisor/auth.go | 256 + service/trustedadvisor/deserializers.go | 3663 +++++++++++ service/trustedadvisor/doc.go | 7 + service/trustedadvisor/endpoints.go | 509 ++ .../trustedadvisor/endpoints_config_test.go | 139 + service/trustedadvisor/endpoints_test.go | 856 +++ service/trustedadvisor/generated.json | 42 + service/trustedadvisor/go.mod | 17 + service/trustedadvisor/go.sum | 4 + service/trustedadvisor/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 296 + .../internal/endpoints/endpoints_test.go | 11 + service/trustedadvisor/options.go | 219 + service/trustedadvisor/protocol_test.go | 3 + service/trustedadvisor/serializers.go | 856 +++ service/trustedadvisor/types/enums.go | 238 + service/trustedadvisor/types/errors.go | 165 + service/trustedadvisor/types/types.go | 554 ++ service/trustedadvisor/validators.go | 289 + .../api_op_BatchIsAuthorized.go | 164 + service/verifiedpermissions/deserializers.go | 582 ++ service/verifiedpermissions/generated.json | 1 + service/verifiedpermissions/serializers.go | 129 + service/verifiedpermissions/types/types.go | 80 +- service/verifiedpermissions/validators.go | 100 + service/wisdom/api_op_CreateAssistant.go | 14 +- service/wisdom/api_op_CreateContent.go | 5 +- service/wisdom/api_op_CreateKnowledgeBase.go | 8 +- service/wisdom/api_op_CreateQuickResponse.go | 224 + service/wisdom/api_op_DeleteContent.go | 5 +- service/wisdom/api_op_DeleteImportJob.go | 138 + service/wisdom/api_op_DeleteQuickResponse.go | 139 + service/wisdom/api_op_GetContent.go | 5 +- service/wisdom/api_op_GetContentSummary.go | 5 +- service/wisdom/api_op_GetImportJob.go | 142 + service/wisdom/api_op_GetKnowledgeBase.go | 5 +- service/wisdom/api_op_GetQuickResponse.go | 143 + service/wisdom/api_op_ListContents.go | 5 +- service/wisdom/api_op_ListImportJobs.go | 242 + service/wisdom/api_op_ListQuickResponses.go | 243 + .../api_op_RemoveKnowledgeBaseTemplateUri.go | 5 +- service/wisdom/api_op_SearchContent.go | 5 +- service/wisdom/api_op_SearchQuickResponses.go | 251 + service/wisdom/api_op_StartContentUpload.go | 9 +- service/wisdom/api_op_StartImportJob.go | 205 + service/wisdom/api_op_UpdateContent.go | 4 +- .../api_op_UpdateKnowledgeBaseTemplateUri.go | 5 +- service/wisdom/api_op_UpdateQuickResponse.go | 188 + service/wisdom/deserializers.go | 5667 +++++++++++++---- service/wisdom/generated.json | 10 + service/wisdom/serializers.go | 1567 ++++- service/wisdom/types/enums.go | 168 +- service/wisdom/types/errors.go | 29 + service/wisdom/types/types.go | 675 +- service/wisdom/types/types_exported_test.go | 54 + service/wisdom/validators.go | 562 ++ 355 files changed, 47168 insertions(+), 3430 deletions(-) create mode 100644 .changelog/0382649a3f0f4dca894836fac1e27e20.json create mode 100644 .changelog/21845a2628474bd1aed734d74cecbf07.json create mode 100644 .changelog/2b0f85ca51eb4281ae41ca98caf3feff.json create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/43bd0dfdb219418ebce39a10eb85d448.json create mode 100644 .changelog/46b8786876f8471cbf4a12d956cabac5.json create mode 100644 .changelog/4c34b0c605d94b56b8f02aa794986ffc.json create mode 100644 .changelog/5581ba3dfa0f422bbde694754cdd5e19.json create mode 100644 .changelog/5812092b9e684c598ce9510281ab2473.json create mode 100644 .changelog/613883c687bc4a01bab94743db388839.json create mode 100644 .changelog/7349608a8af84dd5891e986c74621005.json create mode 100644 .changelog/7533f0edb760415face907ab7d664ee4.json create mode 100644 .changelog/82eafa5396374425afca8f7e2d6081f1.json create mode 100644 .changelog/923c0b8eb1534a88ae0fc48e3f5cafbe.json create mode 100644 .changelog/9660ef8a8ecb45c2ae8b14d0405109a3.json create mode 100644 .changelog/9b35722f0b394296bf5ae86bb534c833.json create mode 100644 .changelog/a1b28c8de2494063aee8f28dff1bfc88.json create mode 100644 .changelog/a294cf4c613543ebb50b79555c9747dc.json create mode 100644 .changelog/a654e00f7cf241f69def8f62ab585385.json create mode 100644 .changelog/ab2b3d85f4f44f239976c7606336e3a5.json create mode 100644 .changelog/acce893783fd440ea20062f8f39e19fd.json create mode 100644 .changelog/ae8a9c106c394c93a26ebfdb8963bbad.json create mode 100644 .changelog/b0bd854919fe40368f5518f7ee549482.json create mode 100644 .changelog/b5f10bed114649c8b603c2ecb8b33421.json create mode 100644 .changelog/b6a416288317450a92d6edc5bbf9bd27.json create mode 100644 .changelog/b8e1ec02a95f40f7814fe198d25cea68.json create mode 100644 .changelog/ba0f541676454adba5b5d4e326beed54.json create mode 100644 .changelog/e2c8f56cc7414153aa611284bd7e1ec5.json create mode 100644 .changelog/ee5d39fd907246529b02a449581344b6.json create mode 100644 .changelog/ef6c9060feee479b990e601af91cf8c7.json create mode 100644 .changelog/ef758d1922764ee1ad3013fd04a72d6f.json create mode 100644 .changelog/ffdfdb3ae63444d696fb3d9dfc485448.json create mode 100644 service/codestarconnections/api_op_CreateRepositoryLink.go create mode 100644 service/codestarconnections/api_op_CreateSyncConfiguration.go create mode 100644 service/codestarconnections/api_op_DeleteRepositoryLink.go create mode 100644 service/codestarconnections/api_op_DeleteSyncConfiguration.go create mode 100644 service/codestarconnections/api_op_GetRepositoryLink.go create mode 100644 service/codestarconnections/api_op_GetRepositorySyncStatus.go create mode 100644 service/codestarconnections/api_op_GetResourceSyncStatus.go create mode 100644 service/codestarconnections/api_op_GetSyncBlockerSummary.go create mode 100644 service/codestarconnections/api_op_GetSyncConfiguration.go create mode 100644 service/codestarconnections/api_op_ListRepositoryLinks.go create mode 100644 service/codestarconnections/api_op_ListRepositorySyncDefinitions.go create mode 100644 service/codestarconnections/api_op_ListSyncConfigurations.go create mode 100644 service/codestarconnections/api_op_UpdateRepositoryLink.go create mode 100644 service/codestarconnections/api_op_UpdateSyncBlocker.go create mode 100644 service/codestarconnections/api_op_UpdateSyncConfiguration.go create mode 100644 service/ec2/api_op_AssociateIpamByoasn.go create mode 100644 service/ec2/api_op_DeprovisionIpamByoasn.go create mode 100644 service/ec2/api_op_DescribeIpamByoasn.go create mode 100644 service/ec2/api_op_DisassociateIpamByoasn.go create mode 100644 service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go create mode 100644 service/ec2/api_op_ProvisionIpamByoasn.go create mode 100644 service/ecr/api_op_UpdatePullThroughCacheRule.go create mode 100644 service/ecr/api_op_ValidatePullThroughCacheRule.go create mode 100644 service/internetmonitor/api_op_GetQueryResults.go create mode 100644 service/internetmonitor/api_op_GetQueryStatus.go create mode 100644 service/internetmonitor/api_op_StartQuery.go create mode 100644 service/internetmonitor/api_op_StopQuery.go create mode 100644 service/redshift/api_op_CreateRedshiftIdcApplication.go create mode 100644 service/redshift/api_op_DeleteRedshiftIdcApplication.go create mode 100644 service/redshift/api_op_DescribeRedshiftIdcApplications.go create mode 100644 service/redshift/api_op_ModifyRedshiftIdcApplication.go create mode 100644 service/redshift/types/types_exported_test.go create mode 100644 service/ssooidc/api_op_CreateTokenWithIAM.go create mode 100644 service/trustedadvisor/LICENSE.txt create mode 100644 service/trustedadvisor/api_client.go create mode 100644 service/trustedadvisor/api_client_test.go create mode 100644 service/trustedadvisor/api_op_GetOrganizationRecommendation.go create mode 100644 service/trustedadvisor/api_op_GetRecommendation.go create mode 100644 service/trustedadvisor/api_op_ListChecks.go create mode 100644 service/trustedadvisor/api_op_ListOrganizationRecommendationAccounts.go create mode 100644 service/trustedadvisor/api_op_ListOrganizationRecommendationResources.go create mode 100644 service/trustedadvisor/api_op_ListOrganizationRecommendations.go create mode 100644 service/trustedadvisor/api_op_ListRecommendationResources.go create mode 100644 service/trustedadvisor/api_op_ListRecommendations.go create mode 100644 service/trustedadvisor/api_op_UpdateOrganizationRecommendationLifecycle.go create mode 100644 service/trustedadvisor/api_op_UpdateRecommendationLifecycle.go create mode 100644 service/trustedadvisor/auth.go create mode 100644 service/trustedadvisor/deserializers.go create mode 100644 service/trustedadvisor/doc.go create mode 100644 service/trustedadvisor/endpoints.go create mode 100644 service/trustedadvisor/endpoints_config_test.go create mode 100644 service/trustedadvisor/endpoints_test.go create mode 100644 service/trustedadvisor/generated.json create mode 100644 service/trustedadvisor/go.mod create mode 100644 service/trustedadvisor/go.sum create mode 100644 service/trustedadvisor/go_module_metadata.go create mode 100644 service/trustedadvisor/internal/endpoints/endpoints.go create mode 100644 service/trustedadvisor/internal/endpoints/endpoints_test.go create mode 100644 service/trustedadvisor/options.go create mode 100644 service/trustedadvisor/protocol_test.go create mode 100644 service/trustedadvisor/serializers.go create mode 100644 service/trustedadvisor/types/enums.go create mode 100644 service/trustedadvisor/types/errors.go create mode 100644 service/trustedadvisor/types/types.go create mode 100644 service/trustedadvisor/validators.go create mode 100644 service/verifiedpermissions/api_op_BatchIsAuthorized.go create mode 100644 service/wisdom/api_op_CreateQuickResponse.go create mode 100644 service/wisdom/api_op_DeleteImportJob.go create mode 100644 service/wisdom/api_op_DeleteQuickResponse.go create mode 100644 service/wisdom/api_op_GetImportJob.go create mode 100644 service/wisdom/api_op_GetQuickResponse.go create mode 100644 service/wisdom/api_op_ListImportJobs.go create mode 100644 service/wisdom/api_op_ListQuickResponses.go create mode 100644 service/wisdom/api_op_SearchQuickResponses.go create mode 100644 service/wisdom/api_op_StartImportJob.go create mode 100644 service/wisdom/api_op_UpdateQuickResponse.go diff --git a/.changelog/0382649a3f0f4dca894836fac1e27e20.json b/.changelog/0382649a3f0f4dca894836fac1e27e20.json new file mode 100644 index 00000000000..2a5ec789c9f --- /dev/null +++ b/.changelog/0382649a3f0f4dca894836fac1e27e20.json @@ -0,0 +1,8 @@ +{ + "id": "0382649a-3f0f-4dca-8948-36fac1e27e20", + "type": "feature", + "description": "This release adds a new flag ImportExistingResources to CreateChangeSet. Specify this parameter on a CREATE- or UPDATE-type change set to import existing resources with custom names instead of recreating them.", + "modules": [ + "service/cloudformation" + ] +} \ No newline at end of file diff --git a/.changelog/21845a2628474bd1aed734d74cecbf07.json b/.changelog/21845a2628474bd1aed734d74cecbf07.json new file mode 100644 index 00000000000..29c5371cb29 --- /dev/null +++ b/.changelog/21845a2628474bd1aed734d74cecbf07.json @@ -0,0 +1,8 @@ +{ + "id": "21845a26-2847-4bd1-aed7-34d74cecbf07", + "type": "feature", + "description": "Adding support for `sso-oauth:CreateTokenWithIAM`.", + "modules": [ + "service/ssooidc" + ] +} \ No newline at end of file diff --git a/.changelog/2b0f85ca51eb4281ae41ca98caf3feff.json b/.changelog/2b0f85ca51eb4281ae41ca98caf3feff.json new file mode 100644 index 00000000000..db5f7a178f4 --- /dev/null +++ b/.changelog/2b0f85ca51eb4281ae41ca98caf3feff.json @@ -0,0 +1,8 @@ +{ + "id": "2b0f85ca-51eb-4281-ae41-ca98caf3feff", + "type": "feature", + "description": "type \u0026 defaulting refinement to various range properties", + "modules": [ + "service/ivschat" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..7a3ecbc388b --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/trustedadvisor" + ] +} \ No newline at end of file diff --git a/.changelog/43bd0dfdb219418ebce39a10eb85d448.json b/.changelog/43bd0dfdb219418ebce39a10eb85d448.json new file mode 100644 index 00000000000..9586d1fb6a1 --- /dev/null +++ b/.changelog/43bd0dfdb219418ebce39a10eb85d448.json @@ -0,0 +1,8 @@ +{ + "id": "43bd0dfd-b219-418e-bce3-9a10eb85d448", + "type": "feature", + "description": "This release adds WISDOM_QUICK_RESPONSES as new IntegrationType of Connect IntegrationAssociation resource and bug fixes.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/46b8786876f8471cbf4a12d956cabac5.json b/.changelog/46b8786876f8471cbf4a12d956cabac5.json new file mode 100644 index 00000000000..ff4510e656a --- /dev/null +++ b/.changelog/46b8786876f8471cbf4a12d956cabac5.json @@ -0,0 +1,8 @@ +{ + "id": "46b87868-76f8-471c-bf4a-12d956cabac5", + "type": "feature", + "description": "TargetParameters now properly supports BatchJobParameters.ArrayProperties.Size and BatchJobParameters.RetryStrategy.Attempts being optional, and EcsTaskParameters.Overrides.EphemeralStorage.SizeInGiB now properly required when setting EphemeralStorage", + "modules": [ + "service/pipes" + ] +} \ No newline at end of file diff --git a/.changelog/4c34b0c605d94b56b8f02aa794986ffc.json b/.changelog/4c34b0c605d94b56b8f02aa794986ffc.json new file mode 100644 index 00000000000..78d64614e4b --- /dev/null +++ b/.changelog/4c34b0c605d94b56b8f02aa794986ffc.json @@ -0,0 +1,8 @@ +{ + "id": "4c34b0c6-05d9-4b56-b8f0-2aa794986ffc", + "type": "feature", + "description": "Removes all default 0 values for numbers and false values for booleans", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/5581ba3dfa0f422bbde694754cdd5e19.json b/.changelog/5581ba3dfa0f422bbde694754cdd5e19.json new file mode 100644 index 00000000000..db1f9d7636d --- /dev/null +++ b/.changelog/5581ba3dfa0f422bbde694754cdd5e19.json @@ -0,0 +1,8 @@ +{ + "id": "5581ba3d-fa0f-422b-bde6-94754cdd5e19", + "type": "feature", + "description": "Adding SerivicePreProcessing time metric", + "modules": [ + "service/athena" + ] +} \ No newline at end of file diff --git a/.changelog/5812092b9e684c598ce9510281ab2473.json b/.changelog/5812092b9e684c598ce9510281ab2473.json new file mode 100644 index 00000000000..97bd2c9730f --- /dev/null +++ b/.changelog/5812092b9e684c598ce9510281ab2473.json @@ -0,0 +1,8 @@ +{ + "id": "5812092b-9e68-4c59-8ce9-510281ab2473", + "type": "feature", + "description": "Improves support for configuring RefreshToken and TokenExchange grants on applications.", + "modules": [ + "service/ssoadmin" + ] +} \ No newline at end of file diff --git a/.changelog/613883c687bc4a01bab94743db388839.json b/.changelog/613883c687bc4a01bab94743db388839.json new file mode 100644 index 00000000000..ca28ac86e14 --- /dev/null +++ b/.changelog/613883c687bc4a01bab94743db388839.json @@ -0,0 +1,8 @@ +{ + "id": "613883c6-87bc-4a01-bab9-4743db388839", + "type": "feature", + "description": "This release adds new features for Amazon VPC IP Address Manager (IPAM) Allowing a choice between Free and Advanced Tiers, viewing public IP address insights across regions and in Amazon Cloudwatch, use IPAM to plan your subnet IPs within a VPC and bring your own autonomous system number to IPAM.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/7349608a8af84dd5891e986c74621005.json b/.changelog/7349608a8af84dd5891e986c74621005.json new file mode 100644 index 00000000000..a58668494e2 --- /dev/null +++ b/.changelog/7349608a8af84dd5891e986c74621005.json @@ -0,0 +1,8 @@ +{ + "id": "7349608a-8af8-4dd5-891e-986c74621005", + "type": "feature", + "description": "This release adds support for the CloudFormation Git sync feature. Git sync enables updating a CloudFormation stack from a template stored in a Git repository.", + "modules": [ + "service/codestarconnections" + ] +} \ No newline at end of file diff --git a/.changelog/7533f0edb760415face907ab7d664ee4.json b/.changelog/7533f0edb760415face907ab7d664ee4.json new file mode 100644 index 00000000000..e2df9f57b25 --- /dev/null +++ b/.changelog/7533f0edb760415face907ab7d664ee4.json @@ -0,0 +1,8 @@ +{ + "id": "7533f0ed-b760-415f-ace9-07ab7d664ee4", + "type": "documentation", + "description": "Docs only build to bring up-to-date with public docs.", + "modules": [ + "service/kinesisvideo" + ] +} \ No newline at end of file diff --git a/.changelog/82eafa5396374425afca8f7e2d6081f1.json b/.changelog/82eafa5396374425afca8f7e2d6081f1.json new file mode 100644 index 00000000000..c2d43196b48 --- /dev/null +++ b/.changelog/82eafa5396374425afca8f7e2d6081f1.json @@ -0,0 +1,8 @@ +{ + "id": "82eafa53-9637-4425-afca-8f7e2d6081f1", + "type": "feature", + "description": "Updated SDK for Amazon Redshift, which you can use to configure a connection with IAM Identity Center to manage access to databases. With these, you can create a connection through a managed application. You can also change a managed application, delete it, or get information about an existing one.", + "modules": [ + "service/redshift" + ] +} \ No newline at end of file diff --git a/.changelog/923c0b8eb1534a88ae0fc48e3f5cafbe.json b/.changelog/923c0b8eb1534a88ae0fc48e3f5cafbe.json new file mode 100644 index 00000000000..c8ccfdc9e19 --- /dev/null +++ b/.changelog/923c0b8eb1534a88ae0fc48e3f5cafbe.json @@ -0,0 +1,8 @@ +{ + "id": "923c0b8e-b153-4a88-ae0f-c48e3f5cafbe", + "type": "documentation", + "description": "A minor doc only update related to changing the date of an API change.", + "modules": [ + "service/cloud9" + ] +} \ No newline at end of file diff --git a/.changelog/9660ef8a8ecb45c2ae8b14d0405109a3.json b/.changelog/9660ef8a8ecb45c2ae8b14d0405109a3.json new file mode 100644 index 00000000000..59b9c7f876f --- /dev/null +++ b/.changelog/9660ef8a8ecb45c2ae8b14d0405109a3.json @@ -0,0 +1,8 @@ +{ + "id": "9660ef8a-8ecb-45c2-ae8b-14d0405109a3", + "type": "feature", + "description": "Documentation and operational updates for Amazon ECR, adding support for pull through cache rules for upstream registries that require authentication.", + "modules": [ + "service/ecr" + ] +} \ No newline at end of file diff --git a/.changelog/9b35722f0b394296bf5ae86bb534c833.json b/.changelog/9b35722f0b394296bf5ae86bb534c833.json new file mode 100644 index 00000000000..887d6ef0da6 --- /dev/null +++ b/.changelog/9b35722f0b394296bf5ae86bb534c833.json @@ -0,0 +1,8 @@ +{ + "id": "9b35722f-0b39-4296-bf5a-e86bb534c833", + "type": "feature", + "description": "Change the default value of these fields from 0 to null: MaxConnections, MaxPendingRequests, MaxRequests, HealthCheckThreshold, PortNumber, and HealthCheckPolicy -\u003e port. Users are not expected to perceive the change, except that badRequestException is thrown when required fields missing configured.", + "modules": [ + "service/appmesh" + ] +} \ No newline at end of file diff --git a/.changelog/a1b28c8de2494063aee8f28dff1bfc88.json b/.changelog/a1b28c8de2494063aee8f28dff1bfc88.json new file mode 100644 index 00000000000..85e6aa35fec --- /dev/null +++ b/.changelog/a1b28c8de2494063aee8f28dff1bfc88.json @@ -0,0 +1,8 @@ +{ + "id": "a1b28c8d-e249-4063-aee8-f28dff1bfc88", + "type": "feature", + "description": "CodePipeline now supports overriding source revisions to achieve manual re-deploy of a past revision", + "modules": [ + "service/codepipeline" + ] +} \ No newline at end of file diff --git a/.changelog/a294cf4c613543ebb50b79555c9747dc.json b/.changelog/a294cf4c613543ebb50b79555c9747dc.json new file mode 100644 index 00000000000..d3602056a4b --- /dev/null +++ b/.changelog/a294cf4c613543ebb50b79555c9747dc.json @@ -0,0 +1,8 @@ +{ + "id": "a294cf4c-6135-43eb-b50b-79555c9747dc", + "type": "feature", + "description": "MediaLive has now added support for per-output static image overlay.", + "modules": [ + "service/medialive" + ] +} \ No newline at end of file diff --git a/.changelog/a654e00f7cf241f69def8f62ab585385.json b/.changelog/a654e00f7cf241f69def8f62ab585385.json new file mode 100644 index 00000000000..578cc0c9173 --- /dev/null +++ b/.changelog/a654e00f7cf241f69def8f62ab585385.json @@ -0,0 +1,8 @@ +{ + "id": "a654e00f-7cf2-41f6-9def-8f62ab585385", + "type": "feature", + "description": "Introduces a new rule state ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS for matching with Get, List and Describe AWS API call events from CloudTrail.", + "modules": [ + "service/eventbridge" + ] +} \ No newline at end of file diff --git a/.changelog/ab2b3d85f4f44f239976c7606336e3a5.json b/.changelog/ab2b3d85f4f44f239976c7606336e3a5.json new file mode 100644 index 00000000000..33c3c15b490 --- /dev/null +++ b/.changelog/ab2b3d85f4f44f239976c7606336e3a5.json @@ -0,0 +1,8 @@ +{ + "id": "ab2b3d85-f4f4-4f23-9976-c7606336e3a5", + "type": "feature", + "description": "Remove default value and allow nullable for request parameters having minimum value larger than zero.", + "modules": [ + "service/location" + ] +} \ No newline at end of file diff --git a/.changelog/acce893783fd440ea20062f8f39e19fd.json b/.changelog/acce893783fd440ea20062f8f39e19fd.json new file mode 100644 index 00000000000..fb38ca568ea --- /dev/null +++ b/.changelog/acce893783fd440ea20062f8f39e19fd.json @@ -0,0 +1,8 @@ +{ + "id": "acce8937-83fd-440e-a200-62f8f39e19fd", + "type": "feature", + "description": "Launch support for IAM Identity Center Trusted Identity Propagation and workspace storage encryption using AWS KMS in EMR Studio", + "modules": [ + "service/emr" + ] +} \ No newline at end of file diff --git a/.changelog/ae8a9c106c394c93a26ebfdb8963bbad.json b/.changelog/ae8a9c106c394c93a26ebfdb8963bbad.json new file mode 100644 index 00000000000..057979b0cd2 --- /dev/null +++ b/.changelog/ae8a9c106c394c93a26ebfdb8963bbad.json @@ -0,0 +1,8 @@ +{ + "id": "ae8a9c10-6c39-4c93-a26e-bfdb8963bbad", + "type": "feature", + "description": "This release adds QuickResponse as a new Wisdom resource and Wisdom APIs for import, create, read, search, update and delete QuickResponse resources.", + "modules": [ + "service/wisdom" + ] +} \ No newline at end of file diff --git a/.changelog/b0bd854919fe40368f5518f7ee549482.json b/.changelog/b0bd854919fe40368f5518f7ee549482.json new file mode 100644 index 00000000000..9e1024bf98e --- /dev/null +++ b/.changelog/b0bd854919fe40368f5518f7ee549482.json @@ -0,0 +1,8 @@ +{ + "id": "b0bd8549-19fe-4036-8f55-18f7ee549482", + "type": "feature", + "description": "type \u0026 defaulting refinement to various range properties", + "modules": [ + "service/ivs" + ] +} \ No newline at end of file diff --git a/.changelog/b5f10bed114649c8b603c2ecb8b33421.json b/.changelog/b5f10bed114649c8b603c2ecb8b33421.json new file mode 100644 index 00000000000..7505e2c3805 --- /dev/null +++ b/.changelog/b5f10bed114649c8b603c2ecb8b33421.json @@ -0,0 +1,8 @@ +{ + "id": "b5f10bed-1146-49c8-b603-c2ecb8b33421", + "type": "feature", + "description": "Updated SDK for Amazon Redshift Serverless, which provides the ability to configure a connection with IAM Identity Center to manage user and group access to databases.", + "modules": [ + "service/redshiftserverless" + ] +} \ No newline at end of file diff --git a/.changelog/b6a416288317450a92d6edc5bbf9bd27.json b/.changelog/b6a416288317450a92d6edc5bbf9bd27.json new file mode 100644 index 00000000000..376140b04e8 --- /dev/null +++ b/.changelog/b6a416288317450a92d6edc5bbf9bd27.json @@ -0,0 +1,8 @@ +{ + "id": "b6a41628-8317-450a-92d6-edc5bbf9bd27", + "type": "feature", + "description": "Adding BatchIsAuthorized API which supports multiple authorization requests against a PolicyStore", + "modules": [ + "service/verifiedpermissions" + ] +} \ No newline at end of file diff --git a/.changelog/b8e1ec02a95f40f7814fe198d25cea68.json b/.changelog/b8e1ec02a95f40f7814fe198d25cea68.json new file mode 100644 index 00000000000..c6992384132 --- /dev/null +++ b/.changelog/b8e1ec02a95f40f7814fe198d25cea68.json @@ -0,0 +1,8 @@ +{ + "id": "b8e1ec02-a95f-40f7-814f-e198d25cea68", + "type": "feature", + "description": "Add support for enabling a persistent buffer when creating or updating an OpenSearch Ingestion pipeline. Add tags to Pipeline and PipelineSummary response models.", + "modules": [ + "service/osis" + ] +} \ No newline at end of file diff --git a/.changelog/ba0f541676454adba5b5d4e326beed54.json b/.changelog/ba0f541676454adba5b5d4e326beed54.json new file mode 100644 index 00000000000..0fb4839cc31 --- /dev/null +++ b/.changelog/ba0f541676454adba5b5d4e326beed54.json @@ -0,0 +1,8 @@ +{ + "id": "ba0f5416-7645-4adb-a5b5-d4e326beed54", + "type": "feature", + "description": "Removed invalid and unnecessary default values.", + "modules": [ + "service/mgn" + ] +} \ No newline at end of file diff --git a/.changelog/e2c8f56cc7414153aa611284bd7e1ec5.json b/.changelog/e2c8f56cc7414153aa611284bd7e1ec5.json new file mode 100644 index 00000000000..570b0fe08f7 --- /dev/null +++ b/.changelog/e2c8f56cc7414153aa611284bd7e1ec5.json @@ -0,0 +1,8 @@ +{ + "id": "e2c8f56c-c741-4153-aa61-1284bd7e1ec5", + "type": "feature", + "description": "AWS Trusted Advisor introduces new APIs to enable you to programmatically access Trusted Advisor best practice checks, recommendations, and prioritized recommendations. Trusted Advisor APIs enable you to integrate Trusted Advisor with your operational tools to automate your workloads.", + "modules": [ + "service/trustedadvisor" + ] +} \ No newline at end of file diff --git a/.changelog/ee5d39fd907246529b02a449581344b6.json b/.changelog/ee5d39fd907246529b02a449581344b6.json new file mode 100644 index 00000000000..5c75c699f26 --- /dev/null +++ b/.changelog/ee5d39fd907246529b02a449581344b6.json @@ -0,0 +1,8 @@ +{ + "id": "ee5d39fd-9072-4652-9b02-a449581344b6", + "type": "feature", + "description": "This release adds support for option groups and replica enhancements to Amazon RDS Custom.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/.changelog/ef6c9060feee479b990e601af91cf8c7.json b/.changelog/ef6c9060feee479b990e601af91cf8c7.json new file mode 100644 index 00000000000..175beda19d7 --- /dev/null +++ b/.changelog/ef6c9060feee479b990e601af91cf8c7.json @@ -0,0 +1,8 @@ +{ + "id": "ef6c9060-feee-479b-990e-601af91cf8c7", + "type": "documentation", + "description": "API updates for the AWS Security Token Service", + "modules": [ + "service/sts" + ] +} \ No newline at end of file diff --git a/.changelog/ef758d1922764ee1ad3013fd04a72d6f.json b/.changelog/ef758d1922764ee1ad3013fd04a72d6f.json new file mode 100644 index 00000000000..ce7f208e737 --- /dev/null +++ b/.changelog/ef758d1922764ee1ad3013fd04a72d6f.json @@ -0,0 +1,8 @@ +{ + "id": "ef758d19-2276-4ee1-ad30-13fd04a72d6f", + "type": "documentation", + "description": "Added support for SAP HANA in Amazon Data Lifecycle Manager EBS snapshot lifecycle policies with pre and post scripts.", + "modules": [ + "service/dlm" + ] +} \ No newline at end of file diff --git a/.changelog/ffdfdb3ae63444d696fb3d9dfc485448.json b/.changelog/ffdfdb3ae63444d696fb3d9dfc485448.json new file mode 100644 index 00000000000..b0c71e29191 --- /dev/null +++ b/.changelog/ffdfdb3ae63444d696fb3d9dfc485448.json @@ -0,0 +1,8 @@ +{ + "id": "ffdfdb3a-e634-44d6-96fb-3d9dfc485448", + "type": "feature", + "description": "Adds new querying capabilities for running data queries on a monitor", + "modules": [ + "service/internetmonitor" + ] +} \ No newline at end of file diff --git a/service/appmesh/deserializers.go b/service/appmesh/deserializers.go index df79ce17fad..b0e3b907bf5 100644 --- a/service/appmesh/deserializers.go +++ b/service/appmesh/deserializers.go @@ -8833,7 +8833,7 @@ func awsRestjson1_deserializeDocumentHealthCheckPolicy(v **types.HealthCheckPoli if err != nil { return err } - sv.HealthyThreshold = int32(i64) + sv.HealthyThreshold = ptr.Int32(int32(i64)) } case "intervalMillis": @@ -8868,7 +8868,7 @@ func awsRestjson1_deserializeDocumentHealthCheckPolicy(v **types.HealthCheckPoli if err != nil { return err } - sv.Port = int32(i64) + sv.Port = ptr.Int32(int32(i64)) } case "protocol": @@ -8903,7 +8903,7 @@ func awsRestjson1_deserializeDocumentHealthCheckPolicy(v **types.HealthCheckPoli if err != nil { return err } - sv.UnhealthyThreshold = int32(i64) + sv.UnhealthyThreshold = ptr.Int32(int32(i64)) } default: @@ -11089,7 +11089,7 @@ func awsRestjson1_deserializeDocumentPortMapping(v **types.PortMapping, value in if err != nil { return err } - sv.Port = int32(i64) + sv.Port = ptr.Int32(int32(i64)) } case "protocol": @@ -12913,7 +12913,7 @@ func awsRestjson1_deserializeDocumentVirtualGatewayGrpcConnectionPool(v **types. if err != nil { return err } - sv.MaxRequests = int32(i64) + sv.MaxRequests = ptr.Int32(int32(i64)) } default: @@ -12957,7 +12957,7 @@ func awsRestjson1_deserializeDocumentVirtualGatewayHealthCheckPolicy(v **types.V if err != nil { return err } - sv.HealthyThreshold = int32(i64) + sv.HealthyThreshold = ptr.Int32(int32(i64)) } case "intervalMillis": @@ -12992,7 +12992,7 @@ func awsRestjson1_deserializeDocumentVirtualGatewayHealthCheckPolicy(v **types.V if err != nil { return err } - sv.Port = int32(i64) + sv.Port = ptr.Int32(int32(i64)) } case "protocol": @@ -13027,7 +13027,7 @@ func awsRestjson1_deserializeDocumentVirtualGatewayHealthCheckPolicy(v **types.V if err != nil { return err } - sv.UnhealthyThreshold = int32(i64) + sv.UnhealthyThreshold = ptr.Int32(int32(i64)) } default: @@ -13071,7 +13071,7 @@ func awsRestjson1_deserializeDocumentVirtualGatewayHttp2ConnectionPool(v **types if err != nil { return err } - sv.MaxRequests = int32(i64) + sv.MaxRequests = ptr.Int32(int32(i64)) } default: @@ -13115,7 +13115,7 @@ func awsRestjson1_deserializeDocumentVirtualGatewayHttpConnectionPool(v **types. if err != nil { return err } - sv.MaxConnections = int32(i64) + sv.MaxConnections = ptr.Int32(int32(i64)) } case "maxPendingRequests": @@ -13657,7 +13657,7 @@ func awsRestjson1_deserializeDocumentVirtualGatewayPortMapping(v **types.Virtual if err != nil { return err } - sv.Port = int32(i64) + sv.Port = ptr.Int32(int32(i64)) } case "protocol": @@ -14268,7 +14268,7 @@ func awsRestjson1_deserializeDocumentVirtualNodeGrpcConnectionPool(v **types.Vir if err != nil { return err } - sv.MaxRequests = int32(i64) + sv.MaxRequests = ptr.Int32(int32(i64)) } default: @@ -14312,7 +14312,7 @@ func awsRestjson1_deserializeDocumentVirtualNodeHttp2ConnectionPool(v **types.Vi if err != nil { return err } - sv.MaxRequests = int32(i64) + sv.MaxRequests = ptr.Int32(int32(i64)) } default: @@ -14356,7 +14356,7 @@ func awsRestjson1_deserializeDocumentVirtualNodeHttpConnectionPool(v **types.Vir if err != nil { return err } - sv.MaxConnections = int32(i64) + sv.MaxConnections = ptr.Int32(int32(i64)) } case "maxPendingRequests": @@ -14704,7 +14704,7 @@ func awsRestjson1_deserializeDocumentVirtualNodeTcpConnectionPool(v **types.Virt if err != nil { return err } - sv.MaxConnections = int32(i64) + sv.MaxConnections = ptr.Int32(int32(i64)) } default: diff --git a/service/appmesh/endpoints.go b/service/appmesh/endpoints.go index 96d7372859d..8ce49216bd5 100644 --- a/service/appmesh/endpoints.go +++ b/service/appmesh/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://appmesh-fips.") diff --git a/service/appmesh/serializers.go b/service/appmesh/serializers.go index 4e9a6c5f8a7..e58e04644c5 100644 --- a/service/appmesh/serializers.go +++ b/service/appmesh/serializers.go @@ -4228,9 +4228,9 @@ func awsRestjson1_serializeDocumentHealthCheckPolicy(v *types.HealthCheckPolicy, object := value.Object() defer object.Close() - { + if v.HealthyThreshold != nil { ok := object.Key("healthyThreshold") - ok.Integer(v.HealthyThreshold) + ok.Integer(*v.HealthyThreshold) } if v.IntervalMillis != nil { @@ -4243,9 +4243,9 @@ func awsRestjson1_serializeDocumentHealthCheckPolicy(v *types.HealthCheckPolicy, ok.String(*v.Path) } - if v.Port != 0 { + if v.Port != nil { ok := object.Key("port") - ok.Integer(v.Port) + ok.Integer(*v.Port) } if len(v.Protocol) > 0 { @@ -4258,9 +4258,9 @@ func awsRestjson1_serializeDocumentHealthCheckPolicy(v *types.HealthCheckPolicy, ok.Long(*v.TimeoutMillis) } - { + if v.UnhealthyThreshold != nil { ok := object.Key("unhealthyThreshold") - ok.Integer(v.UnhealthyThreshold) + ok.Integer(*v.UnhealthyThreshold) } return nil @@ -5091,9 +5091,9 @@ func awsRestjson1_serializeDocumentPortMapping(v *types.PortMapping, value smith object := value.Object() defer object.Close() - { + if v.Port != nil { ok := object.Key("port") - ok.Integer(v.Port) + ok.Integer(*v.Port) } if len(v.Protocol) > 0 { @@ -5606,9 +5606,9 @@ func awsRestjson1_serializeDocumentVirtualGatewayGrpcConnectionPool(v *types.Vir object := value.Object() defer object.Close() - { + if v.MaxRequests != nil { ok := object.Key("maxRequests") - ok.Integer(v.MaxRequests) + ok.Integer(*v.MaxRequests) } return nil @@ -5618,9 +5618,9 @@ func awsRestjson1_serializeDocumentVirtualGatewayHealthCheckPolicy(v *types.Virt object := value.Object() defer object.Close() - { + if v.HealthyThreshold != nil { ok := object.Key("healthyThreshold") - ok.Integer(v.HealthyThreshold) + ok.Integer(*v.HealthyThreshold) } if v.IntervalMillis != nil { @@ -5633,9 +5633,9 @@ func awsRestjson1_serializeDocumentVirtualGatewayHealthCheckPolicy(v *types.Virt ok.String(*v.Path) } - if v.Port != 0 { + if v.Port != nil { ok := object.Key("port") - ok.Integer(v.Port) + ok.Integer(*v.Port) } if len(v.Protocol) > 0 { @@ -5648,9 +5648,9 @@ func awsRestjson1_serializeDocumentVirtualGatewayHealthCheckPolicy(v *types.Virt ok.Long(*v.TimeoutMillis) } - { + if v.UnhealthyThreshold != nil { ok := object.Key("unhealthyThreshold") - ok.Integer(v.UnhealthyThreshold) + ok.Integer(*v.UnhealthyThreshold) } return nil @@ -5660,9 +5660,9 @@ func awsRestjson1_serializeDocumentVirtualGatewayHttp2ConnectionPool(v *types.Vi object := value.Object() defer object.Close() - { + if v.MaxRequests != nil { ok := object.Key("maxRequests") - ok.Integer(v.MaxRequests) + ok.Integer(*v.MaxRequests) } return nil @@ -5672,9 +5672,9 @@ func awsRestjson1_serializeDocumentVirtualGatewayHttpConnectionPool(v *types.Vir object := value.Object() defer object.Close() - { + if v.MaxConnections != nil { ok := object.Key("maxConnections") - ok.Integer(v.MaxConnections) + ok.Integer(*v.MaxConnections) } if v.MaxPendingRequests != nil { @@ -5893,9 +5893,9 @@ func awsRestjson1_serializeDocumentVirtualGatewayPortMapping(v *types.VirtualGat object := value.Object() defer object.Close() - { + if v.Port != nil { ok := object.Key("port") - ok.Integer(v.Port) + ok.Integer(*v.Port) } if len(v.Protocol) > 0 { @@ -6063,9 +6063,9 @@ func awsRestjson1_serializeDocumentVirtualNodeGrpcConnectionPool(v *types.Virtua object := value.Object() defer object.Close() - { + if v.MaxRequests != nil { ok := object.Key("maxRequests") - ok.Integer(v.MaxRequests) + ok.Integer(*v.MaxRequests) } return nil @@ -6075,9 +6075,9 @@ func awsRestjson1_serializeDocumentVirtualNodeHttp2ConnectionPool(v *types.Virtu object := value.Object() defer object.Close() - { + if v.MaxRequests != nil { ok := object.Key("maxRequests") - ok.Integer(v.MaxRequests) + ok.Integer(*v.MaxRequests) } return nil @@ -6087,9 +6087,9 @@ func awsRestjson1_serializeDocumentVirtualNodeHttpConnectionPool(v *types.Virtua object := value.Object() defer object.Close() - { + if v.MaxConnections != nil { ok := object.Key("maxConnections") - ok.Integer(v.MaxConnections) + ok.Integer(*v.MaxConnections) } if v.MaxPendingRequests != nil { @@ -6158,9 +6158,9 @@ func awsRestjson1_serializeDocumentVirtualNodeTcpConnectionPool(v *types.Virtual object := value.Object() defer object.Close() - { + if v.MaxConnections != nil { ok := object.Key("maxConnections") - ok.Integer(v.MaxConnections) + ok.Integer(*v.MaxConnections) } return nil diff --git a/service/appmesh/types/types.go b/service/appmesh/types/types.go index 449d7f9a061..f6ab1db4a0c 100644 --- a/service/appmesh/types/types.go +++ b/service/appmesh/types/types.go @@ -443,7 +443,7 @@ type GrpcGatewayRouteMatch struct { // The gateway route metadata to be matched on. Metadata []GrpcGatewayRouteMetadata - // The port number to match from the request. + // The gateway route port to be matched on. Port *int32 // The fully qualified domain name for the service to match from the request. @@ -789,7 +789,7 @@ type HealthCheckPolicy struct { // declaring listener healthy. // // This member is required. - HealthyThreshold int32 + HealthyThreshold *int32 // The time period in milliseconds between each health check execution. // @@ -813,7 +813,7 @@ type HealthCheckPolicy struct { // a virtual node unhealthy. // // This member is required. - UnhealthyThreshold int32 + UnhealthyThreshold *int32 // The destination path for the health check request. This value is only used if // the specified protocol is HTTP or HTTP/2. For any other protocol, this value is @@ -822,7 +822,7 @@ type HealthCheckPolicy struct { // The destination port for the health check request. This port must match the // port defined in the PortMapping for the listener. - Port int32 + Port *int32 noSmithyDocumentSerde } @@ -1553,7 +1553,7 @@ type PortMapping struct { // The port used for the port mapping. // // This member is required. - Port int32 + Port *int32 // The protocol used for the port mapping. Specify one protocol. // @@ -2167,7 +2167,7 @@ type VirtualGatewayGrpcConnectionPool struct { // in upstream cluster. // // This member is required. - MaxRequests int32 + MaxRequests *int32 noSmithyDocumentSerde } @@ -2180,7 +2180,7 @@ type VirtualGatewayHealthCheckPolicy struct { // declaring the listener healthy. // // This member is required. - HealthyThreshold int32 + HealthyThreshold *int32 // The time period in milliseconds between each health check execution. // @@ -2204,7 +2204,7 @@ type VirtualGatewayHealthCheckPolicy struct { // a virtual gateway unhealthy. // // This member is required. - UnhealthyThreshold int32 + UnhealthyThreshold *int32 // The destination path for the health check request. This value is only used if // the specified protocol is HTTP or HTTP/2. For any other protocol, this value is @@ -2213,7 +2213,7 @@ type VirtualGatewayHealthCheckPolicy struct { // The destination port for the health check request. This port must match the // port defined in the PortMapping for the listener. - Port int32 + Port *int32 noSmithyDocumentSerde } @@ -2225,7 +2225,7 @@ type VirtualGatewayHttp2ConnectionPool struct { // in upstream cluster. // // This member is required. - MaxRequests int32 + MaxRequests *int32 noSmithyDocumentSerde } @@ -2237,7 +2237,7 @@ type VirtualGatewayHttpConnectionPool struct { // with all hosts in upstream cluster. // // This member is required. - MaxConnections int32 + MaxConnections *int32 // Number of overflowing requests after max_connections Envoy will queue to // upstream cluster. @@ -2447,7 +2447,7 @@ type VirtualGatewayPortMapping struct { // The port used for the port mapping. Specify one protocol. // // This member is required. - Port int32 + Port *int32 // The protocol used for the port mapping. // @@ -2733,7 +2733,7 @@ type VirtualNodeGrpcConnectionPool struct { // in upstream cluster. // // This member is required. - MaxRequests int32 + MaxRequests *int32 noSmithyDocumentSerde } @@ -2745,7 +2745,7 @@ type VirtualNodeHttp2ConnectionPool struct { // in upstream cluster. // // This member is required. - MaxRequests int32 + MaxRequests *int32 noSmithyDocumentSerde } @@ -2757,7 +2757,7 @@ type VirtualNodeHttpConnectionPool struct { // with all hosts in upstream cluster. // // This member is required. - MaxConnections int32 + MaxConnections *int32 // Number of overflowing requests after max_connections Envoy will queue to // upstream cluster. @@ -2874,7 +2874,7 @@ type VirtualNodeTcpConnectionPool struct { // with all hosts in upstream cluster. // // This member is required. - MaxConnections int32 + MaxConnections *int32 noSmithyDocumentSerde } diff --git a/service/appmesh/validators.go b/service/appmesh/validators.go index 570b4132b53..45f632010ef 100644 --- a/service/appmesh/validators.go +++ b/service/appmesh/validators.go @@ -1496,6 +1496,12 @@ func validateHealthCheckPolicy(v *types.HealthCheckPolicy) error { if len(v.Protocol) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Protocol")) } + if v.HealthyThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("HealthyThreshold")) + } + if v.UnhealthyThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("UnhealthyThreshold")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2109,6 +2115,9 @@ func validatePortMapping(v *types.PortMapping) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "PortMapping"} + if v.Port == nil { + invalidParams.Add(smithy.NewErrParamRequired("Port")) + } if len(v.Protocol) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Protocol")) } @@ -2535,6 +2544,9 @@ func validateVirtualGatewayGrpcConnectionPool(v *types.VirtualGatewayGrpcConnect return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualGatewayGrpcConnectionPool"} + if v.MaxRequests == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxRequests")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2556,6 +2568,12 @@ func validateVirtualGatewayHealthCheckPolicy(v *types.VirtualGatewayHealthCheckP if len(v.Protocol) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Protocol")) } + if v.HealthyThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("HealthyThreshold")) + } + if v.UnhealthyThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("UnhealthyThreshold")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2568,6 +2586,9 @@ func validateVirtualGatewayHttp2ConnectionPool(v *types.VirtualGatewayHttp2Conne return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualGatewayHttp2ConnectionPool"} + if v.MaxRequests == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxRequests")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2580,6 +2601,9 @@ func validateVirtualGatewayHttpConnectionPool(v *types.VirtualGatewayHttpConnect return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualGatewayHttpConnectionPool"} + if v.MaxConnections == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxConnections")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2812,6 +2836,9 @@ func validateVirtualGatewayPortMapping(v *types.VirtualGatewayPortMapping) error return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualGatewayPortMapping"} + if v.Port == nil { + invalidParams.Add(smithy.NewErrParamRequired("Port")) + } if len(v.Protocol) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Protocol")) } @@ -2988,6 +3015,9 @@ func validateVirtualNodeGrpcConnectionPool(v *types.VirtualNodeGrpcConnectionPoo return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualNodeGrpcConnectionPool"} + if v.MaxRequests == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxRequests")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3000,6 +3030,9 @@ func validateVirtualNodeHttp2ConnectionPool(v *types.VirtualNodeHttp2ConnectionP return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualNodeHttp2ConnectionPool"} + if v.MaxRequests == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxRequests")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3012,6 +3045,9 @@ func validateVirtualNodeHttpConnectionPool(v *types.VirtualNodeHttpConnectionPoo return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualNodeHttpConnectionPool"} + if v.MaxConnections == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxConnections")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3076,6 +3112,9 @@ func validateVirtualNodeTcpConnectionPool(v *types.VirtualNodeTcpConnectionPool) return nil } invalidParams := smithy.InvalidParamsError{Context: "VirtualNodeTcpConnectionPool"} + if v.MaxConnections == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxConnections")) + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/athena/api_op_CreateDataCatalog.go b/service/athena/api_op_CreateDataCatalog.go index ca34269fc97..9e5e77594d3 100644 --- a/service/athena/api_op_CreateDataCatalog.go +++ b/service/athena/api_op_CreateDataCatalog.go @@ -69,10 +69,6 @@ type CreateDataCatalogInput struct { // - The GLUE data catalog type also applies to the default AwsDataCatalog that // already exists in your account, of which you can have only one and cannot // modify. - // - Queries that specify a Glue Data Catalog other than the default - // AwsDataCatalog must be run on Athena engine version 2. - // - In Regions where Athena engine version 2 is not available, creating new - // Glue data catalogs results in an INVALID_INPUT error. Parameters map[string]string // A list of comma separated tags to add to the data catalog that is created. diff --git a/service/athena/api_op_CreateNamedQuery.go b/service/athena/api_op_CreateNamedQuery.go index 5c55c7259a0..a9cc3e3d506 100644 --- a/service/athena/api_op_CreateNamedQuery.go +++ b/service/athena/api_op_CreateNamedQuery.go @@ -12,9 +12,7 @@ import ( ) // Creates a named query in the specified workgroup. Requires that you have access -// to the workgroup. For code samples using the Amazon Web Services SDK for Java, -// see Examples and Code Samples (http://docs.aws.amazon.com/athena/latest/ug/code-samples.html) -// in the Amazon Athena User Guide. +// to the workgroup. func (c *Client) CreateNamedQuery(ctx context.Context, params *CreateNamedQueryInput, optFns ...func(*Options)) (*CreateNamedQueryOutput, error) { if params == nil { params = &CreateNamedQueryInput{} diff --git a/service/athena/api_op_DeleteNamedQuery.go b/service/athena/api_op_DeleteNamedQuery.go index 720f406b4c2..2ffef06a487 100644 --- a/service/athena/api_op_DeleteNamedQuery.go +++ b/service/athena/api_op_DeleteNamedQuery.go @@ -12,9 +12,7 @@ import ( ) // Deletes the named query if you have access to the workgroup in which the query -// was saved. For code samples using the Amazon Web Services SDK for Java, see -// Examples and Code Samples (http://docs.aws.amazon.com/athena/latest/ug/code-samples.html) -// in the Amazon Athena User Guide. +// was saved. func (c *Client) DeleteNamedQuery(ctx context.Context, params *DeleteNamedQueryInput, optFns ...func(*Options)) (*DeleteNamedQueryOutput, error) { if params == nil { params = &DeleteNamedQueryInput{} diff --git a/service/athena/api_op_ListNamedQueries.go b/service/athena/api_op_ListNamedQueries.go index 2f50516c160..91453bc36d0 100644 --- a/service/athena/api_op_ListNamedQueries.go +++ b/service/athena/api_op_ListNamedQueries.go @@ -14,9 +14,6 @@ import ( // Provides a list of available query IDs only for queries saved in the specified // workgroup. Requires that you have access to the specified workgroup. If a // workgroup is not specified, lists the saved queries for the primary workgroup. -// For code samples using the Amazon Web Services SDK for Java, see Examples and -// Code Samples (http://docs.aws.amazon.com/athena/latest/ug/code-samples.html) in -// the Amazon Athena User Guide. func (c *Client) ListNamedQueries(ctx context.Context, params *ListNamedQueriesInput, optFns ...func(*Options)) (*ListNamedQueriesOutput, error) { if params == nil { params = &ListNamedQueriesInput{} diff --git a/service/athena/api_op_ListQueryExecutions.go b/service/athena/api_op_ListQueryExecutions.go index 116d443f2e1..e382455efb6 100644 --- a/service/athena/api_op_ListQueryExecutions.go +++ b/service/athena/api_op_ListQueryExecutions.go @@ -12,11 +12,9 @@ import ( ) // Provides a list of available query execution IDs for the queries in the -// specified workgroup. If a workgroup is not specified, returns a list of query -// execution IDs for the primary workgroup. Requires you to have access to the -// workgroup in which the queries ran. For code samples using the Amazon Web -// Services SDK for Java, see Examples and Code Samples (http://docs.aws.amazon.com/athena/latest/ug/code-samples.html) -// in the Amazon Athena User Guide. +// specified workgroup. Athena keeps a query history for 45 days. If a workgroup is +// not specified, returns a list of query execution IDs for the primary workgroup. +// Requires you to have access to the workgroup in which the queries ran. func (c *Client) ListQueryExecutions(ctx context.Context, params *ListQueryExecutionsInput, optFns ...func(*Options)) (*ListQueryExecutionsOutput, error) { if params == nil { params = &ListQueryExecutionsInput{} diff --git a/service/athena/api_op_StartCalculationExecution.go b/service/athena/api_op_StartCalculationExecution.go index f8c9f2eb8ab..6c82ee7a8cc 100644 --- a/service/athena/api_op_StartCalculationExecution.go +++ b/service/athena/api_op_StartCalculationExecution.go @@ -13,7 +13,11 @@ import ( ) // Submits calculations for execution within a session. You can supply the code to -// run as an inline code block within the request. +// run as an inline code block within the request. The request syntax requires the +// StartCalculationExecutionRequest$CodeBlock parameter or the +// CalculationConfiguration$CodeBlock parameter, but not both. Because +// CalculationConfiguration$CodeBlock is deprecated, use the +// StartCalculationExecutionRequest$CodeBlock parameter instead. func (c *Client) StartCalculationExecution(ctx context.Context, params *StartCalculationExecutionInput, optFns ...func(*Options)) (*StartCalculationExecutionOutput, error) { if params == nil { params = &StartCalculationExecutionInput{} @@ -51,7 +55,8 @@ type StartCalculationExecutionInput struct { // Services CLI, you must provide this token or the action will fail. ClientRequestToken *string - // A string that contains the code of the calculation. + // A string that contains the code of the calculation. Use this parameter instead + // of CalculationConfiguration$CodeBlock , which is deprecated. CodeBlock *string // A description of the calculation. diff --git a/service/athena/api_op_StopQueryExecution.go b/service/athena/api_op_StopQueryExecution.go index 6d5bbe4ba78..6617a08c302 100644 --- a/service/athena/api_op_StopQueryExecution.go +++ b/service/athena/api_op_StopQueryExecution.go @@ -12,9 +12,7 @@ import ( ) // Stops a query execution. Requires you to have access to the workgroup in which -// the query ran. For code samples using the Amazon Web Services SDK for Java, see -// Examples and Code Samples (http://docs.aws.amazon.com/athena/latest/ug/code-samples.html) -// in the Amazon Athena User Guide. +// the query ran. func (c *Client) StopQueryExecution(ctx context.Context, params *StopQueryExecutionInput, optFns ...func(*Options)) (*StopQueryExecutionOutput, error) { if params == nil { params = &StopQueryExecutionInput{} diff --git a/service/athena/deserializers.go b/service/athena/deserializers.go index 7a508bddedc..dd1a3602ac8 100644 --- a/service/athena/deserializers.go +++ b/service/athena/deserializers.go @@ -10967,6 +10967,19 @@ func awsAwsjson11_deserializeDocumentQueryExecutionStatistics(v **types.QueryExe return err } + case "ServicePreProcessingTimeInMillis": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ServicePreProcessingTimeInMillis = ptr.Int64(i64) + } + case "ServiceProcessingTimeInMillis": if value != nil { jtv, ok := value.(json.Number) @@ -11278,6 +11291,19 @@ func awsAwsjson11_deserializeDocumentQueryRuntimeStatisticsTimeline(v **types.Qu sv.QueryQueueTimeInMillis = ptr.Int64(i64) } + case "ServicePreProcessingTimeInMillis": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ServicePreProcessingTimeInMillis = ptr.Int64(i64) + } + case "ServiceProcessingTimeInMillis": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/athena/doc.go b/service/athena/doc.go index e87fb867107..c90bd04d443 100644 --- a/service/athena/doc.go +++ b/service/athena/doc.go @@ -14,7 +14,5 @@ // use version 1.1.0 of the driver or later with the Amazon Athena API. Earlier // version drivers do not support the API. For more information and to download the // driver, see Accessing Amazon Athena with JDBC (https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html) -// . For code samples using the Amazon Web Services SDK for Java, see Examples and -// Code Samples (https://docs.aws.amazon.com/athena/latest/ug/code-samples.html) in -// the Amazon Athena User Guide. +// . package athena diff --git a/service/athena/types/types.go b/service/athena/types/types.go index 372e2732413..d4cb680ed89 100644 --- a/service/athena/types/types.go +++ b/service/athena/types/types.go @@ -294,11 +294,13 @@ type ColumnInfo struct { noSmithyDocumentSerde } -// Specifies the KMS key that is used to encrypt the user's data stores in Athena. -// This setting does not apply to Athena SQL workgroups. +// Specifies the customer managed KMS key that is used to encrypt the user's data +// stores in Athena. When an Amazon Web Services managed key is used, this value is +// null. This setting does not apply to Athena SQL workgroups. type CustomerContentEncryptionConfiguration struct { - // The KMS key that is used to encrypt the user's data stores in Athena. + // The customer managed KMS key that is used to encrypt the user's data stores in + // Athena. // // This member is required. KmsKey *string @@ -365,8 +367,6 @@ type DataCatalog struct { // - The GLUE data catalog type also applies to the default AwsDataCatalog that // already exists in your account, of which you can have only one and cannot // modify. - // - Queries that specify a Glue Data Catalog other than the default - // AwsDataCatalog must be run on Athena engine version 2. Parameters map[string]string noSmithyDocumentSerde @@ -711,6 +711,10 @@ type QueryExecutionStatistics struct { // query. ResultReuseInformation *ResultReuseInformation + // The number of milliseconds that Athena took to preprocess the query before + // submitting the query to the query engine. + ServicePreProcessingTimeInMillis *int64 + // The number of milliseconds that Athena took to finalize and publish the query // results after the query engine finished running the query. ServiceProcessingTimeInMillis *int64 @@ -806,6 +810,10 @@ type QueryRuntimeStatisticsTimeline struct { // the query back to the queue. QueryQueueTimeInMillis *int64 + // The number of milliseconds that Athena spends on preprocessing before it + // submits the query to the engine. + ServicePreProcessingTimeInMillis *int64 + // The number of milliseconds that Athena took to finalize and publish the query // results after the query engine finished running the query. ServiceProcessingTimeInMillis *int64 @@ -1081,7 +1089,8 @@ type SessionConfiguration struct { // encryption option used (for example, SSE_KMS or CSE_KMS ) and key information. EncryptionConfiguration *EncryptionConfiguration - // The ARN of the execution role used for the session. + // The ARN of the execution role used in a Spark session to access user resources. + // This property applies only to Spark-enabled workgroups. ExecutionRole *string // The idle timeout in seconds for the session. @@ -1348,7 +1357,8 @@ type WorkGroupConfiguration struct { // regardless of this setting. EngineVersion *EngineVersion - // Role used in a session for accessing the user's resources. + // Role used in a Spark session for accessing the user's resources. This property + // applies only to Spark-enabled workgroups. ExecutionRole *string // Indicates that the Amazon CloudWatch metrics are enabled for the workgroup. @@ -1391,8 +1401,9 @@ type WorkGroupConfigurationUpdates struct { // is allowed to scan. BytesScannedCutoffPerQuery *int64 - // Specifies the KMS key that is used to encrypt the user's data stores in Athena. - // This setting does not apply to Athena SQL workgroups. + // Specifies the customer managed KMS key that is used to encrypt the user's data + // stores in Athena. When an Amazon Web Services managed key is used, this value is + // null. This setting does not apply to Athena SQL workgroups. CustomerContentEncryptionConfiguration *CustomerContentEncryptionConfiguration // Enforces a minimal level of encryption for the workgroup for query and @@ -1418,7 +1429,8 @@ type WorkGroupConfigurationUpdates struct { // of this setting. EngineVersion *EngineVersion - // Contains the ARN of the execution role for the workgroup + // The ARN of the execution role used to access user resources. This property + // applies only to Spark-enabled workgroups. ExecutionRole *string // Indicates whether this workgroup enables publishing metrics to Amazon diff --git a/service/cloud9/api_op_CreateEnvironmentEC2.go b/service/cloud9/api_op_CreateEnvironmentEC2.go index 9e2d7736282..687cfc75286 100644 --- a/service/cloud9/api_op_CreateEnvironmentEC2.go +++ b/service/cloud9/api_op_CreateEnvironmentEC2.go @@ -70,7 +70,7 @@ type CreateEnvironmentEC2Input struct { // The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 // instance. To choose an AMI for the instance, you must specify a valid AMI alias - // or a valid Amazon EC2 Systems Manager (SSM) path. From November 20, 2023, you + // or a valid Amazon EC2 Systems Manager (SSM) path. From December 04, 2023, you // will be required to include the imageId parameter for the CreateEnvironmentEC2 // action. This change will be reflected across all direct methods of communicating // with the API, such as Amazon Web Services SDK, Amazon Web Services CLI and diff --git a/service/cloudformation/api_op_CreateChangeSet.go b/service/cloudformation/api_op_CreateChangeSet.go index df2b8ae87f9..8c733b63f82 100644 --- a/service/cloudformation/api_op_CreateChangeSet.go +++ b/service/cloudformation/api_op_CreateChangeSet.go @@ -130,6 +130,15 @@ type CreateChangeSetInput struct { // A description to help you identify this change set. Description *string + // Indicates if the stack set imports resources that already exist. This parameter + // can only import resources that have custom names in templates. For more + // information, see name type (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) + // in the CloudFormation User Guide. To import resources that do not accept custom + // names, such as EC2 instances, use the resource import feature instead. For more + // information, see Bringing existing resources into CloudFormation management (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html) + // in the CloudFormation User Guide. + ImportExistingResources *bool + // Creates a change set for the all nested stacks specified in the template. The // default behavior of this action is set to False . To include nested sets in a // change set, specify True . diff --git a/service/cloudformation/api_op_DescribeChangeSet.go b/service/cloudformation/api_op_DescribeChangeSet.go index d861287da9c..6cced7c9a4c 100644 --- a/service/cloudformation/api_op_DescribeChangeSet.go +++ b/service/cloudformation/api_op_DescribeChangeSet.go @@ -86,6 +86,13 @@ type DescribeChangeSetOutput struct { // creating it or in an OBSOLETE state because the stack was already updated. ExecutionStatus types.ExecutionStatus + // Indicates if the stack set imports resources that already exist. This parameter + // can only import resources that have custom names (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) + // in templates. To import resources that do not accept custom names, such as EC2 + // instances, use the resource import (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html) + // feature instead. + ImportExistingResources *bool + // Verifies if IncludeNestedStacks is set to True . IncludeNestedStacks *bool diff --git a/service/cloudformation/deserializers.go b/service/cloudformation/deserializers.go index fc2aca81545..15fab4fbf3d 100644 --- a/service/cloudformation/deserializers.go +++ b/service/cloudformation/deserializers.go @@ -9916,6 +9916,22 @@ func awsAwsquery_deserializeDocumentChangeSetSummary(v **types.ChangeSetSummary, sv.ExecutionStatus = types.ExecutionStatus(xtv) } + case strings.EqualFold("ImportExistingResources", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected ImportExistingResources to be of type *bool, got %T instead", val) + } + sv.ImportExistingResources = ptr.Bool(xtv) + } + case strings.EqualFold("IncludeNestedStacks", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -20122,6 +20138,22 @@ func awsAwsquery_deserializeOpDocumentDescribeChangeSetOutput(v **DescribeChange sv.ExecutionStatus = types.ExecutionStatus(xtv) } + case strings.EqualFold("ImportExistingResources", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected ImportExistingResources to be of type *bool, got %T instead", val) + } + sv.ImportExistingResources = ptr.Bool(xtv) + } + case strings.EqualFold("IncludeNestedStacks", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/cloudformation/endpoints_test.go b/service/cloudformation/endpoints_test.go index 2c44931d1e0..74024e542bf 100644 --- a/service/cloudformation/endpoints_test.go +++ b/service/cloudformation/endpoints_test.go @@ -1946,23 +1946,3 @@ func TestEndpointCase52(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } - -// Partition doesn't support DualStack -func TestEndpointCase53(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} diff --git a/service/cloudformation/serializers.go b/service/cloudformation/serializers.go index 6cf7b10f776..3fc695cd41a 100644 --- a/service/cloudformation/serializers.go +++ b/service/cloudformation/serializers.go @@ -5192,6 +5192,11 @@ func awsAwsquery_serializeOpDocumentCreateChangeSetInput(v *CreateChangeSetInput objectKey.String(*v.Description) } + if v.ImportExistingResources != nil { + objectKey := object.Key("ImportExistingResources") + objectKey.Boolean(*v.ImportExistingResources) + } + if v.IncludeNestedStacks != nil { objectKey := object.Key("IncludeNestedStacks") objectKey.Boolean(*v.IncludeNestedStacks) diff --git a/service/cloudformation/types/types.go b/service/cloudformation/types/types.go index faca447f7dd..ccbf0d5bd22 100644 --- a/service/cloudformation/types/types.go +++ b/service/cloudformation/types/types.go @@ -209,6 +209,9 @@ type ChangeSetSummary struct { // creating it or in an OBSOLETE state because the stack was already updated. ExecutionStatus ExecutionStatus + // Indicates if the stack set imports resources that already exist. + ImportExistingResources *bool + // Specifies the current setting of IncludeNestedStacks for the change set. IncludeNestedStacks *bool @@ -1798,15 +1801,17 @@ type StackSetOperation struct { type StackSetOperationPreferences struct { // Specifies how the concurrency level behaves during the operation execution. - // - STRICT_FAILURE_TOLERANCE : Dynamically lowers the concurrency level to - // ensure the number of failed accounts never exceeds the FailureToleranceCount - // +1. StackSets will set the actual concurrency of your deployment as the minimum - // value between the MaxConcurrentCount and the FailureToleranceCount +1. This is - // the default behavior. If failure tolerance or Maximum concurrent accounts are - // set to percentages, the behavior is similar. - // - SOFT_FAILURE_TOLERANCE : Always run at the concurrency level set by the user - // in the MaxConcurrentCount or MaxConcurrentPercentage , regardless of the - // number of failures. + // - STRICT_FAILURE_TOLERANCE : This option dynamically lowers the concurrency + // level to ensure the number of failed accounts never exceeds the value of + // FailureToleranceCount +1. The initial actual concurrency is set to the lower + // of either the value of the MaxConcurrentCount , or the value of + // MaxConcurrentCount +1. The actual concurrency is then reduced proportionally + // by the number of failures. This is the default behavior. If failure tolerance or + // Maximum concurrent accounts are set to percentages, the behavior is similar. + // - SOFT_FAILURE_TOLERANCE : This option decouples FailureToleranceCount from + // the actual concurrency. This allows stack set operations to run at the + // concurrency level set by the MaxConcurrentCount value, or + // MaxConcurrentPercentage , regardless of the number of failures. ConcurrencyMode ConcurrencyMode // The number of accounts, per Region, for which this operation can fail before diff --git a/service/codepipeline/api_op_StartPipelineExecution.go b/service/codepipeline/api_op_StartPipelineExecution.go index 070ee6088ef..5430cbaff77 100644 --- a/service/codepipeline/api_op_StartPipelineExecution.go +++ b/service/codepipeline/api_op_StartPipelineExecution.go @@ -40,6 +40,12 @@ type StartPipelineExecutionInput struct { // The system-generated unique ID used to identify a unique execution request. ClientRequestToken *string + // A list that allows you to specify, or override, the source revision for a + // pipeline execution that's being started. A source revision is the version with + // all the changes to your application code, or source artifact, for the pipeline + // execution. + SourceRevisions []types.SourceRevisionOverride + // A list that overrides pipeline variables for a pipeline execution that's being // started. Variable names must match [A-Za-z0-9@\-_]+ , and the values can be // anything except an empty string. diff --git a/service/codepipeline/serializers.go b/service/codepipeline/serializers.go index 61ae38392ac..30a8c06fa91 100644 --- a/service/codepipeline/serializers.go +++ b/service/codepipeline/serializers.go @@ -3185,6 +3185,41 @@ func awsAwsjson11_serializeDocumentQueryParamMap(v map[string]string, value smit return nil } +func awsAwsjson11_serializeDocumentSourceRevisionOverride(v *types.SourceRevisionOverride, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionName != nil { + ok := object.Key("actionName") + ok.String(*v.ActionName) + } + + if len(v.RevisionType) > 0 { + ok := object.Key("revisionType") + ok.String(string(v.RevisionType)) + } + + if v.RevisionValue != nil { + ok := object.Key("revisionValue") + ok.String(*v.RevisionValue) + } + + return nil +} + +func awsAwsjson11_serializeDocumentSourceRevisionOverrideList(v []types.SourceRevisionOverride, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentSourceRevisionOverride(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentStageActionDeclarationList(v []types.ActionDeclaration, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4120,6 +4155,13 @@ func awsAwsjson11_serializeOpDocumentStartPipelineExecutionInput(v *StartPipelin ok.String(*v.Name) } + if v.SourceRevisions != nil { + ok := object.Key("sourceRevisions") + if err := awsAwsjson11_serializeDocumentSourceRevisionOverrideList(v.SourceRevisions, ok); err != nil { + return err + } + } + if v.Variables != nil { ok := object.Key("variables") if err := awsAwsjson11_serializeDocumentPipelineVariableList(v.Variables, ok); err != nil { diff --git a/service/codepipeline/types/enums.go b/service/codepipeline/types/enums.go index 93eb63ac235..271a36be597 100644 --- a/service/codepipeline/types/enums.go +++ b/service/codepipeline/types/enums.go @@ -307,6 +307,26 @@ func (PipelineType) Values() []PipelineType { } } +type SourceRevisionType string + +// Enum values for SourceRevisionType +const ( + SourceRevisionTypeCommitId SourceRevisionType = "COMMIT_ID" + SourceRevisionTypeImageDigest SourceRevisionType = "IMAGE_DIGEST" + SourceRevisionTypeS3ObjectVersionId SourceRevisionType = "S3_OBJECT_VERSION_ID" +) + +// Values returns all known values for SourceRevisionType. 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 (SourceRevisionType) Values() []SourceRevisionType { + return []SourceRevisionType{ + "COMMIT_ID", + "IMAGE_DIGEST", + "S3_OBJECT_VERSION_ID", + } +} + type StageExecutionStatus string // Enum values for StageExecutionStatus diff --git a/service/codepipeline/types/types.go b/service/codepipeline/types/types.go index e6adaaab7e6..d18a814714d 100644 --- a/service/codepipeline/types/types.go +++ b/service/codepipeline/types/types.go @@ -931,7 +931,11 @@ type FailureDetails struct { // A type of trigger configuration for Git-based source actions. You can specify // the Git configuration trigger type for all third-party Git-based source actions -// that are supported by the CodeStarSourceConnection action type. +// that are supported by the CodeStarSourceConnection action type. V2 type +// pipelines, along with triggers on Git tags and pipeline-level variables, are not +// currently supported for CloudFormation and CDK resources in CodePipeline. For +// more information about V2 type pipelines, see Pipeline types (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html) +// in the CodePipeline User Guide. type GitConfiguration struct { // The name of the pipeline source action where the trigger configuration, such as @@ -1220,7 +1224,10 @@ type PipelineDeclaration struct { // CodePipeline, see Pricing (https://aws.amazon.com/codepipeline/pricing/) . For // information about which type of pipeline to choose, see What type of pipeline // is right for me? (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) - // . + // . V2 type pipelines, along with triggers on Git tags and pipeline-level + // variables, are not currently supported for CloudFormation and CDK resources in + // CodePipeline. For more information about V2 type pipelines, see Pipeline types (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html) + // in the CodePipeline User Guide. PipelineType PipelineType // The trigger configuration specifying a type of event, such as Git tags, that @@ -1375,7 +1382,10 @@ type PipelineSummary struct { // CodePipeline, see Pricing (https://aws.amazon.com/codepipeline/pricing/) . For // information about which type of pipeline to choose, see What type of pipeline // is right for me? (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) - // . + // . V2 type pipelines, along with triggers on Git tags and pipeline-level + // variables, are not currently supported for CloudFormation and CDK resources in + // CodePipeline. For more information about V2 type pipelines, see Pipeline types (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html) + // in the CodePipeline User Guide. PipelineType PipelineType // The date and time of the last update to the pipeline, in timestamp format. @@ -1391,7 +1401,11 @@ type PipelineSummary struct { // filter criteria and the source stage for the action that contains the trigger. // This is only supported for the CodeStarSourceConnection action type. When a // trigger configuration is specified, default change detection for repository and -// branch commits is disabled. +// branch commits is disabled. V2 type pipelines, along with triggers on Git tags +// and pipeline-level variables, are not currently supported for CloudFormation and +// CDK resources in CodePipeline. For more information about V2 type pipelines, see +// Pipeline types (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html) +// in the CodePipeline User Guide. type PipelineTriggerDeclaration struct { // Provides the filter criteria and the source stage for the repository event that @@ -1409,7 +1423,11 @@ type PipelineTriggerDeclaration struct { noSmithyDocumentSerde } -// A pipeline-level variable used for a pipeline execution. +// A pipeline-level variable used for a pipeline execution. V2 type pipelines, +// along with triggers on Git tags and pipeline-level variables, are not currently +// supported for CloudFormation and CDK resources in CodePipeline. For more +// information about V2 type pipelines, see Pipeline types (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html) +// in the CodePipeline User Guide. type PipelineVariable struct { // The name of a pipeline-level variable. @@ -1425,7 +1443,11 @@ type PipelineVariable struct { noSmithyDocumentSerde } -// A variable declared at the pipeline level. +// A variable declared at the pipeline level. V2 type pipelines, along with +// triggers on Git tags and pipeline-level variables, are not currently supported +// for CloudFormation and CDK resources in CodePipeline. For more information about +// V2 type pipelines, see Pipeline types (https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types.html) +// in the CodePipeline User Guide. type PipelineVariableDeclaration struct { // The name of a pipeline-level variable. @@ -1510,6 +1532,32 @@ type SourceRevision struct { noSmithyDocumentSerde } +// A list that allows you to specify, or override, the source revision for a +// pipeline execution that's being started. A source revision is the version with +// all the changes to your application code, or source artifact, for the pipeline +// execution. +type SourceRevisionOverride struct { + + // The name of the action where the override will be applied. + // + // This member is required. + ActionName *string + + // The type of source revision, based on the source provider. For example, the + // revision type for the CodeCommit action provider is the commit ID. + // + // This member is required. + RevisionType SourceRevisionType + + // The source revision, or version of your source artifact, with the changes that + // you want to run in the pipeline execution. + // + // This member is required. + RevisionValue *string + + noSmithyDocumentSerde +} + // Represents information about a stage to a job worker. type StageContext struct { diff --git a/service/codepipeline/validators.go b/service/codepipeline/validators.go index 96375248d93..1e39055de91 100644 --- a/service/codepipeline/validators.go +++ b/service/codepipeline/validators.go @@ -1512,6 +1512,44 @@ func validatePipelineVariableList(v []types.PipelineVariable) error { } } +func validateSourceRevisionOverride(v *types.SourceRevisionOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceRevisionOverride"} + if v.ActionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionName")) + } + if len(v.RevisionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("RevisionType")) + } + if v.RevisionValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("RevisionValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSourceRevisionOverrideList(v []types.SourceRevisionOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceRevisionOverrideList"} + for i := range v { + if err := validateSourceRevisionOverride(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStageActionDeclarationList(v []types.ActionDeclaration) error { if v == nil { return nil @@ -2276,6 +2314,11 @@ func validateOpStartPipelineExecutionInput(v *StartPipelineExecutionInput) error invalidParams.AddNested("Variables", err.(smithy.InvalidParamsError)) } } + if v.SourceRevisions != nil { + if err := validateSourceRevisionOverrideList(v.SourceRevisions); err != nil { + invalidParams.AddNested("SourceRevisions", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/codestarconnections/api_op_CreateHost.go b/service/codestarconnections/api_op_CreateHost.go index c58e8a9a754..76989fd0bc8 100644 --- a/service/codestarconnections/api_op_CreateHost.go +++ b/service/codestarconnections/api_op_CreateHost.go @@ -53,6 +53,7 @@ type CreateHostInput struct { // This member is required. ProviderType types.ProviderType + // Tags for the host to be created. Tags []types.Tag // The VPC configuration to be provisioned for the host. A VPC must be configured @@ -68,6 +69,7 @@ type CreateHostOutput struct { // The Amazon Resource Name (ARN) of the host to be created. HostArn *string + // Tags for the created host. Tags []types.Tag // Metadata pertaining to the operation's result. diff --git a/service/codestarconnections/api_op_CreateRepositoryLink.go b/service/codestarconnections/api_op_CreateRepositoryLink.go new file mode 100644 index 00000000000..3b728276386 --- /dev/null +++ b/service/codestarconnections/api_op_CreateRepositoryLink.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a link to a specified external Git repository. A repository link allows +// Git sync to monitor and sync changes to files in a specified Git repository. +func (c *Client) CreateRepositoryLink(ctx context.Context, params *CreateRepositoryLinkInput, optFns ...func(*Options)) (*CreateRepositoryLinkOutput, error) { + if params == nil { + params = &CreateRepositoryLinkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRepositoryLink", params, optFns, c.addOperationCreateRepositoryLinkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRepositoryLinkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRepositoryLinkInput struct { + + // The Amazon Resource Name (ARN) of the connection to be associated with the + // repository link. + // + // This member is required. + ConnectionArn *string + + // The owner ID for the repository associated with a specific sync configuration, + // such as the owner ID in GitHub. + // + // This member is required. + OwnerId *string + + // The name of the repository to be associated with the repository link. + // + // This member is required. + RepositoryName *string + + // The Amazon Resource Name (ARN) encryption key for the repository to be + // associated with the repository link. + EncryptionKeyArn *string + + // The tags for the repository to be associated with the repository link. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateRepositoryLinkOutput struct { + + // The returned information about the created repository link. + // + // This member is required. + RepositoryLinkInfo *types.RepositoryLinkInfo + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRepositoryLinkMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateRepositoryLink{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateRepositoryLink{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRepositoryLink"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateRepositoryLinkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRepositoryLink(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateRepositoryLink(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateRepositoryLink", + } +} diff --git a/service/codestarconnections/api_op_CreateSyncConfiguration.go b/service/codestarconnections/api_op_CreateSyncConfiguration.go new file mode 100644 index 00000000000..89a31f17f96 --- /dev/null +++ b/service/codestarconnections/api_op_CreateSyncConfiguration.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a sync configuration which allows Amazon Web Services to sync content +// from a Git repository to update a specified Amazon Web Services resource. +// Parameters for the sync configuration are determined by the sync type. +func (c *Client) CreateSyncConfiguration(ctx context.Context, params *CreateSyncConfigurationInput, optFns ...func(*Options)) (*CreateSyncConfigurationOutput, error) { + if params == nil { + params = &CreateSyncConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSyncConfiguration", params, optFns, c.addOperationCreateSyncConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSyncConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSyncConfigurationInput struct { + + // The branch in the repository from which changes will be synced. + // + // This member is required. + Branch *string + + // The file name of the configuration file that manages syncing between the + // connection and the repository. This configuration file is stored in the + // repository. + // + // This member is required. + ConfigFile *string + + // The ID of the repository link created for the connection. A repository link + // allows Git sync to monitor and sync changes to files in a specified Git + // repository. + // + // This member is required. + RepositoryLinkId *string + + // The name of the Amazon Web Services resource (for example, a CloudFormation + // stack in the case of CFN_STACK_SYNC) that will be synchronized from the linked + // repository. + // + // This member is required. + ResourceName *string + + // The ARN of the IAM role that grants permission for Amazon Web Services to use + // Git sync to update a given Amazon Web Services resource on your behalf. + // + // This member is required. + RoleArn *string + + // The type of sync configuration. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type CreateSyncConfigurationOutput struct { + + // The created sync configuration for the connection. A sync configuration allows + // Amazon Web Services to sync content from a Git repository to update a specified + // Amazon Web Services resource. + // + // This member is required. + SyncConfiguration *types.SyncConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSyncConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSyncConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateSyncConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSyncConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSyncConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateSyncConfiguration", + } +} diff --git a/service/codestarconnections/api_op_DeleteRepositoryLink.go b/service/codestarconnections/api_op_DeleteRepositoryLink.go new file mode 100644 index 00000000000..9bcd4a00f8e --- /dev/null +++ b/service/codestarconnections/api_op_DeleteRepositoryLink.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the association between your connection and a specified external Git +// repository. +func (c *Client) DeleteRepositoryLink(ctx context.Context, params *DeleteRepositoryLinkInput, optFns ...func(*Options)) (*DeleteRepositoryLinkOutput, error) { + if params == nil { + params = &DeleteRepositoryLinkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRepositoryLink", params, optFns, c.addOperationDeleteRepositoryLinkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRepositoryLinkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRepositoryLinkInput struct { + + // The ID of the repository link to be deleted. + // + // This member is required. + RepositoryLinkId *string + + noSmithyDocumentSerde +} + +type DeleteRepositoryLinkOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRepositoryLinkMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteRepositoryLink{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteRepositoryLink{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRepositoryLink"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteRepositoryLinkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRepositoryLink(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRepositoryLink(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteRepositoryLink", + } +} diff --git a/service/codestarconnections/api_op_DeleteSyncConfiguration.go b/service/codestarconnections/api_op_DeleteSyncConfiguration.go new file mode 100644 index 00000000000..c9f652e3d66 --- /dev/null +++ b/service/codestarconnections/api_op_DeleteSyncConfiguration.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the sync configuration for a specified repository and connection. +func (c *Client) DeleteSyncConfiguration(ctx context.Context, params *DeleteSyncConfigurationInput, optFns ...func(*Options)) (*DeleteSyncConfigurationOutput, error) { + if params == nil { + params = &DeleteSyncConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSyncConfiguration", params, optFns, c.addOperationDeleteSyncConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSyncConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSyncConfigurationInput struct { + + // The name of the Amazon Web Services resource associated with the sync + // configuration to be deleted. + // + // This member is required. + ResourceName *string + + // The type of sync configuration to be deleted. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type DeleteSyncConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSyncConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSyncConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSyncConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSyncConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSyncConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteSyncConfiguration", + } +} diff --git a/service/codestarconnections/api_op_GetRepositoryLink.go b/service/codestarconnections/api_op_GetRepositoryLink.go new file mode 100644 index 00000000000..000ee104a35 --- /dev/null +++ b/service/codestarconnections/api_op_GetRepositoryLink.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns details about a repository link. A repository link allows Git sync to +// monitor and sync changes from files in a specified Git repository. +func (c *Client) GetRepositoryLink(ctx context.Context, params *GetRepositoryLinkInput, optFns ...func(*Options)) (*GetRepositoryLinkOutput, error) { + if params == nil { + params = &GetRepositoryLinkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRepositoryLink", params, optFns, c.addOperationGetRepositoryLinkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRepositoryLinkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRepositoryLinkInput struct { + + // The ID of the repository link to get. + // + // This member is required. + RepositoryLinkId *string + + noSmithyDocumentSerde +} + +type GetRepositoryLinkOutput struct { + + // The information returned for a specified repository link. + // + // This member is required. + RepositoryLinkInfo *types.RepositoryLinkInfo + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRepositoryLinkMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetRepositoryLink{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetRepositoryLink{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRepositoryLink"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetRepositoryLinkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositoryLink(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRepositoryLink(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetRepositoryLink", + } +} diff --git a/service/codestarconnections/api_op_GetRepositorySyncStatus.go b/service/codestarconnections/api_op_GetRepositorySyncStatus.go new file mode 100644 index 00000000000..9aa15615049 --- /dev/null +++ b/service/codestarconnections/api_op_GetRepositorySyncStatus.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns details about the sync status for a repository. A repository sync uses +// Git sync to push and pull changes from your remote repository. +func (c *Client) GetRepositorySyncStatus(ctx context.Context, params *GetRepositorySyncStatusInput, optFns ...func(*Options)) (*GetRepositorySyncStatusOutput, error) { + if params == nil { + params = &GetRepositorySyncStatusInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRepositorySyncStatus", params, optFns, c.addOperationGetRepositorySyncStatusMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRepositorySyncStatusOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRepositorySyncStatusInput struct { + + // The branch of the repository link for the requested repository sync status. + // + // This member is required. + Branch *string + + // The repository link ID for the requested repository sync status. + // + // This member is required. + RepositoryLinkId *string + + // The sync type of the requested sync status. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type GetRepositorySyncStatusOutput struct { + + // The status of the latest sync returned for a specified repository and branch. + // + // This member is required. + LatestSync *types.RepositorySyncAttempt + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRepositorySyncStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetRepositorySyncStatus{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetRepositorySyncStatus{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRepositorySyncStatus"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetRepositorySyncStatusValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRepositorySyncStatus(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRepositorySyncStatus(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetRepositorySyncStatus", + } +} diff --git a/service/codestarconnections/api_op_GetResourceSyncStatus.go b/service/codestarconnections/api_op_GetResourceSyncStatus.go new file mode 100644 index 00000000000..32b34c42910 --- /dev/null +++ b/service/codestarconnections/api_op_GetResourceSyncStatus.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the status of the sync with the Git repository for a specific Amazon +// Web Services resource. +func (c *Client) GetResourceSyncStatus(ctx context.Context, params *GetResourceSyncStatusInput, optFns ...func(*Options)) (*GetResourceSyncStatusOutput, error) { + if params == nil { + params = &GetResourceSyncStatusInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourceSyncStatus", params, optFns, c.addOperationGetResourceSyncStatusMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourceSyncStatusOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourceSyncStatusInput struct { + + // The name of the Amazon Web Services resource for the sync status with the Git + // repository. + // + // This member is required. + ResourceName *string + + // The sync type for the sync status with the Git repository. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type GetResourceSyncStatusOutput struct { + + // The latest sync for the sync status with the Git repository, whether successful + // or not. + // + // This member is required. + LatestSync *types.ResourceSyncAttempt + + // The desired state of the Amazon Web Services resource for the sync status with + // the Git repository. + DesiredState *types.Revision + + // The latest successful sync for the sync status with the Git repository. + LatestSuccessfulSync *types.ResourceSyncAttempt + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourceSyncStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetResourceSyncStatus{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetResourceSyncStatus{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetResourceSyncStatus"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetResourceSyncStatusValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourceSyncStatus(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetResourceSyncStatus(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetResourceSyncStatus", + } +} diff --git a/service/codestarconnections/api_op_GetSyncBlockerSummary.go b/service/codestarconnections/api_op_GetSyncBlockerSummary.go new file mode 100644 index 00000000000..1228218b030 --- /dev/null +++ b/service/codestarconnections/api_op_GetSyncBlockerSummary.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of the most recent sync blockers. +func (c *Client) GetSyncBlockerSummary(ctx context.Context, params *GetSyncBlockerSummaryInput, optFns ...func(*Options)) (*GetSyncBlockerSummaryOutput, error) { + if params == nil { + params = &GetSyncBlockerSummaryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSyncBlockerSummary", params, optFns, c.addOperationGetSyncBlockerSummaryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSyncBlockerSummaryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSyncBlockerSummaryInput struct { + + // The name of the Amazon Web Services resource currently blocked from + // automatically being synced from a Git repository. + // + // This member is required. + ResourceName *string + + // The sync type for the sync blocker summary. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type GetSyncBlockerSummaryOutput struct { + + // The list of sync blockers for a specified resource. + // + // This member is required. + SyncBlockerSummary *types.SyncBlockerSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSyncBlockerSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetSyncBlockerSummary{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetSyncBlockerSummary{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSyncBlockerSummary"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetSyncBlockerSummaryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSyncBlockerSummary(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSyncBlockerSummary(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSyncBlockerSummary", + } +} diff --git a/service/codestarconnections/api_op_GetSyncConfiguration.go b/service/codestarconnections/api_op_GetSyncConfiguration.go new file mode 100644 index 00000000000..7ac0950950c --- /dev/null +++ b/service/codestarconnections/api_op_GetSyncConfiguration.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns details about a sync configuration, including the sync type and +// resource name. A sync configuration allows the configuration to sync (push and +// pull) changes from the remote repository for a specified branch in a Git +// repository. +func (c *Client) GetSyncConfiguration(ctx context.Context, params *GetSyncConfigurationInput, optFns ...func(*Options)) (*GetSyncConfigurationOutput, error) { + if params == nil { + params = &GetSyncConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSyncConfiguration", params, optFns, c.addOperationGetSyncConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSyncConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSyncConfigurationInput struct { + + // The name of the Amazon Web Services resource for the sync configuration for + // which you want to retrieve information. + // + // This member is required. + ResourceName *string + + // The sync type for the sync configuration for which you want to retrieve + // information. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type GetSyncConfigurationOutput struct { + + // The details about the sync configuration for which you want to retrieve + // information. + // + // This member is required. + SyncConfiguration *types.SyncConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSyncConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSyncConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetSyncConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSyncConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSyncConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSyncConfiguration", + } +} diff --git a/service/codestarconnections/api_op_ListRepositoryLinks.go b/service/codestarconnections/api_op_ListRepositoryLinks.go new file mode 100644 index 00000000000..c1c3164c6fd --- /dev/null +++ b/service/codestarconnections/api_op_ListRepositoryLinks.go @@ -0,0 +1,229 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the repository links created for connections in your account. +func (c *Client) ListRepositoryLinks(ctx context.Context, params *ListRepositoryLinksInput, optFns ...func(*Options)) (*ListRepositoryLinksOutput, error) { + if params == nil { + params = &ListRepositoryLinksInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRepositoryLinks", params, optFns, c.addOperationListRepositoryLinksMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRepositoryLinksOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRepositoryLinksInput struct { + + // A non-zero, non-negative integer used to limit the number of returned results. + MaxResults int32 + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListRepositoryLinksOutput struct { + + // Lists the repository links called by the list repository links operation. + // + // This member is required. + RepositoryLinks []types.RepositoryLinkInfo + + // An enumeration token that allows the operation to batch the results of the + // operation. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRepositoryLinksMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListRepositoryLinks{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListRepositoryLinks{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListRepositoryLinks"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRepositoryLinks(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListRepositoryLinksAPIClient is a client that implements the +// ListRepositoryLinks operation. +type ListRepositoryLinksAPIClient interface { + ListRepositoryLinks(context.Context, *ListRepositoryLinksInput, ...func(*Options)) (*ListRepositoryLinksOutput, error) +} + +var _ ListRepositoryLinksAPIClient = (*Client)(nil) + +// ListRepositoryLinksPaginatorOptions is the paginator options for +// ListRepositoryLinks +type ListRepositoryLinksPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListRepositoryLinksPaginator is a paginator for ListRepositoryLinks +type ListRepositoryLinksPaginator struct { + options ListRepositoryLinksPaginatorOptions + client ListRepositoryLinksAPIClient + params *ListRepositoryLinksInput + nextToken *string + firstPage bool +} + +// NewListRepositoryLinksPaginator returns a new ListRepositoryLinksPaginator +func NewListRepositoryLinksPaginator(client ListRepositoryLinksAPIClient, params *ListRepositoryLinksInput, optFns ...func(*ListRepositoryLinksPaginatorOptions)) *ListRepositoryLinksPaginator { + if params == nil { + params = &ListRepositoryLinksInput{} + } + + options := ListRepositoryLinksPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRepositoryLinksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoryLinksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRepositoryLinks page. +func (p *ListRepositoryLinksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoryLinksOutput, 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.ListRepositoryLinks(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_opListRepositoryLinks(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListRepositoryLinks", + } +} diff --git a/service/codestarconnections/api_op_ListRepositorySyncDefinitions.go b/service/codestarconnections/api_op_ListRepositorySyncDefinitions.go new file mode 100644 index 00000000000..b28320a2a65 --- /dev/null +++ b/service/codestarconnections/api_op_ListRepositorySyncDefinitions.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the repository sync definitions for repository links in your account. +func (c *Client) ListRepositorySyncDefinitions(ctx context.Context, params *ListRepositorySyncDefinitionsInput, optFns ...func(*Options)) (*ListRepositorySyncDefinitionsOutput, error) { + if params == nil { + params = &ListRepositorySyncDefinitionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRepositorySyncDefinitions", params, optFns, c.addOperationListRepositorySyncDefinitionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRepositorySyncDefinitionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRepositorySyncDefinitionsInput struct { + + // The ID of the repository link for the sync definition for which you want to + // retrieve information. + // + // This member is required. + RepositoryLinkId *string + + // The sync type of the repository link for the the sync definition for which you + // want to retrieve information. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type ListRepositorySyncDefinitionsOutput struct { + + // The list of repository sync definitions returned by the request. A + // RepositorySyncDefinition is a mapping from a repository branch to all the Amazon + // Web Services resources that are being synced from that branch. + // + // This member is required. + RepositorySyncDefinitions []types.RepositorySyncDefinition + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRepositorySyncDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListRepositorySyncDefinitions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListRepositorySyncDefinitions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListRepositorySyncDefinitions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListRepositorySyncDefinitionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRepositorySyncDefinitions(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListRepositorySyncDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListRepositorySyncDefinitions", + } +} diff --git a/service/codestarconnections/api_op_ListSyncConfigurations.go b/service/codestarconnections/api_op_ListSyncConfigurations.go new file mode 100644 index 00000000000..a85df2d9b67 --- /dev/null +++ b/service/codestarconnections/api_op_ListSyncConfigurations.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of sync configurations for a specified repository. +func (c *Client) ListSyncConfigurations(ctx context.Context, params *ListSyncConfigurationsInput, optFns ...func(*Options)) (*ListSyncConfigurationsOutput, error) { + if params == nil { + params = &ListSyncConfigurationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSyncConfigurations", params, optFns, c.addOperationListSyncConfigurationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSyncConfigurationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSyncConfigurationsInput struct { + + // The ID of the repository link for the requested list of sync configurations. + // + // This member is required. + RepositoryLinkId *string + + // The sync type for the requested list of sync configurations. + // + // This member is required. + SyncType types.SyncConfigurationType + + // A non-zero, non-negative integer used to limit the number of returned results. + MaxResults int32 + + // An enumeration token that allows the operation to batch the results of the + // operation. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSyncConfigurationsOutput struct { + + // The list of repository sync definitions returned by the request. + // + // This member is required. + SyncConfigurations []types.SyncConfiguration + + // An enumeration token that allows the operation to batch the next results of the + // operation. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSyncConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListSyncConfigurations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListSyncConfigurations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSyncConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListSyncConfigurationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSyncConfigurations(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListSyncConfigurationsAPIClient is a client that implements the +// ListSyncConfigurations operation. +type ListSyncConfigurationsAPIClient interface { + ListSyncConfigurations(context.Context, *ListSyncConfigurationsInput, ...func(*Options)) (*ListSyncConfigurationsOutput, error) +} + +var _ ListSyncConfigurationsAPIClient = (*Client)(nil) + +// ListSyncConfigurationsPaginatorOptions is the paginator options for +// ListSyncConfigurations +type ListSyncConfigurationsPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSyncConfigurationsPaginator is a paginator for ListSyncConfigurations +type ListSyncConfigurationsPaginator struct { + options ListSyncConfigurationsPaginatorOptions + client ListSyncConfigurationsAPIClient + params *ListSyncConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListSyncConfigurationsPaginator returns a new ListSyncConfigurationsPaginator +func NewListSyncConfigurationsPaginator(client ListSyncConfigurationsAPIClient, params *ListSyncConfigurationsInput, optFns ...func(*ListSyncConfigurationsPaginatorOptions)) *ListSyncConfigurationsPaginator { + if params == nil { + params = &ListSyncConfigurationsInput{} + } + + options := ListSyncConfigurationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSyncConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSyncConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSyncConfigurations page. +func (p *ListSyncConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSyncConfigurationsOutput, 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.ListSyncConfigurations(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_opListSyncConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSyncConfigurations", + } +} diff --git a/service/codestarconnections/api_op_UpdateRepositoryLink.go b/service/codestarconnections/api_op_UpdateRepositoryLink.go new file mode 100644 index 00000000000..bc3d63df181 --- /dev/null +++ b/service/codestarconnections/api_op_UpdateRepositoryLink.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the association between your connection and a specified external Git +// repository. A repository link allows Git sync to monitor and sync changes to +// files in a specified Git repository. +func (c *Client) UpdateRepositoryLink(ctx context.Context, params *UpdateRepositoryLinkInput, optFns ...func(*Options)) (*UpdateRepositoryLinkOutput, error) { + if params == nil { + params = &UpdateRepositoryLinkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRepositoryLink", params, optFns, c.addOperationUpdateRepositoryLinkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRepositoryLinkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRepositoryLinkInput struct { + + // The ID of the repository link to be updated. + // + // This member is required. + RepositoryLinkId *string + + // The Amazon Resource Name (ARN) of the connection for the repository link to be + // updated. The updated connection ARN must have the same providerType (such as + // GitHub) as the original connection ARN for the repo link. + ConnectionArn *string + + // The Amazon Resource Name (ARN) of the encryption key for the repository link to + // be updated. + EncryptionKeyArn *string + + noSmithyDocumentSerde +} + +type UpdateRepositoryLinkOutput struct { + + // Information about the repository link to be updated. + // + // This member is required. + RepositoryLinkInfo *types.RepositoryLinkInfo + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRepositoryLinkMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateRepositoryLink{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateRepositoryLink{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateRepositoryLink"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRepositoryLinkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRepositoryLink(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRepositoryLink(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateRepositoryLink", + } +} diff --git a/service/codestarconnections/api_op_UpdateSyncBlocker.go b/service/codestarconnections/api_op_UpdateSyncBlocker.go new file mode 100644 index 00000000000..761214ff502 --- /dev/null +++ b/service/codestarconnections/api_op_UpdateSyncBlocker.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Allows you to update the status of a sync blocker, resolving the blocker and +// allowing syncing to continue. +func (c *Client) UpdateSyncBlocker(ctx context.Context, params *UpdateSyncBlockerInput, optFns ...func(*Options)) (*UpdateSyncBlockerOutput, error) { + if params == nil { + params = &UpdateSyncBlockerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSyncBlocker", params, optFns, c.addOperationUpdateSyncBlockerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSyncBlockerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSyncBlockerInput struct { + + // The ID of the sync blocker to be updated. + // + // This member is required. + Id *string + + // The reason for resolving the sync blocker. + // + // This member is required. + ResolvedReason *string + + // The name of the resource for the sync blocker to be updated. + // + // This member is required. + ResourceName *string + + // The sync type of the sync blocker to be updated. + // + // This member is required. + SyncType types.SyncConfigurationType + + noSmithyDocumentSerde +} + +type UpdateSyncBlockerOutput struct { + + // The resource name for the sync blocker. + // + // This member is required. + ResourceName *string + + // Information about the sync blocker to be updated. + // + // This member is required. + SyncBlocker *types.SyncBlocker + + // The parent resource name for the sync blocker. + ParentResourceName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSyncBlockerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateSyncBlocker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateSyncBlocker{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSyncBlocker"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSyncBlockerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSyncBlocker(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSyncBlocker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSyncBlocker", + } +} diff --git a/service/codestarconnections/api_op_UpdateSyncConfiguration.go b/service/codestarconnections/api_op_UpdateSyncConfiguration.go new file mode 100644 index 00000000000..137466a5168 --- /dev/null +++ b/service/codestarconnections/api_op_UpdateSyncConfiguration.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +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/codestarconnections/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the sync configuration for your connection and a specified external Git +// repository. +func (c *Client) UpdateSyncConfiguration(ctx context.Context, params *UpdateSyncConfigurationInput, optFns ...func(*Options)) (*UpdateSyncConfigurationOutput, error) { + if params == nil { + params = &UpdateSyncConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSyncConfiguration", params, optFns, c.addOperationUpdateSyncConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSyncConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSyncConfigurationInput struct { + + // The name of the Amazon Web Services resource for the sync configuration to be + // updated. + // + // This member is required. + ResourceName *string + + // The sync type for the sync configuration to be updated. + // + // This member is required. + SyncType types.SyncConfigurationType + + // The branch for the sync configuration to be updated. + Branch *string + + // The configuration file for the sync configuration to be updated. + ConfigFile *string + + // The ID of the repository link for the sync configuration to be updated. + RepositoryLinkId *string + + // The ARN of the IAM role for the sync configuration to be updated. + RoleArn *string + + noSmithyDocumentSerde +} + +type UpdateSyncConfigurationOutput struct { + + // The information returned for the sync configuration to be updated. + // + // This member is required. + SyncConfiguration *types.SyncConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSyncConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateSyncConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSyncConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSyncConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSyncConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSyncConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSyncConfiguration", + } +} diff --git a/service/codestarconnections/deserializers.go b/service/codestarconnections/deserializers.go index 5e73315c6ed..d668c8e933e 100644 --- a/service/codestarconnections/deserializers.go +++ b/service/codestarconnections/deserializers.go @@ -13,6 +13,7 @@ import ( 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" @@ -246,14 +247,14 @@ func awsAwsjson10_deserializeOpErrorCreateHost(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpDeleteConnection struct { +type awsAwsjson10_deserializeOpCreateRepositoryLink struct { } -func (*awsAwsjson10_deserializeOpDeleteConnection) ID() string { +func (*awsAwsjson10_deserializeOpCreateRepositoryLink) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpCreateRepositoryLink) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -267,9 +268,9 @@ func (m *awsAwsjson10_deserializeOpDeleteConnection) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteConnection(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorCreateRepositoryLink(response, &metadata) } - output := &DeleteConnectionOutput{} + output := &CreateRepositoryLinkOutput{} out.Result = output var buff [1024]byte @@ -289,7 +290,7 @@ func (m *awsAwsjson10_deserializeOpDeleteConnection) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteConnectionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentCreateRepositoryLinkOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -303,7 +304,7 @@ func (m *awsAwsjson10_deserializeOpDeleteConnection) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorCreateRepositoryLink(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -344,8 +345,26 @@ func awsAwsjson10_deserializeOpErrorDeleteConnection(response *smithyhttp.Respon } switch { - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsAwsjson10_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -357,14 +376,14 @@ func awsAwsjson10_deserializeOpErrorDeleteConnection(response *smithyhttp.Respon } } -type awsAwsjson10_deserializeOpDeleteHost struct { +type awsAwsjson10_deserializeOpCreateSyncConfiguration struct { } -func (*awsAwsjson10_deserializeOpDeleteHost) ID() string { +func (*awsAwsjson10_deserializeOpCreateSyncConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteHost) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpCreateSyncConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -378,9 +397,9 @@ func (m *awsAwsjson10_deserializeOpDeleteHost) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteHost(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorCreateSyncConfiguration(response, &metadata) } - output := &DeleteHostOutput{} + output := &CreateSyncConfigurationOutput{} out.Result = output var buff [1024]byte @@ -400,7 +419,7 @@ func (m *awsAwsjson10_deserializeOpDeleteHost) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteHostOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentCreateSyncConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -414,7 +433,7 @@ func (m *awsAwsjson10_deserializeOpDeleteHost) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteHost(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorCreateSyncConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -455,11 +474,26 @@ func awsAwsjson10_deserializeOpErrorDeleteHost(response *smithyhttp.Response, me } switch { - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ResourceUnavailableException", errorCode): - return awsAwsjson10_deserializeErrorResourceUnavailableException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsAwsjson10_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -471,14 +505,14 @@ func awsAwsjson10_deserializeOpErrorDeleteHost(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpGetConnection struct { +type awsAwsjson10_deserializeOpDeleteConnection struct { } -func (*awsAwsjson10_deserializeOpGetConnection) ID() string { +func (*awsAwsjson10_deserializeOpDeleteConnection) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpGetConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -492,9 +526,9 @@ func (m *awsAwsjson10_deserializeOpGetConnection) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorGetConnection(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteConnection(response, &metadata) } - output := &GetConnectionOutput{} + output := &DeleteConnectionOutput{} out.Result = output var buff [1024]byte @@ -514,7 +548,7 @@ func (m *awsAwsjson10_deserializeOpGetConnection) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentGetConnectionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteConnectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -528,7 +562,7 @@ func (m *awsAwsjson10_deserializeOpGetConnection) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorGetConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -572,9 +606,6 @@ func awsAwsjson10_deserializeOpErrorGetConnection(response *smithyhttp.Response, case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ResourceUnavailableException", errorCode): - return awsAwsjson10_deserializeErrorResourceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -585,14 +616,14 @@ func awsAwsjson10_deserializeOpErrorGetConnection(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpGetHost struct { +type awsAwsjson10_deserializeOpDeleteHost struct { } -func (*awsAwsjson10_deserializeOpGetHost) ID() string { +func (*awsAwsjson10_deserializeOpDeleteHost) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpGetHost) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteHost) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -606,9 +637,9 @@ func (m *awsAwsjson10_deserializeOpGetHost) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorGetHost(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteHost(response, &metadata) } - output := &GetHostOutput{} + output := &DeleteHostOutput{} out.Result = output var buff [1024]byte @@ -628,7 +659,7 @@ func (m *awsAwsjson10_deserializeOpGetHost) HandleDeserialize(ctx context.Contex return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentGetHostOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteHostOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -642,7 +673,7 @@ func (m *awsAwsjson10_deserializeOpGetHost) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsAwsjson10_deserializeOpErrorGetHost(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteHost(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -699,14 +730,14 @@ func awsAwsjson10_deserializeOpErrorGetHost(response *smithyhttp.Response, metad } } -type awsAwsjson10_deserializeOpListConnections struct { +type awsAwsjson10_deserializeOpDeleteRepositoryLink struct { } -func (*awsAwsjson10_deserializeOpListConnections) ID() string { +func (*awsAwsjson10_deserializeOpDeleteRepositoryLink) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListConnections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteRepositoryLink) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -720,9 +751,9 @@ func (m *awsAwsjson10_deserializeOpListConnections) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListConnections(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteRepositoryLink(response, &metadata) } - output := &ListConnectionsOutput{} + output := &DeleteRepositoryLinkOutput{} out.Result = output var buff [1024]byte @@ -742,7 +773,7 @@ func (m *awsAwsjson10_deserializeOpListConnections) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListConnectionsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteRepositoryLinkOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -756,7 +787,7 @@ func (m *awsAwsjson10_deserializeOpListConnections) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteRepositoryLink(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -797,9 +828,30 @@ func awsAwsjson10_deserializeOpErrorListConnections(response *smithyhttp.Respons } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("SyncConfigurationStillExistsException", errorCode): + return awsAwsjson10_deserializeErrorSyncConfigurationStillExistsException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnsupportedProviderTypeException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedProviderTypeException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -810,14 +862,14 @@ func awsAwsjson10_deserializeOpErrorListConnections(response *smithyhttp.Respons } } -type awsAwsjson10_deserializeOpListHosts struct { +type awsAwsjson10_deserializeOpDeleteSyncConfiguration struct { } -func (*awsAwsjson10_deserializeOpListHosts) ID() string { +func (*awsAwsjson10_deserializeOpDeleteSyncConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListHosts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteSyncConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -831,9 +883,9 @@ func (m *awsAwsjson10_deserializeOpListHosts) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListHosts(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteSyncConfiguration(response, &metadata) } - output := &ListHostsOutput{} + output := &DeleteSyncConfigurationOutput{} out.Result = output var buff [1024]byte @@ -853,7 +905,7 @@ func (m *awsAwsjson10_deserializeOpListHosts) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListHostsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteSyncConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -867,7 +919,7 @@ func (m *awsAwsjson10_deserializeOpListHosts) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListHosts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteSyncConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -908,6 +960,24 @@ func awsAwsjson10_deserializeOpErrorListHosts(response *smithyhttp.Response, met } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -918,14 +988,14 @@ func awsAwsjson10_deserializeOpErrorListHosts(response *smithyhttp.Response, met } } -type awsAwsjson10_deserializeOpListTagsForResource struct { +type awsAwsjson10_deserializeOpGetConnection struct { } -func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson10_deserializeOpGetConnection) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -939,9 +1009,9 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetConnection(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &GetConnectionOutput{} out.Result = output var buff [1024]byte @@ -961,7 +1031,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetConnectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -975,7 +1045,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1019,6 +1089,9 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceUnavailableException", errorCode): + return awsAwsjson10_deserializeErrorResourceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1029,14 +1102,14 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpTagResource struct { +type awsAwsjson10_deserializeOpGetHost struct { } -func (*awsAwsjson10_deserializeOpTagResource) ID() string { +func (*awsAwsjson10_deserializeOpGetHost) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetHost) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1050,9 +1123,9 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetHost(response, &metadata) } - output := &TagResourceOutput{} + output := &GetHostOutput{} out.Result = output var buff [1024]byte @@ -1072,7 +1145,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetHostOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1086,7 +1159,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetHost(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1127,12 +1200,12 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceUnavailableException", errorCode): + return awsAwsjson10_deserializeErrorResourceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1143,14 +1216,14 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpUntagResource struct { +type awsAwsjson10_deserializeOpGetRepositoryLink struct { } -func (*awsAwsjson10_deserializeOpUntagResource) ID() string { +func (*awsAwsjson10_deserializeOpGetRepositoryLink) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetRepositoryLink) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1164,9 +1237,9 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetRepositoryLink(response, &metadata) } - output := &UntagResourceOutput{} + output := &GetRepositoryLinkOutput{} out.Result = output var buff [1024]byte @@ -1186,7 +1259,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUntagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetRepositoryLinkOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1200,7 +1273,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetRepositoryLink(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1241,9 +1314,24 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1254,14 +1342,14 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpUpdateHost struct { +type awsAwsjson10_deserializeOpGetRepositorySyncStatus struct { } -func (*awsAwsjson10_deserializeOpUpdateHost) ID() string { +func (*awsAwsjson10_deserializeOpGetRepositorySyncStatus) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateHost) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetRepositorySyncStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1275,9 +1363,9 @@ func (m *awsAwsjson10_deserializeOpUpdateHost) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateHost(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetRepositorySyncStatus(response, &metadata) } - output := &UpdateHostOutput{} + output := &GetRepositorySyncStatusOutput{} out.Result = output var buff [1024]byte @@ -1297,7 +1385,7 @@ func (m *awsAwsjson10_deserializeOpUpdateHost) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateHostOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetRepositorySyncStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1311,7 +1399,7 @@ func (m *awsAwsjson10_deserializeOpUpdateHost) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateHost(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetRepositorySyncStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1352,17 +1440,20 @@ func awsAwsjson10_deserializeOpErrorUpdateHost(response *smithyhttp.Response, me } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ResourceUnavailableException", errorCode): - return awsAwsjson10_deserializeErrorResourceUnavailableException(response, errorBody) - - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson10_deserializeErrorUnsupportedOperationException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1374,46 +1465,36 @@ func awsAwsjson10_deserializeOpErrorUpdateHost(response *smithyhttp.Response, me } } -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 - } +type awsAwsjson10_deserializeOpGetResourceSyncStatus struct { +} - output := &types.ConflictException{} - err := awsAwsjson10_deserializeDocumentConflictException(&output, shape) +func (*awsAwsjson10_deserializeOpGetResourceSyncStatus) ID() string { + return "OperationDeserializer" +} +func (m *awsAwsjson10_deserializeOpGetResourceSyncStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output -} + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorGetResourceSyncStatus(response, &metadata) + } + output := &GetResourceSyncStatusOutput{} + out.Result = output -func awsAwsjson10_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -1424,12 +1505,10 @@ func awsAwsjson10_deserializeErrorLimitExceededException(response *smithyhttp.Re Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.LimitExceededException{} - err := awsAwsjson10_deserializeDocumentLimitExceededException(&output, shape) - + err = awsAwsjson10_deserializeOpDocumentGetResourceSyncStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1437,34 +1516,34 @@ func awsAwsjson10_deserializeErrorLimitExceededException(response *smithyhttp.Re Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeOpErrorGetResourceSyncStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ResourceNotFoundException{} - err := awsAwsjson10_deserializeDocumentResourceNotFoundException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1476,14 +1555,69 @@ func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - return output -} + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + 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("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetSyncBlockerSummary struct { +} + +func (*awsAwsjson10_deserializeOpGetSyncBlockerSummary) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetSyncBlockerSummary) HandleDeserialize(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_deserializeOpErrorGetSyncBlockerSummary(response, &metadata) + } + output := &GetSyncBlockerSummaryOutput{} + out.Result = output -func awsAwsjson10_deserializeErrorResourceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -1494,12 +1628,45 @@ func awsAwsjson10_deserializeErrorResourceUnavailableException(response *smithyh Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.ResourceUnavailableException{} - err := awsAwsjson10_deserializeDocumentResourceUnavailableException(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetSyncBlockerSummaryOutput(&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_deserializeOpErrorGetSyncBlockerSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1511,18 +1678,119 @@ func awsAwsjson10_deserializeErrorResourceUnavailableException(response *smithyh } errorBody.Seek(0, io.SeekStart) - return output + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + 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("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsAwsjson10_deserializeErrorUnsupportedOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +type awsAwsjson10_deserializeOpGetSyncConfiguration struct { +} + +func (*awsAwsjson10_deserializeOpGetSyncConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetSyncConfiguration) HandleDeserialize(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_deserializeOpErrorGetSyncConfiguration(response, &metadata) + } + output := &GetSyncConfigurationOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} 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_deserializeOpDocumentGetSyncConfigurationOutput(&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_deserializeOpErrorGetSyncConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1532,9 +1800,84 @@ func awsAwsjson10_deserializeErrorUnsupportedOperationException(response *smithy return err } - output := &types.UnsupportedOperationException{} - err := awsAwsjson10_deserializeDocumentUnsupportedOperationException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListConnections struct { +} + +func (*awsAwsjson10_deserializeOpListConnections) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListConnections) HandleDeserialize(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_deserializeOpErrorListConnections(response, &metadata) + } + output := &ListConnectionsOutput{} + 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_deserializeOpDocumentListConnectionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1542,14 +1885,4004 @@ func awsAwsjson10_deserializeErrorUnsupportedOperationException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err - } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListHosts struct { +} + +func (*awsAwsjson10_deserializeOpListHosts) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListHosts) HandleDeserialize(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_deserializeOpErrorListHosts(response, &metadata) + } + output := &ListHostsOutput{} + 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_deserializeOpDocumentListHostsOutput(&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_deserializeOpErrorListHosts(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListRepositoryLinks struct { +} + +func (*awsAwsjson10_deserializeOpListRepositoryLinks) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListRepositoryLinks) HandleDeserialize(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_deserializeOpErrorListRepositoryLinks(response, &metadata) + } + output := &ListRepositoryLinksOutput{} + 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_deserializeOpDocumentListRepositoryLinksOutput(&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_deserializeOpErrorListRepositoryLinks(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListRepositorySyncDefinitions struct { +} + +func (*awsAwsjson10_deserializeOpListRepositorySyncDefinitions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListRepositorySyncDefinitions) HandleDeserialize(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_deserializeOpErrorListRepositorySyncDefinitions(response, &metadata) + } + output := &ListRepositorySyncDefinitionsOutput{} + 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_deserializeOpDocumentListRepositorySyncDefinitionsOutput(&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_deserializeOpErrorListRepositorySyncDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListSyncConfigurations struct { +} + +func (*awsAwsjson10_deserializeOpListSyncConfigurations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListSyncConfigurations) HandleDeserialize(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_deserializeOpErrorListSyncConfigurations(response, &metadata) + } + output := &ListSyncConfigurationsOutput{} + 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_deserializeOpDocumentListSyncConfigurationsOutput(&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_deserializeOpErrorListSyncConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateHost struct { +} + +func (*awsAwsjson10_deserializeOpUpdateHost) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateHost) HandleDeserialize(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_deserializeOpErrorUpdateHost(response, &metadata) + } + output := &UpdateHostOutput{} + 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_deserializeOpDocumentUpdateHostOutput(&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_deserializeOpErrorUpdateHost(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceUnavailableException", errorCode): + return awsAwsjson10_deserializeErrorResourceUnavailableException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateRepositoryLink struct { +} + +func (*awsAwsjson10_deserializeOpUpdateRepositoryLink) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateRepositoryLink) HandleDeserialize(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_deserializeOpErrorUpdateRepositoryLink(response, &metadata) + } + output := &UpdateRepositoryLinkOutput{} + 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_deserializeOpDocumentUpdateRepositoryLinkOutput(&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_deserializeOpErrorUpdateRepositoryLink(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConditionalCheckFailedException", errorCode): + return awsAwsjson10_deserializeErrorConditionalCheckFailedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(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("UpdateOutOfSyncException", errorCode): + return awsAwsjson10_deserializeErrorUpdateOutOfSyncException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateSyncBlocker struct { +} + +func (*awsAwsjson10_deserializeOpUpdateSyncBlocker) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateSyncBlocker) HandleDeserialize(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_deserializeOpErrorUpdateSyncBlocker(response, &metadata) + } + output := &UpdateSyncBlockerOutput{} + 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_deserializeOpDocumentUpdateSyncBlockerOutput(&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_deserializeOpErrorUpdateSyncBlocker(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("RetryLatestCommitFailedException", errorCode): + return awsAwsjson10_deserializeErrorRetryLatestCommitFailedException(response, errorBody) + + case strings.EqualFold("SyncBlockerDoesNotExistException", errorCode): + return awsAwsjson10_deserializeErrorSyncBlockerDoesNotExistException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateSyncConfiguration struct { +} + +func (*awsAwsjson10_deserializeOpUpdateSyncConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateSyncConfiguration) HandleDeserialize(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_deserializeOpErrorUpdateSyncConfiguration(response, &metadata) + } + output := &UpdateSyncConfigurationOutput{} + 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_deserializeOpDocumentUpdateSyncConfigurationOutput(&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_deserializeOpErrorUpdateSyncConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson10_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson10_deserializeErrorInvalidInputException(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("UpdateOutOfSyncException", errorCode): + return awsAwsjson10_deserializeErrorUpdateOutOfSyncException(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_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_deserializeErrorConditionalCheckFailedException(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.ConditionalCheckFailedException{} + err := awsAwsjson10_deserializeDocumentConditionalCheckFailedException(&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_deserializeErrorInvalidInputException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidInputException{} + err := awsAwsjson10_deserializeDocumentInvalidInputException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.LimitExceededException{} + err := awsAwsjson10_deserializeDocumentLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceAlreadyExistsException{} + err := awsAwsjson10_deserializeDocumentResourceAlreadyExistsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func 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_deserializeErrorResourceUnavailableException(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.ResourceUnavailableException{} + err := awsAwsjson10_deserializeDocumentResourceUnavailableException(&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_deserializeErrorRetryLatestCommitFailedException(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.RetryLatestCommitFailedException{} + err := awsAwsjson10_deserializeDocumentRetryLatestCommitFailedException(&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_deserializeErrorSyncBlockerDoesNotExistException(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.SyncBlockerDoesNotExistException{} + err := awsAwsjson10_deserializeDocumentSyncBlockerDoesNotExistException(&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_deserializeErrorSyncConfigurationStillExistsException(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.SyncConfigurationStillExistsException{} + err := awsAwsjson10_deserializeDocumentSyncConfigurationStillExistsException(&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_deserializeErrorUnsupportedOperationException(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.UnsupportedOperationException{} + err := awsAwsjson10_deserializeDocumentUnsupportedOperationException(&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_deserializeErrorUnsupportedProviderTypeException(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.UnsupportedProviderTypeException{} + err := awsAwsjson10_deserializeDocumentUnsupportedProviderTypeException(&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_deserializeErrorUpdateOutOfSyncException(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.UpdateOutOfSyncException{} + err := awsAwsjson10_deserializeDocumentUpdateOutOfSyncException(&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 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_deserializeDocumentConditionalCheckFailedException(v **types.ConditionalCheckFailedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ConditionalCheckFailedException + if *v == nil { + sv = &types.ConditionalCheckFailedException{} + } 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_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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentConnection(v **types.Connection, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Connection + if *v == nil { + sv = &types.Connection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConnectionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectionArn to be of type string, got %T instead", value) + } + sv.ConnectionArn = ptr.String(jtv) + } + + case "ConnectionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectionName to be of type string, got %T instead", value) + } + sv.ConnectionName = ptr.String(jtv) + } + + case "ConnectionStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectionStatus to be of type string, got %T instead", value) + } + sv.ConnectionStatus = types.ConnectionStatus(jtv) + } + + case "HostArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HostArn to be of type string, got %T instead", value) + } + sv.HostArn = ptr.String(jtv) + } + + case "OwnerAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.OwnerAccountId = ptr.String(jtv) + } + + case "ProviderType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) + } + sv.ProviderType = types.ProviderType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentConnectionList(v *[]types.Connection, 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.Connection + if *v == nil { + cv = []types.Connection{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Connection + destAddr := &col + if err := awsAwsjson10_deserializeDocumentConnection(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentHost(v **types.Host, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Host + if *v == nil { + sv = &types.Host{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HostArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HostArn to be of type string, got %T instead", value) + } + sv.HostArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HostName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ProviderEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.ProviderEndpoint = ptr.String(jtv) + } + + case "ProviderType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) + } + sv.ProviderType = types.ProviderType(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HostStatus to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HostStatusMessage to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + case "VpcConfiguration": + if err := awsAwsjson10_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentHostList(v *[]types.Host, 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.Host + if *v == nil { + cv = []types.Host{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Host + destAddr := &col + if err := awsAwsjson10_deserializeDocumentHost(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidInputException + if *v == nil { + sv = &types.InvalidInputException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "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_deserializeDocumentLatestSyncBlockerList(v *[]types.SyncBlocker, 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.SyncBlocker + if *v == nil { + cv = []types.SyncBlocker{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SyncBlocker + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSyncBlocker(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRepositoryLinkInfo(v **types.RepositoryLinkInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RepositoryLinkInfo + if *v == nil { + sv = &types.RepositoryLinkInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConnectionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectionArn to be of type string, got %T instead", value) + } + sv.ConnectionArn = ptr.String(jtv) + } + + case "EncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.EncryptionKeyArn = ptr.String(jtv) + } + + case "OwnerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OwnerId to be of type string, got %T instead", value) + } + sv.OwnerId = ptr.String(jtv) + } + + case "ProviderType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) + } + sv.ProviderType = types.ProviderType(jtv) + } + + case "RepositoryLinkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryLinkArn to be of type string, got %T instead", value) + } + sv.RepositoryLinkArn = ptr.String(jtv) + } + + case "RepositoryLinkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryLinkId to be of type string, got %T instead", value) + } + sv.RepositoryLinkId = ptr.String(jtv) + } + + case "RepositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRepositoryLinkList(v *[]types.RepositoryLinkInfo, 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.RepositoryLinkInfo + if *v == nil { + cv = []types.RepositoryLinkInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RepositoryLinkInfo + destAddr := &col + if err := awsAwsjson10_deserializeDocumentRepositoryLinkInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentRepositorySyncAttempt(v **types.RepositorySyncAttempt, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RepositorySyncAttempt + if *v == nil { + sv = &types.RepositorySyncAttempt{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Events": + if err := awsAwsjson10_deserializeDocumentRepositorySyncEventList(&sv.Events, value); err != nil { + return err + } + + case "StartedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositorySyncStatus to be of type string, got %T instead", value) + } + sv.Status = types.RepositorySyncStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRepositorySyncDefinition(v **types.RepositorySyncDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RepositorySyncDefinition + if *v == nil { + sv = &types.RepositorySyncDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Branch": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) + } + sv.Branch = ptr.String(jtv) + } + + case "Directory": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Directory to be of type string, got %T instead", value) + } + sv.Directory = ptr.String(jtv) + } + + case "Parent": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Parent to be of type string, got %T instead", value) + } + sv.Parent = ptr.String(jtv) + } + + case "Target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Target to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRepositorySyncDefinitionList(v *[]types.RepositorySyncDefinition, 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.RepositorySyncDefinition + if *v == nil { + cv = []types.RepositorySyncDefinition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RepositorySyncDefinition + destAddr := &col + if err := awsAwsjson10_deserializeDocumentRepositorySyncDefinition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentRepositorySyncEvent(v **types.RepositorySyncEvent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RepositorySyncEvent + if *v == nil { + sv = &types.RepositorySyncEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Event": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Event to be of type string, got %T instead", value) + } + sv.Event = ptr.String(jtv) + } + + case "ExternalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + + case "Time": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Time = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Type to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentRepositorySyncEventList(v *[]types.RepositorySyncEvent, 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.RepositorySyncEvent + if *v == nil { + cv = []types.RepositorySyncEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RepositorySyncEvent + destAddr := &col + if err := awsAwsjson10_deserializeDocumentRepositorySyncEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResourceAlreadyExistsException + if *v == nil { + sv = &types.ResourceAlreadyExistsException{} + } 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_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_deserializeDocumentResourceSyncAttempt(v **types.ResourceSyncAttempt, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResourceSyncAttempt + if *v == nil { + sv = &types.ResourceSyncAttempt{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Events": + if err := awsAwsjson10_deserializeDocumentResourceSyncEventList(&sv.Events, value); err != nil { + return err + } + + case "InitialRevision": + if err := awsAwsjson10_deserializeDocumentRevision(&sv.InitialRevision, value); err != nil { + return err + } + + case "StartedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceSyncStatus to be of type string, got %T instead", value) + } + sv.Status = types.ResourceSyncStatus(jtv) + } + + case "Target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Target to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + case "TargetRevision": + if err := awsAwsjson10_deserializeDocumentRevision(&sv.TargetRevision, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceSyncEvent(v **types.ResourceSyncEvent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResourceSyncEvent + if *v == nil { + sv = &types.ResourceSyncEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Event": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Event to be of type string, got %T instead", value) + } + sv.Event = ptr.String(jtv) + } + + case "ExternalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + + case "Time": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Time = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Type to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceSyncEventList(v *[]types.ResourceSyncEvent, 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.ResourceSyncEvent + if *v == nil { + cv = []types.ResourceSyncEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceSyncEvent + destAddr := &col + if err := awsAwsjson10_deserializeDocumentResourceSyncEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentResourceUnavailableException(v **types.ResourceUnavailableException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResourceUnavailableException + if *v == nil { + sv = &types.ResourceUnavailableException{} + } 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_deserializeDocumentRetryLatestCommitFailedException(v **types.RetryLatestCommitFailedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RetryLatestCommitFailedException + if *v == nil { + sv = &types.RetryLatestCommitFailedException{} + } 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_deserializeDocumentRevision(v **types.Revision, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Revision + if *v == nil { + sv = &types.Revision{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Branch": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) + } + sv.Branch = ptr.String(jtv) + } + + case "Directory": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Directory to be of type string, got %T instead", value) + } + sv.Directory = ptr.String(jtv) + } + + case "OwnerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OwnerId to be of type string, got %T instead", value) + } + sv.OwnerId = ptr.String(jtv) + } + + case "ProviderType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) + } + sv.ProviderType = types.ProviderType(jtv) + } + + case "RepositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + + case "Sha": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SHA to be of type string, got %T instead", value) + } + sv.Sha = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSecurityGroupIds(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 SecurityGroupId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSubnetIds(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 SubnetId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncBlocker(v **types.SyncBlocker, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SyncBlocker + if *v == nil { + sv = &types.SyncBlocker{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Contexts": + if err := awsAwsjson10_deserializeDocumentSyncBlockerContextList(&sv.Contexts, value); err != nil { + return err + } + + 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 "CreatedReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreatedReason to be of type string, got %T instead", value) + } + sv.CreatedReason = 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 "ResolvedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ResolvedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "ResolvedReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResolvedReason to be of type string, got %T instead", value) + } + sv.ResolvedReason = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BlockerStatus to be of type string, got %T instead", value) + } + sv.Status = types.BlockerStatus(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BlockerType to be of type string, got %T instead", value) + } + sv.Type = types.BlockerType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncBlockerContext(v **types.SyncBlockerContext, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SyncBlockerContext + if *v == nil { + sv = &types.SyncBlockerContext{} + } 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 SyncBlockerContextKey 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 SyncBlockerContextValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncBlockerContextList(v *[]types.SyncBlockerContext, 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.SyncBlockerContext + if *v == nil { + cv = []types.SyncBlockerContext{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SyncBlockerContext + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSyncBlockerContext(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncBlockerDoesNotExistException(v **types.SyncBlockerDoesNotExistException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SyncBlockerDoesNotExistException + if *v == nil { + sv = &types.SyncBlockerDoesNotExistException{} + } 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_deserializeDocumentSyncBlockerSummary(v **types.SyncBlockerSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SyncBlockerSummary + if *v == nil { + sv = &types.SyncBlockerSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LatestBlockers": + if err := awsAwsjson10_deserializeDocumentLatestSyncBlockerList(&sv.LatestBlockers, value); err != nil { + return err + } + + case "ParentResourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.ParentResourceName = ptr.String(jtv) + } + + case "ResourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncConfiguration(v **types.SyncConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SyncConfiguration + if *v == nil { + sv = &types.SyncConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Branch": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) + } + sv.Branch = ptr.String(jtv) + } + + case "ConfigFile": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeploymentFilePath to be of type string, got %T instead", value) + } + sv.ConfigFile = ptr.String(jtv) + } + + case "OwnerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OwnerId to be of type string, got %T instead", value) + } + sv.OwnerId = ptr.String(jtv) + } + + case "ProviderType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) + } + sv.ProviderType = types.ProviderType(jtv) + } + + case "RepositoryLinkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryLinkId to be of type string, got %T instead", value) + } + sv.RepositoryLinkId = ptr.String(jtv) + } + + case "RepositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + + case "ResourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "SyncType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncConfigurationType to be of type string, got %T instead", value) + } + sv.SyncType = types.SyncConfigurationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncConfigurationList(v *[]types.SyncConfiguration, 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.SyncConfiguration + if *v == nil { + cv = []types.SyncConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SyncConfiguration + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSyncConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncConfigurationStillExistsException(v **types.SyncConfigurationStillExistsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SyncConfigurationStillExistsException + if *v == nil { + sv = &types.SyncConfigurationStillExistsException{} + } 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_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) - errorBody.Seek(0, io.SeekStart) - return output + } + *v = cv + return nil } -func awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsAwsjson10_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1562,9 +5895,9 @@ func awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.ThrottlingException if *v == nil { - sv = &types.ConflictException{} + sv = &types.ThrottlingException{} } else { sv = *v } @@ -1589,7 +5922,7 @@ func awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsAwsjson10_deserializeDocumentConnection(v **types.Connection, value interface{}) error { +func awsAwsjson10_deserializeDocumentUnsupportedOperationException(v **types.UnsupportedOperationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1602,67 +5935,161 @@ func awsAwsjson10_deserializeDocumentConnection(v **types.Connection, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Connection + var sv *types.UnsupportedOperationException if *v == nil { - sv = &types.Connection{} + sv = &types.UnsupportedOperationException{} } else { sv = *v } for key, value := range shape { switch key { - case "ConnectionArn": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ConnectionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.ConnectionArn = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "ConnectionName": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentUnsupportedProviderTypeException(v **types.UnsupportedProviderTypeException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedProviderTypeException + if *v == nil { + sv = &types.UnsupportedProviderTypeException{} + } 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 ConnectionName to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.ConnectionName = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "ConnectionStatus": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentUpdateOutOfSyncException(v **types.UpdateOutOfSyncException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.UpdateOutOfSyncException + if *v == nil { + sv = &types.UpdateOutOfSyncException{} + } 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 ConnectionStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.ConnectionStatus = types.ConnectionStatus(jtv) + sv.Message = ptr.String(jtv) } - case "HostArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HostArn to be of type string, got %T instead", value) - } - sv.HostArn = ptr.String(jtv) + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentVpcConfiguration(v **types.VpcConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.VpcConfiguration + if *v == nil { + sv = &types.VpcConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SecurityGroupIds": + if err := awsAwsjson10_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { + return err } - case "OwnerAccountId": + case "SubnetIds": + if err := awsAwsjson10_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { + return err + } + + case "TlsCertificate": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected TlsCertificate to be of type string, got %T instead", value) } - sv.OwnerAccountId = ptr.String(jtv) + sv.TlsCertificate = ptr.String(jtv) } - case "ProviderType": + case "VpcId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) + return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) } - sv.ProviderType = types.ProviderType(jtv) + sv.VpcId = ptr.String(jtv) } default: @@ -1674,7 +6101,7 @@ func awsAwsjson10_deserializeDocumentConnection(v **types.Connection, value inte return nil } -func awsAwsjson10_deserializeDocumentConnectionList(v *[]types.Connection, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentCreateConnectionOutput(v **CreateConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1682,33 +6109,44 @@ func awsAwsjson10_deserializeDocumentConnectionList(v *[]types.Connection, value return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Connection + var sv *CreateConnectionOutput if *v == nil { - cv = []types.Connection{} + sv = &CreateConnectionOutput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Connection - destAddr := &col - if err := awsAwsjson10_deserializeDocumentConnection(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "ConnectionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectionArn to be of type string, got %T instead", value) + } + sv.ConnectionArn = ptr.String(jtv) + } + + case "Tags": + if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentHost(v **types.Host, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentCreateHostOutput(v **CreateHostOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1721,9 +6159,9 @@ func awsAwsjson10_deserializeDocumentHost(v **types.Host, value interface{}) err return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Host + var sv *CreateHostOutput if *v == nil { - sv = &types.Host{} + sv = &CreateHostOutput{} } else { sv = *v } @@ -1739,53 +6177,44 @@ func awsAwsjson10_deserializeDocumentHost(v **types.Host, value interface{}) err sv.HostArn = ptr.String(jtv) } - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HostName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "Tags": + if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err } - case "ProviderEndpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Url to be of type string, got %T instead", value) - } - sv.ProviderEndpoint = ptr.String(jtv) - } + default: + _, _ = key, value - case "ProviderType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) - } - sv.ProviderType = types.ProviderType(jtv) - } + } + } + *v = sv + return nil +} - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HostStatus to be of type string, got %T instead", value) - } - sv.Status = ptr.String(jtv) - } +func awsAwsjson10_deserializeOpDocumentCreateRepositoryLinkOutput(v **CreateRepositoryLinkOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "StatusMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HostStatusMessage to be of type string, got %T instead", value) - } - sv.StatusMessage = ptr.String(jtv) - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateRepositoryLinkOutput + if *v == nil { + sv = &CreateRepositoryLinkOutput{} + } else { + sv = *v + } - case "VpcConfiguration": - if err := awsAwsjson10_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, value); err != nil { + for key, value := range shape { + switch key { + case "RepositoryLinkInfo": + if err := awsAwsjson10_deserializeDocumentRepositoryLinkInfo(&sv.RepositoryLinkInfo, value); err != nil { return err } @@ -1798,7 +6227,7 @@ func awsAwsjson10_deserializeDocumentHost(v **types.Host, value interface{}) err return nil } -func awsAwsjson10_deserializeDocumentHostList(v *[]types.Host, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentCreateSyncConfigurationOutput(v **CreateSyncConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1806,33 +6235,35 @@ func awsAwsjson10_deserializeDocumentHostList(v *[]types.Host, value interface{} return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Host + var sv *CreateSyncConfigurationOutput if *v == nil { - cv = []types.Host{} + sv = &CreateSyncConfigurationOutput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Host - destAddr := &col - if err := awsAwsjson10_deserializeDocumentHost(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "SyncConfiguration": + if err := awsAwsjson10_deserializeDocumentSyncConfiguration(&sv.SyncConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDeleteConnectionOutput(v **DeleteConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1845,24 +6276,15 @@ func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExcee return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LimitExceededException + var sv *DeleteConnectionOutput if *v == nil { - sv = &types.LimitExceededException{} + sv = &DeleteConnectionOutput{} } 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 @@ -1872,7 +6294,7 @@ func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExcee return nil } -func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDeleteHostOutput(v **DeleteHostOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1885,24 +6307,15 @@ func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException + var sv *DeleteHostOutput if *v == nil { - sv = &types.ResourceNotFoundException{} + sv = &DeleteHostOutput{} } 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 @@ -1912,7 +6325,7 @@ func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } -func awsAwsjson10_deserializeDocumentResourceUnavailableException(v **types.ResourceUnavailableException, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDeleteRepositoryLinkOutput(v **DeleteRepositoryLinkOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1925,24 +6338,15 @@ func awsAwsjson10_deserializeDocumentResourceUnavailableException(v **types.Reso return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceUnavailableException + var sv *DeleteRepositoryLinkOutput if *v == nil { - sv = &types.ResourceUnavailableException{} + sv = &DeleteRepositoryLinkOutput{} } 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 @@ -1952,7 +6356,7 @@ func awsAwsjson10_deserializeDocumentResourceUnavailableException(v **types.Reso return nil } -func awsAwsjson10_deserializeDocumentSecurityGroupIds(v *[]string, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDeleteSyncConfigurationOutput(v **DeleteSyncConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1960,35 +6364,30 @@ func awsAwsjson10_deserializeDocumentSecurityGroupIds(v *[]string, value interfa return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *DeleteSyncConfigurationOutput if *v == nil { - cv = []string{} + sv = &DeleteSyncConfigurationOutput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SecurityGroupId to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) + for key, value := range shape { + switch key { + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentSubnetIds(v *[]string, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentGetConnectionOutput(v **GetConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1996,35 +6395,35 @@ func awsAwsjson10_deserializeDocumentSubnetIds(v *[]string, value interface{}) e return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *GetConnectionOutput if *v == nil { - cv = []string{} + sv = &GetConnectionOutput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "Connection": + if err := awsAwsjson10_deserializeDocumentConnection(&sv.Connection, value); err != nil { + return err } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentGetHostOutput(v **GetHostOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2037,31 +6436,54 @@ func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Tag + var sv *GetHostOutput if *v == nil { - sv = &types.Tag{} + sv = &GetHostOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Key": + case "Name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + return fmt.Errorf("expected HostName to be of type string, got %T instead", value) } - sv.Key = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "Value": + case "ProviderEndpoint": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + return fmt.Errorf("expected Url to be of type string, got %T instead", value) } - sv.Value = ptr.String(jtv) + sv.ProviderEndpoint = ptr.String(jtv) + } + + case "ProviderType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) + } + sv.ProviderType = types.ProviderType(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HostStatus to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "VpcConfiguration": + if err := awsAwsjson10_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, value); err != nil { + return err } default: @@ -2073,7 +6495,7 @@ func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error return nil } -func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentGetRepositoryLinkOutput(v **GetRepositoryLinkOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2081,33 +6503,117 @@ func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Tag + var sv *GetRepositoryLinkOutput if *v == nil { - cv = []types.Tag{} + sv = &GetRepositoryLinkOutput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Tag - destAddr := &col - if err := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil { - return err + for key, value := range shape { + switch key { + case "RepositoryLinkInfo": + if err := awsAwsjson10_deserializeDocumentRepositoryLinkInfo(&sv.RepositoryLinkInfo, value); err != nil { + return err + } + + default: + _, _ = key, value + } - col = *destAddr - cv = append(cv, col) + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetRepositorySyncStatusOutput(v **GetRepositorySyncStatusOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetRepositorySyncStatusOutput + if *v == nil { + sv = &GetRepositorySyncStatusOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LatestSync": + if err := awsAwsjson10_deserializeDocumentRepositorySyncAttempt(&sv.LatestSync, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentGetResourceSyncStatusOutput(v **GetResourceSyncStatusOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetResourceSyncStatusOutput + if *v == nil { + sv = &GetResourceSyncStatusOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DesiredState": + if err := awsAwsjson10_deserializeDocumentRevision(&sv.DesiredState, value); err != nil { + return err + } + + case "LatestSuccessfulSync": + if err := awsAwsjson10_deserializeDocumentResourceSyncAttempt(&sv.LatestSuccessfulSync, value); err != nil { + return err + } + + case "LatestSync": + if err := awsAwsjson10_deserializeDocumentResourceSyncAttempt(&sv.LatestSync, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentUnsupportedOperationException(v **types.UnsupportedOperationException, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentGetSyncBlockerSummaryOutput(v **GetSyncBlockerSummaryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2120,22 +6626,18 @@ func awsAwsjson10_deserializeDocumentUnsupportedOperationException(v **types.Uns return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnsupportedOperationException + var sv *GetSyncBlockerSummaryOutput if *v == nil { - sv = &types.UnsupportedOperationException{} + sv = &GetSyncBlockerSummaryOutput{} } 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) + case "SyncBlockerSummary": + if err := awsAwsjson10_deserializeDocumentSyncBlockerSummary(&sv.SyncBlockerSummary, value); err != nil { + return err } default: @@ -2147,7 +6649,7 @@ func awsAwsjson10_deserializeDocumentUnsupportedOperationException(v **types.Uns return nil } -func awsAwsjson10_deserializeDocumentVpcConfiguration(v **types.VpcConfiguration, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentGetSyncConfigurationOutput(v **GetSyncConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2160,43 +6662,20 @@ func awsAwsjson10_deserializeDocumentVpcConfiguration(v **types.VpcConfiguration return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.VpcConfiguration + var sv *GetSyncConfigurationOutput if *v == nil { - sv = &types.VpcConfiguration{} + sv = &GetSyncConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "SecurityGroupIds": - if err := awsAwsjson10_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { - return err - } - - case "SubnetIds": - if err := awsAwsjson10_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil { + case "SyncConfiguration": + if err := awsAwsjson10_deserializeDocumentSyncConfiguration(&sv.SyncConfiguration, value); err != nil { return err } - case "TlsCertificate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TlsCertificate to be of type string, got %T instead", value) - } - sv.TlsCertificate = ptr.String(jtv) - } - - case "VpcId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) - } - sv.VpcId = ptr.String(jtv) - } - default: _, _ = key, value @@ -2206,7 +6685,7 @@ func awsAwsjson10_deserializeDocumentVpcConfiguration(v **types.VpcConfiguration return nil } -func awsAwsjson10_deserializeOpDocumentCreateConnectionOutput(v **CreateConnectionOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentListConnectionsOutput(v **ListConnectionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2219,27 +6698,27 @@ func awsAwsjson10_deserializeOpDocumentCreateConnectionOutput(v **CreateConnecti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateConnectionOutput + var sv *ListConnectionsOutput if *v == nil { - sv = &CreateConnectionOutput{} + sv = &ListConnectionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ConnectionArn": + case "Connections": + if err := awsAwsjson10_deserializeDocumentConnectionList(&sv.Connections, value); err != nil { + return err + } + + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ConnectionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.ConnectionArn = ptr.String(jtv) - } - - case "Tags": - if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } default: @@ -2251,7 +6730,7 @@ func awsAwsjson10_deserializeOpDocumentCreateConnectionOutput(v **CreateConnecti return nil } -func awsAwsjson10_deserializeOpDocumentCreateHostOutput(v **CreateHostOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentListHostsOutput(v **ListHostsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2264,27 +6743,27 @@ func awsAwsjson10_deserializeOpDocumentCreateHostOutput(v **CreateHostOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateHostOutput + var sv *ListHostsOutput if *v == nil { - sv = &CreateHostOutput{} + sv = &ListHostsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "HostArn": + case "Hosts": + if err := awsAwsjson10_deserializeDocumentHostList(&sv.Hosts, value); err != nil { + return err + } + + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected HostArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.HostArn = ptr.String(jtv) - } - - case "Tags": - if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } default: @@ -2296,7 +6775,7 @@ func awsAwsjson10_deserializeOpDocumentCreateHostOutput(v **CreateHostOutput, va return nil } -func awsAwsjson10_deserializeOpDocumentDeleteConnectionOutput(v **DeleteConnectionOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentListRepositoryLinksOutput(v **ListRepositoryLinksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2309,15 +6788,29 @@ func awsAwsjson10_deserializeOpDocumentDeleteConnectionOutput(v **DeleteConnecti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteConnectionOutput + var sv *ListRepositoryLinksOutput if *v == nil { - sv = &DeleteConnectionOutput{} + sv = &ListRepositoryLinksOutput{} } 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 SharpNextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "RepositoryLinks": + if err := awsAwsjson10_deserializeDocumentRepositoryLinkList(&sv.RepositoryLinks, value); err != nil { + return err + } + default: _, _ = key, value @@ -2327,7 +6820,7 @@ func awsAwsjson10_deserializeOpDocumentDeleteConnectionOutput(v **DeleteConnecti return nil } -func awsAwsjson10_deserializeOpDocumentDeleteHostOutput(v **DeleteHostOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentListRepositorySyncDefinitionsOutput(v **ListRepositorySyncDefinitionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2340,15 +6833,29 @@ func awsAwsjson10_deserializeOpDocumentDeleteHostOutput(v **DeleteHostOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteHostOutput + var sv *ListRepositorySyncDefinitionsOutput if *v == nil { - sv = &DeleteHostOutput{} + sv = &ListRepositorySyncDefinitionsOutput{} } 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 SharpNextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "RepositorySyncDefinitions": + if err := awsAwsjson10_deserializeDocumentRepositorySyncDefinitionList(&sv.RepositorySyncDefinitions, value); err != nil { + return err + } + default: _, _ = key, value @@ -2358,7 +6865,7 @@ func awsAwsjson10_deserializeOpDocumentDeleteHostOutput(v **DeleteHostOutput, va return nil } -func awsAwsjson10_deserializeOpDocumentGetConnectionOutput(v **GetConnectionOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentListSyncConfigurationsOutput(v **ListSyncConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2371,17 +6878,26 @@ func awsAwsjson10_deserializeOpDocumentGetConnectionOutput(v **GetConnectionOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetConnectionOutput + var sv *ListSyncConfigurationsOutput if *v == nil { - sv = &GetConnectionOutput{} + sv = &ListSyncConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Connection": - if err := awsAwsjson10_deserializeDocumentConnection(&sv.Connection, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SharpNextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SyncConfigurations": + if err := awsAwsjson10_deserializeDocumentSyncConfigurationList(&sv.SyncConfigurations, value); err != nil { return err } @@ -2394,7 +6910,7 @@ func awsAwsjson10_deserializeOpDocumentGetConnectionOutput(v **GetConnectionOutp return nil } -func awsAwsjson10_deserializeOpDocumentGetHostOutput(v **GetHostOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2407,53 +6923,17 @@ func awsAwsjson10_deserializeOpDocumentGetHostOutput(v **GetHostOutput, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetHostOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &GetHostOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HostName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "ProviderEndpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Url to be of type string, got %T instead", value) - } - sv.ProviderEndpoint = ptr.String(jtv) - } - - case "ProviderType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProviderType to be of type string, got %T instead", value) - } - sv.ProviderType = types.ProviderType(jtv) - } - - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HostStatus to be of type string, got %T instead", value) - } - sv.Status = ptr.String(jtv) - } - - case "VpcConfiguration": - if err := awsAwsjson10_deserializeDocumentVpcConfiguration(&sv.VpcConfiguration, value); err != nil { + case "Tags": + if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } @@ -2466,7 +6946,7 @@ func awsAwsjson10_deserializeOpDocumentGetHostOutput(v **GetHostOutput, value in return nil } -func awsAwsjson10_deserializeOpDocumentListConnectionsOutput(v **ListConnectionsOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2479,29 +6959,15 @@ func awsAwsjson10_deserializeOpDocumentListConnectionsOutput(v **ListConnections return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListConnectionsOutput + var sv *TagResourceOutput if *v == nil { - sv = &ListConnectionsOutput{} + sv = &TagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Connections": - if err := awsAwsjson10_deserializeDocumentConnectionList(&sv.Connections, 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 @@ -2511,7 +6977,7 @@ func awsAwsjson10_deserializeOpDocumentListConnectionsOutput(v **ListConnections return nil } -func awsAwsjson10_deserializeOpDocumentListHostsOutput(v **ListHostsOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2524,29 +6990,15 @@ func awsAwsjson10_deserializeOpDocumentListHostsOutput(v **ListHostsOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListHostsOutput + var sv *UntagResourceOutput if *v == nil { - sv = &ListHostsOutput{} + sv = &UntagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Hosts": - if err := awsAwsjson10_deserializeDocumentHostList(&sv.Hosts, 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 @@ -2556,7 +7008,7 @@ func awsAwsjson10_deserializeOpDocumentListHostsOutput(v **ListHostsOutput, valu return nil } -func awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentUpdateHostOutput(v **UpdateHostOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2569,20 +7021,15 @@ func awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *UpdateHostOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &UpdateHostOutput{} } 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 @@ -2592,7 +7039,7 @@ func awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentUpdateRepositoryLinkOutput(v **UpdateRepositoryLinkOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2605,15 +7052,20 @@ func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *TagResourceOutput + var sv *UpdateRepositoryLinkOutput if *v == nil { - sv = &TagResourceOutput{} + sv = &UpdateRepositoryLinkOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "RepositoryLinkInfo": + if err := awsAwsjson10_deserializeDocumentRepositoryLinkInfo(&sv.RepositoryLinkInfo, value); err != nil { + return err + } + default: _, _ = key, value @@ -2623,7 +7075,7 @@ func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, return nil } -func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentUpdateSyncBlockerOutput(v **UpdateSyncBlockerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2636,15 +7088,38 @@ func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UntagResourceOutput + var sv *UpdateSyncBlockerOutput if *v == nil { - sv = &UntagResourceOutput{} + sv = &UpdateSyncBlockerOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "ParentResourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.ParentResourceName = ptr.String(jtv) + } + + case "ResourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + case "SyncBlocker": + if err := awsAwsjson10_deserializeDocumentSyncBlocker(&sv.SyncBlocker, value); err != nil { + return err + } + default: _, _ = key, value @@ -2654,7 +7129,7 @@ func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutp return nil } -func awsAwsjson10_deserializeOpDocumentUpdateHostOutput(v **UpdateHostOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentUpdateSyncConfigurationOutput(v **UpdateSyncConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2667,15 +7142,20 @@ func awsAwsjson10_deserializeOpDocumentUpdateHostOutput(v **UpdateHostOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateHostOutput + var sv *UpdateSyncConfigurationOutput if *v == nil { - sv = &UpdateHostOutput{} + sv = &UpdateSyncConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "SyncConfiguration": + if err := awsAwsjson10_deserializeDocumentSyncConfiguration(&sv.SyncConfiguration, value); err != nil { + return err + } + default: _, _ = key, value diff --git a/service/codestarconnections/endpoints.go b/service/codestarconnections/endpoints.go index be0acbf9911..c2f6605d60e 100644 --- a/service/codestarconnections/endpoints.go +++ b/service/codestarconnections/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://codestar-connections-fips.") diff --git a/service/codestarconnections/generated.json b/service/codestarconnections/generated.json index 4dff4c80aed..abfec3c6d9c 100644 --- a/service/codestarconnections/generated.json +++ b/service/codestarconnections/generated.json @@ -11,16 +11,31 @@ "api_client_test.go", "api_op_CreateConnection.go", "api_op_CreateHost.go", + "api_op_CreateRepositoryLink.go", + "api_op_CreateSyncConfiguration.go", "api_op_DeleteConnection.go", "api_op_DeleteHost.go", + "api_op_DeleteRepositoryLink.go", + "api_op_DeleteSyncConfiguration.go", "api_op_GetConnection.go", "api_op_GetHost.go", + "api_op_GetRepositoryLink.go", + "api_op_GetRepositorySyncStatus.go", + "api_op_GetResourceSyncStatus.go", + "api_op_GetSyncBlockerSummary.go", + "api_op_GetSyncConfiguration.go", "api_op_ListConnections.go", "api_op_ListHosts.go", + "api_op_ListRepositoryLinks.go", + "api_op_ListRepositorySyncDefinitions.go", + "api_op_ListSyncConfigurations.go", "api_op_ListTagsForResource.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateHost.go", + "api_op_UpdateRepositoryLink.go", + "api_op_UpdateSyncBlocker.go", + "api_op_UpdateSyncConfiguration.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/codestarconnections/serializers.go b/service/codestarconnections/serializers.go index 16f2d2ef888..3f199d22537 100644 --- a/service/codestarconnections/serializers.go +++ b/service/codestarconnections/serializers.go @@ -125,6 +125,116 @@ func (m *awsAwsjson10_serializeOpCreateHost) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpCreateRepositoryLink struct { +} + +func (*awsAwsjson10_serializeOpCreateRepositoryLink) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateRepositoryLink) 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.(*CreateRepositoryLinkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.CreateRepositoryLink") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateRepositoryLinkInput(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_serializeOpCreateSyncConfiguration struct { +} + +func (*awsAwsjson10_serializeOpCreateSyncConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateSyncConfiguration) 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.(*CreateSyncConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.CreateSyncConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateSyncConfigurationInput(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_serializeOpDeleteConnection struct { } @@ -235,6 +345,116 @@ func (m *awsAwsjson10_serializeOpDeleteHost) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDeleteRepositoryLink struct { +} + +func (*awsAwsjson10_serializeOpDeleteRepositoryLink) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteRepositoryLink) 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.(*DeleteRepositoryLinkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.DeleteRepositoryLink") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteRepositoryLinkInput(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_serializeOpDeleteSyncConfiguration struct { +} + +func (*awsAwsjson10_serializeOpDeleteSyncConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteSyncConfiguration) 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.(*DeleteSyncConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.DeleteSyncConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteSyncConfigurationInput(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_serializeOpGetConnection struct { } @@ -345,14 +565,619 @@ func (m *awsAwsjson10_serializeOpGetHost) HandleSerialize(ctx context.Context, i return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpListConnections struct { +type awsAwsjson10_serializeOpGetRepositoryLink struct { +} + +func (*awsAwsjson10_serializeOpGetRepositoryLink) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetRepositoryLink) 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.(*GetRepositoryLinkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.GetRepositoryLink") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetRepositoryLinkInput(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_serializeOpGetRepositorySyncStatus struct { +} + +func (*awsAwsjson10_serializeOpGetRepositorySyncStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetRepositorySyncStatus) 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.(*GetRepositorySyncStatusInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.GetRepositorySyncStatus") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetRepositorySyncStatusInput(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_serializeOpGetResourceSyncStatus struct { +} + +func (*awsAwsjson10_serializeOpGetResourceSyncStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetResourceSyncStatus) 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.(*GetResourceSyncStatusInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.GetResourceSyncStatus") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetResourceSyncStatusInput(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_serializeOpGetSyncBlockerSummary struct { +} + +func (*awsAwsjson10_serializeOpGetSyncBlockerSummary) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetSyncBlockerSummary) 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.(*GetSyncBlockerSummaryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.GetSyncBlockerSummary") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetSyncBlockerSummaryInput(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_serializeOpGetSyncConfiguration struct { +} + +func (*awsAwsjson10_serializeOpGetSyncConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetSyncConfiguration) 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.(*GetSyncConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.GetSyncConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetSyncConfigurationInput(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_serializeOpListConnections struct { +} + +func (*awsAwsjson10_serializeOpListConnections) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListConnections) 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.(*ListConnectionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListConnections") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListConnectionsInput(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_serializeOpListHosts struct { +} + +func (*awsAwsjson10_serializeOpListHosts) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListHosts) 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.(*ListHostsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListHosts") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListHostsInput(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_serializeOpListRepositoryLinks struct { +} + +func (*awsAwsjson10_serializeOpListRepositoryLinks) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListRepositoryLinks) 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.(*ListRepositoryLinksInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListRepositoryLinks") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListRepositoryLinksInput(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_serializeOpListRepositorySyncDefinitions struct { +} + +func (*awsAwsjson10_serializeOpListRepositorySyncDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListRepositorySyncDefinitions) 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.(*ListRepositorySyncDefinitionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListRepositorySyncDefinitions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListRepositorySyncDefinitionsInput(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_serializeOpListSyncConfigurations struct { +} + +func (*awsAwsjson10_serializeOpListSyncConfigurations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListSyncConfigurations) 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.(*ListSyncConfigurationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListSyncConfigurations") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListSyncConfigurationsInput(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)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.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_serializeOpTagResource struct { } -func (*awsAwsjson10_serializeOpListConnections) ID() string { +func (*awsAwsjson10_serializeOpTagResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpListConnections) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -360,7 +1185,7 @@ func (m *awsAwsjson10_serializeOpListConnections) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListConnectionsInput) + input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -381,10 +1206,10 @@ func (m *awsAwsjson10_serializeOpListConnections) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListConnections") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.TagResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentListConnectionsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -400,14 +1225,14 @@ func (m *awsAwsjson10_serializeOpListConnections) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpListHosts struct { +type awsAwsjson10_serializeOpUntagResource struct { } -func (*awsAwsjson10_serializeOpListHosts) ID() string { +func (*awsAwsjson10_serializeOpUntagResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpListHosts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -415,7 +1240,7 @@ func (m *awsAwsjson10_serializeOpListHosts) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListHostsInput) + input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -436,10 +1261,10 @@ func (m *awsAwsjson10_serializeOpListHosts) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListHosts") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.UntagResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentListHostsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -455,14 +1280,14 @@ func (m *awsAwsjson10_serializeOpListHosts) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpListTagsForResource struct { +type awsAwsjson10_serializeOpUpdateHost struct { } -func (*awsAwsjson10_serializeOpListTagsForResource) ID() string { +func (*awsAwsjson10_serializeOpUpdateHost) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUpdateHost) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -470,7 +1295,7 @@ func (m *awsAwsjson10_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.(*UpdateHostInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -491,10 +1316,10 @@ func (m *awsAwsjson10_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.ListTagsForResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.UpdateHost") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUpdateHostInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -510,14 +1335,14 @@ func (m *awsAwsjson10_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpTagResource struct { +type awsAwsjson10_serializeOpUpdateRepositoryLink struct { } -func (*awsAwsjson10_serializeOpTagResource) ID() string { +func (*awsAwsjson10_serializeOpUpdateRepositoryLink) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUpdateRepositoryLink) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -525,7 +1350,7 @@ func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*TagResourceInput) + input, ok := in.Parameters.(*UpdateRepositoryLinkInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -546,10 +1371,10 @@ func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.TagResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.UpdateRepositoryLink") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUpdateRepositoryLinkInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -565,14 +1390,14 @@ func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUntagResource struct { +type awsAwsjson10_serializeOpUpdateSyncBlocker struct { } -func (*awsAwsjson10_serializeOpUntagResource) ID() string { +func (*awsAwsjson10_serializeOpUpdateSyncBlocker) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUpdateSyncBlocker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -580,7 +1405,7 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagResourceInput) + input, ok := in.Parameters.(*UpdateSyncBlockerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -601,10 +1426,10 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.UntagResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.UpdateSyncBlocker") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUpdateSyncBlockerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -620,14 +1445,14 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUpdateHost struct { +type awsAwsjson10_serializeOpUpdateSyncConfiguration struct { } -func (*awsAwsjson10_serializeOpUpdateHost) ID() string { +func (*awsAwsjson10_serializeOpUpdateSyncConfiguration) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpUpdateHost) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUpdateSyncConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -635,7 +1460,7 @@ func (m *awsAwsjson10_serializeOpUpdateHost) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateHostInput) + input, ok := in.Parameters.(*UpdateSyncConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -656,10 +1481,10 @@ func (m *awsAwsjson10_serializeOpUpdateHost) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.UpdateHost") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeStar_connections_20191201.UpdateSyncConfiguration") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUpdateHostInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUpdateSyncConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -833,6 +1658,77 @@ func awsAwsjson10_serializeOpDocumentCreateHostInput(v *CreateHostInput, value s return nil } +func awsAwsjson10_serializeOpDocumentCreateRepositoryLinkInput(v *CreateRepositoryLinkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectionArn != nil { + ok := object.Key("ConnectionArn") + ok.String(*v.ConnectionArn) + } + + if v.EncryptionKeyArn != nil { + ok := object.Key("EncryptionKeyArn") + ok.String(*v.EncryptionKeyArn) + } + + if v.OwnerId != nil { + ok := object.Key("OwnerId") + ok.String(*v.OwnerId) + } + + if v.RepositoryName != nil { + ok := object.Key("RepositoryName") + ok.String(*v.RepositoryName) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentCreateSyncConfigurationInput(v *CreateSyncConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Branch != nil { + ok := object.Key("Branch") + ok.String(*v.Branch) + } + + if v.ConfigFile != nil { + ok := object.Key("ConfigFile") + ok.String(*v.ConfigFile) + } + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + if v.ResourceName != nil { + ok := object.Key("ResourceName") + ok.String(*v.ResourceName) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDeleteConnectionInput(v *DeleteConnectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -857,6 +1753,35 @@ func awsAwsjson10_serializeOpDocumentDeleteHostInput(v *DeleteHostInput, value s return nil } +func awsAwsjson10_serializeOpDocumentDeleteRepositoryLinkInput(v *DeleteRepositoryLinkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentDeleteSyncConfigurationInput(v *DeleteSyncConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceName != nil { + ok := object.Key("ResourceName") + ok.String(*v.ResourceName) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentGetConnectionInput(v *GetConnectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -881,6 +1806,91 @@ func awsAwsjson10_serializeOpDocumentGetHostInput(v *GetHostInput, value smithyj return nil } +func awsAwsjson10_serializeOpDocumentGetRepositoryLinkInput(v *GetRepositoryLinkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetRepositorySyncStatusInput(v *GetRepositorySyncStatusInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Branch != nil { + ok := object.Key("Branch") + ok.String(*v.Branch) + } + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetResourceSyncStatusInput(v *GetResourceSyncStatusInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceName != nil { + ok := object.Key("ResourceName") + ok.String(*v.ResourceName) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetSyncBlockerSummaryInput(v *GetSyncBlockerSummaryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceName != nil { + ok := object.Key("ResourceName") + ok.String(*v.ResourceName) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentGetSyncConfigurationInput(v *GetSyncConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceName != nil { + ok := object.Key("ResourceName") + ok.String(*v.ResourceName) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListConnectionsInput(v *ListConnectionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -925,6 +1935,67 @@ func awsAwsjson10_serializeOpDocumentListHostsInput(v *ListHostsInput, value smi return nil } +func awsAwsjson10_serializeOpDocumentListRepositoryLinksInput(v *ListRepositoryLinksInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != 0 { + ok := object.Key("MaxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListRepositorySyncDefinitionsInput(v *ListRepositorySyncDefinitionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentListSyncConfigurationsInput(v *ListSyncConfigurationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != 0 { + ok := object.Key("MaxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -998,3 +2069,89 @@ func awsAwsjson10_serializeOpDocumentUpdateHostInput(v *UpdateHostInput, value s return nil } + +func awsAwsjson10_serializeOpDocumentUpdateRepositoryLinkInput(v *UpdateRepositoryLinkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectionArn != nil { + ok := object.Key("ConnectionArn") + ok.String(*v.ConnectionArn) + } + + if v.EncryptionKeyArn != nil { + ok := object.Key("EncryptionKeyArn") + ok.String(*v.EncryptionKeyArn) + } + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdateSyncBlockerInput(v *UpdateSyncBlockerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.ResolvedReason != nil { + ok := object.Key("ResolvedReason") + ok.String(*v.ResolvedReason) + } + + if v.ResourceName != nil { + ok := object.Key("ResourceName") + ok.String(*v.ResourceName) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdateSyncConfigurationInput(v *UpdateSyncConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Branch != nil { + ok := object.Key("Branch") + ok.String(*v.Branch) + } + + if v.ConfigFile != nil { + ok := object.Key("ConfigFile") + ok.String(*v.ConfigFile) + } + + if v.RepositoryLinkId != nil { + ok := object.Key("RepositoryLinkId") + ok.String(*v.RepositoryLinkId) + } + + if v.ResourceName != nil { + ok := object.Key("ResourceName") + ok.String(*v.ResourceName) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if len(v.SyncType) > 0 { + ok := object.Key("SyncType") + ok.String(string(v.SyncType)) + } + + return nil +} diff --git a/service/codestarconnections/types/enums.go b/service/codestarconnections/types/enums.go index 69f5f636cbc..9bf815c3887 100644 --- a/service/codestarconnections/types/enums.go +++ b/service/codestarconnections/types/enums.go @@ -2,6 +2,40 @@ package types +type BlockerStatus string + +// Enum values for BlockerStatus +const ( + BlockerStatusActive BlockerStatus = "ACTIVE" + BlockerStatusResolved BlockerStatus = "RESOLVED" +) + +// Values returns all known values for BlockerStatus. 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 (BlockerStatus) Values() []BlockerStatus { + return []BlockerStatus{ + "ACTIVE", + "RESOLVED", + } +} + +type BlockerType string + +// Enum values for BlockerType +const ( + BlockerTypeAutomated BlockerType = "AUTOMATED" +) + +// Values returns all known values for BlockerType. 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 (BlockerType) Values() []BlockerType { + return []BlockerType{ + "AUTOMATED", + } +} + type ConnectionStatus string // Enum values for ConnectionStatus @@ -43,3 +77,65 @@ func (ProviderType) Values() []ProviderType { "GitLab", } } + +type RepositorySyncStatus string + +// Enum values for RepositorySyncStatus +const ( + RepositorySyncStatusFailed RepositorySyncStatus = "FAILED" + RepositorySyncStatusInitiated RepositorySyncStatus = "INITIATED" + RepositorySyncStatusInProgress RepositorySyncStatus = "IN_PROGRESS" + RepositorySyncStatusSucceeded RepositorySyncStatus = "SUCCEEDED" + RepositorySyncStatusQueued RepositorySyncStatus = "QUEUED" +) + +// Values returns all known values for RepositorySyncStatus. 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 (RepositorySyncStatus) Values() []RepositorySyncStatus { + return []RepositorySyncStatus{ + "FAILED", + "INITIATED", + "IN_PROGRESS", + "SUCCEEDED", + "QUEUED", + } +} + +type ResourceSyncStatus string + +// Enum values for ResourceSyncStatus +const ( + ResourceSyncStatusFailed ResourceSyncStatus = "FAILED" + ResourceSyncStatusInitiated ResourceSyncStatus = "INITIATED" + ResourceSyncStatusInProgress ResourceSyncStatus = "IN_PROGRESS" + ResourceSyncStatusSucceeded ResourceSyncStatus = "SUCCEEDED" +) + +// Values returns all known values for ResourceSyncStatus. 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 (ResourceSyncStatus) Values() []ResourceSyncStatus { + return []ResourceSyncStatus{ + "FAILED", + "INITIATED", + "IN_PROGRESS", + "SUCCEEDED", + } +} + +type SyncConfigurationType string + +// Enum values for SyncConfigurationType +const ( + SyncConfigurationTypeCfnStackSync SyncConfigurationType = "CFN_STACK_SYNC" +) + +// Values returns all known values for SyncConfigurationType. 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 (SyncConfigurationType) Values() []SyncConfigurationType { + return []SyncConfigurationType{ + "CFN_STACK_SYNC", + } +} diff --git a/service/codestarconnections/types/errors.go b/service/codestarconnections/types/errors.go index 46bc17758cb..3c4200802c0 100644 --- a/service/codestarconnections/types/errors.go +++ b/service/codestarconnections/types/errors.go @@ -7,6 +7,86 @@ import ( smithy "github.com/aws/smithy-go" ) +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception thrown as a result of concurrent modification to an application. For +// example, two individuals attempting to edit the same application at the same +// time. +type ConcurrentModificationException struct { + Message *string + + ErrorCodeOverride *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 { + if e == nil || e.ErrorCodeOverride == nil { + return "ConcurrentModificationException" + } + return *e.ErrorCodeOverride +} +func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The conditional check failed. Try again later. +type ConditionalCheckFailedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ConditionalCheckFailedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConditionalCheckFailedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConditionalCheckFailedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConditionalCheckFailedException" + } + return *e.ErrorCodeOverride +} +func (e *ConditionalCheckFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Two conflicting operations have been made on the same resource. type ConflictException struct { Message *string @@ -33,6 +113,58 @@ func (e *ConflictException) ErrorCode() string { } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Received an internal server exception. Try again later. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The input is not valid. Verify that the action is typed correctly. +type InvalidInputException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidInputException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidInputException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidInputException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Exceeded the maximum limit for connections. type LimitExceededException struct { Message *string @@ -59,6 +191,32 @@ func (e *LimitExceededException) ErrorCode() string { } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Unable to create resource. Resource already exists. +type ResourceAlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceAlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceAlreadyExistsException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Resource not found. Verify the connection resource ARN and try again. type ResourceNotFoundException struct { Message *string @@ -111,6 +269,112 @@ func (e *ResourceUnavailableException) ErrorCode() string { } func (e *ResourceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Retrying the latest commit failed. Try again later. +type RetryLatestCommitFailedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RetryLatestCommitFailedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RetryLatestCommitFailedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RetryLatestCommitFailedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RetryLatestCommitFailedException" + } + return *e.ErrorCodeOverride +} +func (e *RetryLatestCommitFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Unable to continue. The sync blocker does not exist. +type SyncBlockerDoesNotExistException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SyncBlockerDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SyncBlockerDoesNotExistException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SyncBlockerDoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SyncBlockerDoesNotExistException" + } + return *e.ErrorCodeOverride +} +func (e *SyncBlockerDoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Unable to continue. The sync blocker still exists. +type SyncConfigurationStillExistsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SyncConfigurationStillExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SyncConfigurationStillExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SyncConfigurationStillExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SyncConfigurationStillExistsException" + } + return *e.ErrorCodeOverride +} +func (e *SyncConfigurationStillExistsException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The operation is not supported. Check the connection status and try again. type UnsupportedOperationException struct { Message *string @@ -136,3 +400,55 @@ func (e *UnsupportedOperationException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnsupportedOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified provider type is not supported for connections. +type UnsupportedProviderTypeException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedProviderTypeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedProviderTypeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedProviderTypeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedProviderTypeException" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedProviderTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The update is out of sync. Try syncing again. +type UpdateOutOfSyncException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UpdateOutOfSyncException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UpdateOutOfSyncException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UpdateOutOfSyncException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UpdateOutOfSyncException" + } + return *e.ErrorCodeOverride +} +func (e *UpdateOutOfSyncException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/codestarconnections/types/types.go b/service/codestarconnections/types/types.go index 523d705ab67..049b1c401bf 100644 --- a/service/codestarconnections/types/types.go +++ b/service/codestarconnections/types/types.go @@ -4,6 +4,7 @@ package types import ( smithydocument "github.com/aws/smithy-go/document" + "time" ) // A resource that is used to connect third-party source providers with services @@ -74,6 +75,366 @@ type Host struct { noSmithyDocumentSerde } +// Information about the repository link resource, such as the repository link +// ARN, the associated connection ARN, encryption key ARN, and owner ID. +type RepositoryLinkInfo struct { + + // The Amazon Resource Name (ARN) of the connection associated with the repository + // link. + // + // This member is required. + ConnectionArn *string + + // The owner ID for the repository associated with the repository link, such as + // the owner ID in GitHub. + // + // This member is required. + OwnerId *string + + // The provider type for the connection, such as GitHub, associated with the + // repository link. + // + // This member is required. + ProviderType ProviderType + + // The Amazon Resource Name (ARN) of the repository link. + // + // This member is required. + RepositoryLinkArn *string + + // The ID of the repository link. + // + // This member is required. + RepositoryLinkId *string + + // The name of the repository associated with the repository link. + // + // This member is required. + RepositoryName *string + + // The Amazon Resource Name (ARN) of the encryption key for the repository + // associated with the repository link. + EncryptionKeyArn *string + + noSmithyDocumentSerde +} + +// Information about a repository sync attempt for a repository with a sync +// configuration. +type RepositorySyncAttempt struct { + + // The events associated with a specific sync attempt. + // + // This member is required. + Events []RepositorySyncEvent + + // The start time of a specific sync attempt. + // + // This member is required. + StartedAt *time.Time + + // The status of a specific sync attempt. The following are valid statuses: + // - INITIATED - A repository sync attempt has been created and will begin soon. + // - IN_PROGRESS - A repository sync attempt has started and work is being done + // to reconcile the branch. + // - SUCCEEDED - The repository sync attempt has completed successfully. + // - FAILED - The repository sync attempt has failed. + // - QUEUED - The repository sync attempt didn't execute and was queued. + // + // This member is required. + Status RepositorySyncStatus + + noSmithyDocumentSerde +} + +// The definition for a repository with a sync configuration. +type RepositorySyncDefinition struct { + + // The branch specified for a repository sync definition. + // + // This member is required. + Branch *string + + // The configuration file for a repository sync definition. This value comes from + // creating or updating the config-file field of a sync-configuration . + // + // This member is required. + Directory *string + + // The parent resource specified for a repository sync definition. + // + // This member is required. + Parent *string + + // The target resource specified for a repository sync definition. In some cases, + // such as CFN_STACK_SYNC, the parent and target resource are the same. + // + // This member is required. + Target *string + + noSmithyDocumentSerde +} + +// Information about a repository sync event. +type RepositorySyncEvent struct { + + // A description of a repository sync event. + // + // This member is required. + Event *string + + // The time that a repository sync event occurred. + // + // This member is required. + Time *time.Time + + // The event type for a repository sync event. + // + // This member is required. + Type *string + + // The ID for a repository sync event. + ExternalId *string + + noSmithyDocumentSerde +} + +// Information about a resource sync attempt. +type ResourceSyncAttempt struct { + + // The events related to a resource sync attempt. + // + // This member is required. + Events []ResourceSyncEvent + + // The current state of the resource as defined in the resource's config-file in + // the linked repository. + // + // This member is required. + InitialRevision *Revision + + // The start time for a resource sync attempt. + // + // This member is required. + StartedAt *time.Time + + // The status for a resource sync attempt. The follow are valid statuses: + // - SYNC-INITIATED - A resource sync attempt has been created and will begin + // soon. + // - SYNCING - Syncing has started and work is being done to reconcile state. + // - SYNCED - Syncing has completed successfully. + // - SYNC_FAILED - A resource sync attempt has failed. + // + // This member is required. + Status ResourceSyncStatus + + // The name of the Amazon Web Services resource that is attempted to be + // synchronized. + // + // This member is required. + Target *string + + // The desired state of the resource as defined in the resource's config-file in + // the linked repository. Git sync attempts to update the resource to this state. + // + // This member is required. + TargetRevision *Revision + + noSmithyDocumentSerde +} + +// Information about a resource sync event for the resource associated with a sync +// configuration. +type ResourceSyncEvent struct { + + // The event for a resource sync event. + // + // This member is required. + Event *string + + // The time that a resource sync event occurred. + // + // This member is required. + Time *time.Time + + // The type of resource sync event. + // + // This member is required. + Type *string + + // The ID for a resource sync event. + ExternalId *string + + noSmithyDocumentSerde +} + +// Information about the revision for a specific sync event, such as the branch, +// owner ID, and name of the repository. +type Revision struct { + + // The branch name for a specific revision. + // + // This member is required. + Branch *string + + // The directory, if any, for a specific revision. + // + // This member is required. + Directory *string + + // The owner ID for a specific revision, such as the GitHub owner ID for a GitHub + // repository. + // + // This member is required. + OwnerId *string + + // The provider type for a revision, such as GitHub. + // + // This member is required. + ProviderType ProviderType + + // The repository name for a specific revision. + // + // This member is required. + RepositoryName *string + + // The SHA, such as the commit ID, for a specific revision. + // + // This member is required. + Sha *string + + noSmithyDocumentSerde +} + +// Information about a blocker for a sync event. +type SyncBlocker struct { + + // The creation time for a specific sync blocker. + // + // This member is required. + CreatedAt *time.Time + + // The provided reason for a specific sync blocker. + // + // This member is required. + CreatedReason *string + + // The ID for a specific sync blocker. + // + // This member is required. + Id *string + + // The status for a specific sync blocker. + // + // This member is required. + Status BlockerStatus + + // The sync blocker type. + // + // This member is required. + Type BlockerType + + // The contexts for a specific sync blocker. + Contexts []SyncBlockerContext + + // The time that a specific sync blocker was resolved. + ResolvedAt *time.Time + + // The resolved reason for a specific sync blocker. + ResolvedReason *string + + noSmithyDocumentSerde +} + +// The context for a specific sync blocker. +type SyncBlockerContext struct { + + // The key provided for a context key-value pair for a specific sync blocker. + // + // This member is required. + Key *string + + // The value provided for a context key-value pair for a specific sync blocker. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// A summary for sync blockers. +type SyncBlockerSummary struct { + + // The resource name for sync blocker summary. + // + // This member is required. + ResourceName *string + + // The latest events for a sync blocker summary. + LatestBlockers []SyncBlocker + + // The parent resource name for a sync blocker summary. + ParentResourceName *string + + noSmithyDocumentSerde +} + +// Information, such as repository, branch, provider, and resource names for a +// specific sync configuration. +type SyncConfiguration struct { + + // The branch associated with a specific sync configuration. + // + // This member is required. + Branch *string + + // The owner ID for the repository associated with a specific sync configuration, + // such as the owner ID in GitHub. + // + // This member is required. + OwnerId *string + + // The connection provider type associated with a specific sync configuration, + // such as GitHub. + // + // This member is required. + ProviderType ProviderType + + // The ID of the repository link associated with a specific sync configuration. + // + // This member is required. + RepositoryLinkId *string + + // The name of the repository associated with a specific sync configuration. + // + // This member is required. + RepositoryName *string + + // The name of the connection resource associated with a specific sync + // configuration. + // + // This member is required. + ResourceName *string + + // The Amazon Resource Name (ARN) of the IAM role associated with a specific sync + // configuration. + // + // This member is required. + RoleArn *string + + // The type of sync for a specific sync configuration. + // + // This member is required. + SyncType SyncConfigurationType + + // The file path to the configuration file associated with a specific sync + // configuration. The path should point to an actual file in the sync + // configurations linked repository. + ConfigFile *string + + noSmithyDocumentSerde +} + // A tag is a key-value pair that is used to manage the resource. This tag is // available for use by Amazon Web Services services that support tags. type Tag struct { diff --git a/service/codestarconnections/validators.go b/service/codestarconnections/validators.go index f291128b0eb..3fcf1082501 100644 --- a/service/codestarconnections/validators.go +++ b/service/codestarconnections/validators.go @@ -50,6 +50,46 @@ func (m *validateOpCreateHost) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpCreateRepositoryLink struct { +} + +func (*validateOpCreateRepositoryLink) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRepositoryLink) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRepositoryLinkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRepositoryLinkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSyncConfiguration struct { +} + +func (*validateOpCreateSyncConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSyncConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSyncConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSyncConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteConnection struct { } @@ -90,6 +130,46 @@ func (m *validateOpDeleteHost) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpDeleteRepositoryLink struct { +} + +func (*validateOpDeleteRepositoryLink) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRepositoryLink) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRepositoryLinkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRepositoryLinkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSyncConfiguration struct { +} + +func (*validateOpDeleteSyncConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSyncConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSyncConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSyncConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetConnection struct { } @@ -130,6 +210,146 @@ func (m *validateOpGetHost) HandleInitialize(ctx context.Context, in middleware. return next.HandleInitialize(ctx, in) } +type validateOpGetRepositoryLink struct { +} + +func (*validateOpGetRepositoryLink) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRepositoryLink) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRepositoryLinkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRepositoryLinkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRepositorySyncStatus struct { +} + +func (*validateOpGetRepositorySyncStatus) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRepositorySyncStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRepositorySyncStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRepositorySyncStatusInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetResourceSyncStatus struct { +} + +func (*validateOpGetResourceSyncStatus) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourceSyncStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourceSyncStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourceSyncStatusInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSyncBlockerSummary struct { +} + +func (*validateOpGetSyncBlockerSummary) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSyncBlockerSummary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSyncBlockerSummaryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSyncBlockerSummaryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSyncConfiguration struct { +} + +func (*validateOpGetSyncConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSyncConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSyncConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSyncConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListRepositorySyncDefinitions struct { +} + +func (*validateOpListRepositorySyncDefinitions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRepositorySyncDefinitions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRepositorySyncDefinitionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRepositorySyncDefinitionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListSyncConfigurations struct { +} + +func (*validateOpListSyncConfigurations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSyncConfigurations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSyncConfigurationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSyncConfigurationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -210,6 +430,66 @@ func (m *validateOpUpdateHost) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpUpdateRepositoryLink struct { +} + +func (*validateOpUpdateRepositoryLink) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRepositoryLink) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRepositoryLinkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRepositoryLinkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSyncBlocker struct { +} + +func (*validateOpUpdateSyncBlocker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSyncBlocker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSyncBlockerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSyncBlockerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSyncConfiguration struct { +} + +func (*validateOpUpdateSyncConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSyncConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSyncConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSyncConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpCreateConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateConnection{}, middleware.After) } @@ -218,6 +498,14 @@ func addOpCreateHostValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateHost{}, middleware.After) } +func addOpCreateRepositoryLinkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRepositoryLink{}, middleware.After) +} + +func addOpCreateSyncConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSyncConfiguration{}, middleware.After) +} + func addOpDeleteConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteConnection{}, middleware.After) } @@ -226,6 +514,14 @@ func addOpDeleteHostValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteHost{}, middleware.After) } +func addOpDeleteRepositoryLinkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRepositoryLink{}, middleware.After) +} + +func addOpDeleteSyncConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSyncConfiguration{}, middleware.After) +} + func addOpGetConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetConnection{}, middleware.After) } @@ -234,6 +530,34 @@ func addOpGetHostValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetHost{}, middleware.After) } +func addOpGetRepositoryLinkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRepositoryLink{}, middleware.After) +} + +func addOpGetRepositorySyncStatusValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRepositorySyncStatus{}, middleware.After) +} + +func addOpGetResourceSyncStatusValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourceSyncStatus{}, middleware.After) +} + +func addOpGetSyncBlockerSummaryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSyncBlockerSummary{}, middleware.After) +} + +func addOpGetSyncConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSyncConfiguration{}, middleware.After) +} + +func addOpListRepositorySyncDefinitionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRepositorySyncDefinitions{}, middleware.After) +} + +func addOpListSyncConfigurationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSyncConfigurations{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -250,6 +574,18 @@ func addOpUpdateHostValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateHost{}, middleware.After) } +func addOpUpdateRepositoryLinkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRepositoryLink{}, middleware.After) +} + +func addOpUpdateSyncBlockerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSyncBlocker{}, middleware.After) +} + +func addOpUpdateSyncConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSyncConfiguration{}, middleware.After) +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -357,6 +693,62 @@ func validateOpCreateHostInput(v *CreateHostInput) error { } } +func validateOpCreateRepositoryLinkInput(v *CreateRepositoryLinkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRepositoryLinkInput"} + if v.ConnectionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionArn")) + } + if v.OwnerId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OwnerId")) + } + if v.RepositoryName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryName")) + } + 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 validateOpCreateSyncConfigurationInput(v *CreateSyncConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSyncConfigurationInput"} + if v.Branch == nil { + invalidParams.Add(smithy.NewErrParamRequired("Branch")) + } + if v.ConfigFile == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigFile")) + } + if v.RepositoryLinkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryLinkId")) + } + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteConnectionInput(v *DeleteConnectionInput) error { if v == nil { return nil @@ -387,6 +779,39 @@ func validateOpDeleteHostInput(v *DeleteHostInput) error { } } +func validateOpDeleteRepositoryLinkInput(v *DeleteRepositoryLinkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRepositoryLinkInput"} + if v.RepositoryLinkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryLinkId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSyncConfigurationInput(v *DeleteSyncConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSyncConfigurationInput"} + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetConnectionInput(v *GetConnectionInput) error { if v == nil { return nil @@ -417,6 +842,132 @@ func validateOpGetHostInput(v *GetHostInput) error { } } +func validateOpGetRepositoryLinkInput(v *GetRepositoryLinkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRepositoryLinkInput"} + if v.RepositoryLinkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryLinkId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRepositorySyncStatusInput(v *GetRepositorySyncStatusInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRepositorySyncStatusInput"} + if v.Branch == nil { + invalidParams.Add(smithy.NewErrParamRequired("Branch")) + } + if v.RepositoryLinkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryLinkId")) + } + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetResourceSyncStatusInput(v *GetResourceSyncStatusInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourceSyncStatusInput"} + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSyncBlockerSummaryInput(v *GetSyncBlockerSummaryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSyncBlockerSummaryInput"} + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSyncConfigurationInput(v *GetSyncConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSyncConfigurationInput"} + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListRepositorySyncDefinitionsInput(v *ListRepositorySyncDefinitionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRepositorySyncDefinitionsInput"} + if v.RepositoryLinkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryLinkId")) + } + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListSyncConfigurationsInput(v *ListSyncConfigurationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSyncConfigurationsInput"} + if v.RepositoryLinkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryLinkId")) + } + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -491,3 +1042,60 @@ func validateOpUpdateHostInput(v *UpdateHostInput) error { return nil } } + +func validateOpUpdateRepositoryLinkInput(v *UpdateRepositoryLinkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRepositoryLinkInput"} + if v.RepositoryLinkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryLinkId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSyncBlockerInput(v *UpdateSyncBlockerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSyncBlockerInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if v.ResolvedReason == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResolvedReason")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSyncConfigurationInput(v *UpdateSyncConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSyncConfigurationInput"} + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if len(v.SyncType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SyncType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index d3dd95b30a1..8cd05a7896d 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -777,14 +777,15 @@ type IntegrationType string // Enum values for IntegrationType const ( - IntegrationTypeEvent IntegrationType = "EVENT" - IntegrationTypeVoiceId IntegrationType = "VOICE_ID" - IntegrationTypePinpointApp IntegrationType = "PINPOINT_APP" - IntegrationTypeWisdomAssistant IntegrationType = "WISDOM_ASSISTANT" - IntegrationTypeWisdomKnowledgeBase IntegrationType = "WISDOM_KNOWLEDGE_BASE" - IntegrationTypeCasesDomain IntegrationType = "CASES_DOMAIN" - IntegrationTypeApplication IntegrationType = "APPLICATION" - IntegrationTypeFileScanner IntegrationType = "FILE_SCANNER" + IntegrationTypeEvent IntegrationType = "EVENT" + IntegrationTypeVoiceId IntegrationType = "VOICE_ID" + IntegrationTypePinpointApp IntegrationType = "PINPOINT_APP" + IntegrationTypeWisdomAssistant IntegrationType = "WISDOM_ASSISTANT" + IntegrationTypeWisdomKnowledgeBase IntegrationType = "WISDOM_KNOWLEDGE_BASE" + IntegrationTypeWisdomQuickResponses IntegrationType = "WISDOM_QUICK_RESPONSES" + IntegrationTypeCasesDomain IntegrationType = "CASES_DOMAIN" + IntegrationTypeApplication IntegrationType = "APPLICATION" + IntegrationTypeFileScanner IntegrationType = "FILE_SCANNER" ) // Values returns all known values for IntegrationType. Note that this can be @@ -797,6 +798,7 @@ func (IntegrationType) Values() []IntegrationType { "PINPOINT_APP", "WISDOM_ASSISTANT", "WISDOM_KNOWLEDGE_BASE", + "WISDOM_QUICK_RESPONSES", "CASES_DOMAIN", "APPLICATION", "FILE_SCANNER", @@ -851,7 +853,6 @@ type ListFlowAssociationResourceType string // Enum values for ListFlowAssociationResourceType const ( - ListFlowAssociationResourceTypeSmsPhoneNumber ListFlowAssociationResourceType = "SMS_PHONE_NUMBER" ListFlowAssociationResourceTypeVoicePhoneNumber ListFlowAssociationResourceType = "VOICE_PHONE_NUMBER" ) @@ -861,7 +862,6 @@ const ( // updates. func (ListFlowAssociationResourceType) Values() []ListFlowAssociationResourceType { return []ListFlowAssociationResourceType{ - "SMS_PHONE_NUMBER", "VOICE_PHONE_NUMBER", } } diff --git a/service/dlm/types/types.go b/service/dlm/types/types.go index 07acc435d15..56ca257accd 100644 --- a/service/dlm/types/types.go +++ b/service/dlm/types/types.go @@ -701,6 +701,8 @@ type Script struct { // - If you are automating VSS backups, specify AWS_VSS_BACKUP . In this case, // Amazon Data Lifecycle Manager automatically uses the AWSEC2-CreateVssSnapshot // SSM document. + // - If you are automating application-consistent snapshots for SAP HANA + // workloads, specify AWSSystemsManagerSAP-CreateDLMSnapshotForSAPHANA . // - If you are using a custom SSM document that you own, specify either the // name or ARN of the SSM document. If you are using a custom SSM document that is // shared with you, specify the ARN of the SSM document. @@ -719,7 +721,8 @@ type Script struct { ExecuteOperationOnScriptFailure *bool // Indicates the service used to execute the pre and/or post scripts. - // - If you are using custom SSM documents, specify AWS_SYSTEMS_MANAGER . + // - If you are using custom SSM documents or automating application-consistent + // snapshots of SAP HANA workloads, specify AWS_SYSTEMS_MANAGER . // - If you are automating VSS Backups, omit this parameter. // Default: AWS_SYSTEMS_MANAGER ExecutionHandlerService ExecutionHandlerServiceValues diff --git a/service/ec2/api_op_AdvertiseByoipCidr.go b/service/ec2/api_op_AdvertiseByoipCidr.go index c2a7be63820..44fc3cc3a03 100644 --- a/service/ec2/api_op_AdvertiseByoipCidr.go +++ b/service/ec2/api_op_AdvertiseByoipCidr.go @@ -47,6 +47,9 @@ type AdvertiseByoipCidrInput struct { // This member is required. Cidr *string + // The public 2-byte or 4-byte ASN that you want to advertise. + Asn *string + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have the // required permissions, the error response is DryRunOperation . Otherwise, it is diff --git a/service/ec2/api_op_AllocateIpamPoolCidr.go b/service/ec2/api_op_AllocateIpamPoolCidr.go index beb02ff54df..6a032bd0f54 100644 --- a/service/ec2/api_op_AllocateIpamPoolCidr.go +++ b/service/ec2/api_op_AllocateIpamPoolCidr.go @@ -42,6 +42,10 @@ type AllocateIpamPoolCidrInput struct { // This member is required. IpamPoolId *string + // Include a particular CIDR range that can be returned by the pool. Allowed CIDRs + // are only allowed if using netmask length for allocation. + AllowedCidrs []string + // The CIDR you would like to allocate from the IPAM pool. Note the following: // - If there is no DefaultNetmaskLength allocation rule set on the pool, you // must specify either the NetmaskLength or the CIDR. diff --git a/service/ec2/api_op_AssociateIpamByoasn.go b/service/ec2/api_op_AssociateIpamByoasn.go new file mode 100644 index 00000000000..d42b19d0a45 --- /dev/null +++ b/service/ec2/api_op_AssociateIpamByoasn.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates your Autonomous System Number (ASN) with a BYOIP CIDR that you own +// in the same Amazon Web Services Region. For more information, see Tutorial: +// Bring your ASN to IPAM (https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html) +// in the Amazon VPC IPAM guide. After the association succeeds, the ASN is +// eligible for advertisement. You can view the association with DescribeByoipCidrs (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeByoipCidrs.html) +// . You can advertise the CIDR with AdvertiseByoipCidr (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AdvertiseByoipCidr.html) +// . +func (c *Client) AssociateIpamByoasn(ctx context.Context, params *AssociateIpamByoasnInput, optFns ...func(*Options)) (*AssociateIpamByoasnOutput, error) { + if params == nil { + params = &AssociateIpamByoasnInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateIpamByoasn", params, optFns, c.addOperationAssociateIpamByoasnMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateIpamByoasnOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateIpamByoasnInput struct { + + // A public 2-byte or 4-byte ASN. + // + // This member is required. + Asn *string + + // The BYOIP CIDR you want to associate with an ASN. + // + // This member is required. + Cidr *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type AssociateIpamByoasnOutput struct { + + // The ASN and BYOIP CIDR association. + AsnAssociation *types.AsnAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateIpamByoasn{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateIpamByoasn{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateIpamByoasn"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateIpamByoasnValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateIpamByoasn(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociateIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssociateIpamByoasn", + } +} diff --git a/service/ec2/api_op_AssociateSubnetCidrBlock.go b/service/ec2/api_op_AssociateSubnetCidrBlock.go index c6537182b99..8fb5e195bcb 100644 --- a/service/ec2/api_op_AssociateSubnetCidrBlock.go +++ b/service/ec2/api_op_AssociateSubnetCidrBlock.go @@ -13,8 +13,7 @@ import ( ) // Associates a CIDR block with your subnet. You can only associate a single IPv6 -// CIDR block with your subnet. An IPv6 CIDR block must have a prefix length of -// /64. +// CIDR block with your subnet. func (c *Client) AssociateSubnetCidrBlock(ctx context.Context, params *AssociateSubnetCidrBlockInput, optFns ...func(*Options)) (*AssociateSubnetCidrBlockOutput, error) { if params == nil { params = &AssociateSubnetCidrBlockInput{} @@ -32,16 +31,20 @@ func (c *Client) AssociateSubnetCidrBlock(ctx context.Context, params *Associate type AssociateSubnetCidrBlockInput struct { - // The IPv6 CIDR block for your subnet. The subnet must have a /64 prefix length. - // - // This member is required. - Ipv6CidrBlock *string - // The ID of your subnet. // // This member is required. SubnetId *string + // The IPv6 CIDR block for your subnet. + Ipv6CidrBlock *string + + // An IPv6 IPAM pool ID. + Ipv6IpamPoolId *string + + // An IPv6 netmask length. + Ipv6NetmaskLength *int32 + noSmithyDocumentSerde } diff --git a/service/ec2/api_op_AssociateTrunkInterface.go b/service/ec2/api_op_AssociateTrunkInterface.go index a15eeb48781..07a7feab0d6 100644 --- a/service/ec2/api_op_AssociateTrunkInterface.go +++ b/service/ec2/api_op_AssociateTrunkInterface.go @@ -12,10 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API action is currently in limited preview only. If you are interested in -// using this feature, contact your account manager. Associates a branch network -// interface with a trunk network interface. Before you create the association, run -// the create-network-interface (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) +// Associates a branch network interface with a trunk network interface. Before +// you create the association, run the create-network-interface (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) // command and set --interface-type to trunk . You must also create a network // interface for each branch network interface that you want to associate with the // trunk network interface. diff --git a/service/ec2/api_op_AssociateVpcCidrBlock.go b/service/ec2/api_op_AssociateVpcCidrBlock.go index 2070d4e722d..131d9324f54 100644 --- a/service/ec2/api_op_AssociateVpcCidrBlock.go +++ b/service/ec2/api_op_AssociateVpcCidrBlock.go @@ -15,11 +15,10 @@ import ( // Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR // block, an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from an IPv6 // address pool that you provisioned through bring your own IP addresses ( BYOIP (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) -// ). The IPv6 CIDR block size is fixed at /56. You must specify one of the -// following in the request: an IPv4 CIDR block, an IPv6 pool, or an -// Amazon-provided IPv6 CIDR block. For more information about associating CIDR -// blocks with your VPC and applicable restrictions, see IP addressing for your -// VPCs and subnets (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html) +// ). You must specify one of the following in the request: an IPv4 CIDR block, an +// IPv6 pool, or an Amazon-provided IPv6 CIDR block. For more information about +// associating CIDR blocks with your VPC and applicable restrictions, see IP +// addressing for your VPCs and subnets (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html) // in the Amazon VPC User Guide. func (c *Client) AssociateVpcCidrBlock(ctx context.Context, params *AssociateVpcCidrBlockInput, optFns ...func(*Options)) (*AssociateVpcCidrBlockOutput, error) { if params == nil { @@ -44,7 +43,7 @@ type AssociateVpcCidrBlockInput struct { VpcId *string // Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the - // VPC. You cannot specify the range of IPv6 addresses, or the size of the CIDR + // VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR // block. AmazonProvidedIpv6CidrBlock *bool diff --git a/service/ec2/api_op_CreateIpam.go b/service/ec2/api_op_CreateIpam.go index 4f1398a463f..c959840bb5a 100644 --- a/service/ec2/api_op_CreateIpam.go +++ b/service/ec2/api_op_CreateIpam.go @@ -63,6 +63,11 @@ type CreateIpamInput struct { // tag:Owner for the filter name and TeamA for the filter value. TagSpecifications []types.TagSpecification + // IPAM is offered in a Free Tier and an Advanced Tier. For more information about + // the features available in each tier and the costs associated with the tiers, see + // Amazon VPC pricing > IPAM tab (http://aws.amazon.com/vpc/pricing/) . + Tier types.IpamTier + noSmithyDocumentSerde } diff --git a/service/ec2/api_op_CreateIpamPool.go b/service/ec2/api_op_CreateIpamPool.go index 997a4dfeab8..970dd927a99 100644 --- a/service/ec2/api_op_CreateIpamPool.go +++ b/service/ec2/api_op_CreateIpamPool.go @@ -129,6 +129,9 @@ type CreateIpamPoolInput struct { // pool must be available in the source pool's CIDR range. SourceIpamPoolId *string + // The resource used to provision CIDRs to a resource planning pool. + SourceResource *types.IpamPoolSourceResourceRequest + // The key/value combination of a tag assigned to the resource. Use the tag key in // the filter name and the tag value as the filter value. For example, to find all // resources that have a tag with the key Owner and the value TeamA , specify diff --git a/service/ec2/api_op_CreateNetworkInterface.go b/service/ec2/api_op_CreateNetworkInterface.go index e4e489604e1..0e9fd226236 100644 --- a/service/ec2/api_op_CreateNetworkInterface.go +++ b/service/ec2/api_op_CreateNetworkInterface.go @@ -45,6 +45,9 @@ type CreateNetworkInterfaceInput struct { // . ClientToken *string + // A connection tracking specification for the network interface. + ConnectionTrackingSpecification *types.ConnectionTrackingSpecificationRequest + // A description for the network interface. Description *string diff --git a/service/ec2/api_op_CreateSubnet.go b/service/ec2/api_op_CreateSubnet.go index 8900c7da27f..ecdc619445e 100644 --- a/service/ec2/api_op_CreateSubnet.go +++ b/service/ec2/api_op_CreateSubnet.go @@ -22,13 +22,12 @@ import ( // and a /16 netmask (65,536 IP addresses). Amazon Web Services reserves both the // first four and the last IPv4 address in each subnet's CIDR block. They're not // available for your use. If you've associated an IPv6 CIDR block with your VPC, -// you can associate an IPv6 CIDR block with a subnet when you create it. The -// allowed block size for an IPv6 subnet is a /64 netmask. If you add more than one -// subnet to a VPC, they're set up in a star topology with a logical router in the -// middle. When you stop an instance in a subnet, it retains its private IPv4 -// address. It's therefore possible to have a subnet with no running instances -// (they're all stopped), but no remaining IP addresses available. For more -// information, see Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html) +// you can associate an IPv6 CIDR block with a subnet when you create it. If you +// add more than one subnet to a VPC, they're set up in a star topology with a +// logical router in the middle. When you stop an instance in a subnet, it retains +// its private IPv4 address. It's therefore possible to have a subnet with no +// running instances (they're all stopped), but no remaining IP addresses +// available. For more information, see Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html) // in the Amazon VPC User Guide. func (c *Client) CreateSubnet(ctx context.Context, params *CreateSubnetInput, optFns ...func(*Options)) (*CreateSubnetOutput, error) { if params == nil { @@ -77,13 +76,25 @@ type CreateSubnetInput struct { // UnauthorizedOperation . DryRun *bool - // The IPv6 network range for the subnet, in CIDR notation. The subnet size must - // use a /64 prefix length. This parameter is required for an IPv6 only subnet. + // An IPv4 IPAM pool ID for the subnet. + Ipv4IpamPoolId *string + + // An IPv4 netmask length for the subnet. + Ipv4NetmaskLength *int32 + + // The IPv6 network range for the subnet, in CIDR notation. This parameter is + // required for an IPv6 only subnet. Ipv6CidrBlock *string + // An IPv6 IPAM pool ID for the subnet. + Ipv6IpamPoolId *string + // Indicates whether to create an IPv6 only subnet. Ipv6Native *bool + // An IPv6 netmask length for the subnet. + Ipv6NetmaskLength *int32 + // The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, // you must also specify the Availability Zone of the Outpost subnet. OutpostArn *string diff --git a/service/ec2/api_op_CreateVpc.go b/service/ec2/api_op_CreateVpc.go index a1966b6df43..dc5e292efd7 100644 --- a/service/ec2/api_op_CreateVpc.go +++ b/service/ec2/api_op_CreateVpc.go @@ -16,7 +16,7 @@ import ( // addressing for your VPCs and subnets (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html) // in the Amazon VPC User Guide. You can optionally request an IPv6 CIDR block for // the VPC. You can request an Amazon-provided IPv6 CIDR block from Amazon's pool -// of IPv6 addresses, or an IPv6 CIDR block from an IPv6 address pool that you +// of IPv6 addresses or an IPv6 CIDR block from an IPv6 address pool that you // provisioned through bring your own IP addresses ( BYOIP (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) // ). By default, each instance that you launch in the VPC has the default DHCP // options, which include only a default DNS server that we provide diff --git a/service/ec2/api_op_DeleteIpamPool.go b/service/ec2/api_op_DeleteIpamPool.go index 2505389b8d7..737c87e6c84 100644 --- a/service/ec2/api_op_DeleteIpamPool.go +++ b/service/ec2/api_op_DeleteIpamPool.go @@ -40,6 +40,13 @@ type DeleteIpamPoolInput struct { // This member is required. IpamPoolId *string + // Enables you to quickly delete an IPAM pool and all resources within that pool, + // including provisioned CIDRs, allocations, and other pools. You can only use this + // option to delete pools in the private scope or pools in the public scope with a + // source resource. A source resource is a resource used to provision CIDRs to a + // resource planning pool. + Cascade *bool + // A check for whether you have the required permissions for the action without // actually making the request and provides an error response. If you have the // required permissions, the error response is DryRunOperation . Otherwise, it is diff --git a/service/ec2/api_op_DeprovisionIpamByoasn.go b/service/ec2/api_op_DeprovisionIpamByoasn.go new file mode 100644 index 00000000000..493cca038ee --- /dev/null +++ b/service/ec2/api_op_DeprovisionIpamByoasn.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deprovisions your Autonomous System Number (ASN) from your Amazon Web Services +// account. This action can only be called after any BYOIP CIDR associations are +// removed from your Amazon Web Services account with DisassociateIpamByoasn (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DisassociateIpamByoasn.html) +// . For more information, see Tutorial: Bring your ASN to IPAM (https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html) +// in the Amazon VPC IPAM guide. +func (c *Client) DeprovisionIpamByoasn(ctx context.Context, params *DeprovisionIpamByoasnInput, optFns ...func(*Options)) (*DeprovisionIpamByoasnOutput, error) { + if params == nil { + params = &DeprovisionIpamByoasnInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeprovisionIpamByoasn", params, optFns, c.addOperationDeprovisionIpamByoasnMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeprovisionIpamByoasnOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeprovisionIpamByoasnInput struct { + + // An ASN. + // + // This member is required. + Asn *string + + // The IPAM ID. + // + // This member is required. + IpamId *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type DeprovisionIpamByoasnOutput struct { + + // An ASN and BYOIP CIDR association. + Byoasn *types.Byoasn + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeprovisionIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpDeprovisionIpamByoasn{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDeprovisionIpamByoasn{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeprovisionIpamByoasn"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeprovisionIpamByoasnValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprovisionIpamByoasn(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeprovisionIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeprovisionIpamByoasn", + } +} diff --git a/service/ec2/api_op_DescribeIpamByoasn.go b/service/ec2/api_op_DescribeIpamByoasn.go new file mode 100644 index 00000000000..1b8e48b49b4 --- /dev/null +++ b/service/ec2/api_op_DescribeIpamByoasn.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes your Autonomous System Numbers (ASNs), their provisioning statuses, +// and the BYOIP CIDRs with which they are associated. For more information, see +// Tutorial: Bring your ASN to IPAM (https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html) +// in the Amazon VPC IPAM guide. +func (c *Client) DescribeIpamByoasn(ctx context.Context, params *DescribeIpamByoasnInput, optFns ...func(*Options)) (*DescribeIpamByoasnOutput, error) { + if params == nil { + params = &DescribeIpamByoasnInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeIpamByoasn", params, optFns, c.addOperationDescribeIpamByoasnMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeIpamByoasnOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeIpamByoasnInput struct { + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int32 + + // The token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeIpamByoasnOutput struct { + + // ASN and BYOIP CIDR associations. + Byoasns []types.Byoasn + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeIpamByoasn{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeIpamByoasn{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIpamByoasn"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIpamByoasn(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeIpamByoasn", + } +} diff --git a/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go b/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go index af3366b6248..8d29d015516 100644 --- a/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go +++ b/service/ec2/api_op_DescribeTrunkInterfaceAssociations.go @@ -12,9 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API action is currently in limited preview only. If you are interested in -// using this feature, contact your account manager. Describes one or more network -// interface trunk associations. +// Describes one or more network interface trunk associations. func (c *Client) DescribeTrunkInterfaceAssociations(ctx context.Context, params *DescribeTrunkInterfaceAssociationsInput, optFns ...func(*Options)) (*DescribeTrunkInterfaceAssociationsOutput, error) { if params == nil { params = &DescribeTrunkInterfaceAssociationsInput{} diff --git a/service/ec2/api_op_DisassociateIpamByoasn.go b/service/ec2/api_op_DisassociateIpamByoasn.go new file mode 100644 index 00000000000..5a33091886c --- /dev/null +++ b/service/ec2/api_op_DisassociateIpamByoasn.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Remove the association between your Autonomous System Number (ASN) and your +// BYOIP CIDR. You may want to use this action to disassociate an ASN from a CIDR +// or if you want to swap ASNs. For more information, see Tutorial: Bring your ASN +// to IPAM (https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html) in +// the Amazon VPC IPAM guide. +func (c *Client) DisassociateIpamByoasn(ctx context.Context, params *DisassociateIpamByoasnInput, optFns ...func(*Options)) (*DisassociateIpamByoasnOutput, error) { + if params == nil { + params = &DisassociateIpamByoasnInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateIpamByoasn", params, optFns, c.addOperationDisassociateIpamByoasnMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateIpamByoasnOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateIpamByoasnInput struct { + + // A public 2-byte or 4-byte ASN. + // + // This member is required. + Asn *string + + // A BYOIP CIDR. + // + // This member is required. + Cidr *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type DisassociateIpamByoasnOutput struct { + + // An ASN and BYOIP CIDR association. + AsnAssociation *types.AsnAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociateIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateIpamByoasn{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateIpamByoasn{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateIpamByoasn"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateIpamByoasnValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateIpamByoasn(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociateIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisassociateIpamByoasn", + } +} diff --git a/service/ec2/api_op_DisassociateTrunkInterface.go b/service/ec2/api_op_DisassociateTrunkInterface.go index 71adfac62e8..9f637a89ed1 100644 --- a/service/ec2/api_op_DisassociateTrunkInterface.go +++ b/service/ec2/api_op_DisassociateTrunkInterface.go @@ -11,9 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API action is currently in limited preview only. If you are interested in -// using this feature, contact your account manager. Removes an association between -// a branch network interface with a trunk network interface. +// Removes an association between a branch network interface with a trunk network +// interface. func (c *Client) DisassociateTrunkInterface(ctx context.Context, params *DisassociateTrunkInterfaceInput, optFns ...func(*Options)) (*DisassociateTrunkInterfaceOutput, error) { if params == nil { params = &DisassociateTrunkInterfaceInput{} diff --git a/service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go b/service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go new file mode 100644 index 00000000000..73113536557 --- /dev/null +++ b/service/ec2/api_op_GetIpamDiscoveredPublicAddresses.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets the public IP addresses that have been discovered by IPAM. +func (c *Client) GetIpamDiscoveredPublicAddresses(ctx context.Context, params *GetIpamDiscoveredPublicAddressesInput, optFns ...func(*Options)) (*GetIpamDiscoveredPublicAddressesOutput, error) { + if params == nil { + params = &GetIpamDiscoveredPublicAddressesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIpamDiscoveredPublicAddresses", params, optFns, c.addOperationGetIpamDiscoveredPublicAddressesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIpamDiscoveredPublicAddressesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetIpamDiscoveredPublicAddressesInput struct { + + // The Amazon Web Services Region for the IP address. + // + // This member is required. + AddressRegion *string + + // An IPAM resource discovery ID. + // + // This member is required. + IpamResourceDiscoveryId *string + + // A check for whether you have the required permissions for the action without + // actually making the request and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + // Filters. + Filters []types.Filter + + // The maximum number of IPAM discovered public addresses to return in one page of + // results. + MaxResults *int32 + + // The token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type GetIpamDiscoveredPublicAddressesOutput struct { + + // IPAM discovered public addresses. + IpamDiscoveredPublicAddresses []types.IpamDiscoveredPublicAddress + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // The oldest successful resource discovery time. + OldestSampleTime *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIpamDiscoveredPublicAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetIpamDiscoveredPublicAddresses"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetIpamDiscoveredPublicAddressesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIpamDiscoveredPublicAddresses(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetIpamDiscoveredPublicAddresses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetIpamDiscoveredPublicAddresses", + } +} diff --git a/service/ec2/api_op_ModifyIpam.go b/service/ec2/api_op_ModifyIpam.go index 65338ad174e..51ece83079e 100644 --- a/service/ec2/api_op_ModifyIpam.go +++ b/service/ec2/api_op_ModifyIpam.go @@ -55,6 +55,11 @@ type ModifyIpamInput struct { // The operating Regions to remove. RemoveOperatingRegions []types.RemoveIpamOperatingRegion + // IPAM is offered in a Free Tier and an Advanced Tier. For more information about + // the features available in each tier and the costs associated with the tiers, see + // Amazon VPC pricing > IPAM tab (http://aws.amazon.com/vpc/pricing/) . + Tier types.IpamTier + noSmithyDocumentSerde } diff --git a/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go b/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go index d5d1dae8b9a..63190d92927 100644 --- a/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go +++ b/service/ec2/api_op_ModifyNetworkInterfaceAttribute.go @@ -42,6 +42,9 @@ type ModifyNetworkInterfaceAttributeInput struct { // termination attribute, you must specify the ID of the interface attachment. Attachment *types.NetworkInterfaceAttachmentChanges + // A connection tracking specification. + ConnectionTrackingSpecification *types.ConnectionTrackingSpecificationRequest + // A description for the network interface. Description *types.AttributeValue diff --git a/service/ec2/api_op_ProvisionIpamByoasn.go b/service/ec2/api_op_ProvisionIpamByoasn.go new file mode 100644 index 00000000000..7126070d8c4 --- /dev/null +++ b/service/ec2/api_op_ProvisionIpamByoasn.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provisions your Autonomous System Number (ASN) for use in your Amazon Web +// Services account. This action requires authorization context for Amazon to bring +// the ASN to an Amazon Web Services account. For more information, see Tutorial: +// Bring your ASN to IPAM (https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html) +// in the Amazon VPC IPAM guide. +func (c *Client) ProvisionIpamByoasn(ctx context.Context, params *ProvisionIpamByoasnInput, optFns ...func(*Options)) (*ProvisionIpamByoasnOutput, error) { + if params == nil { + params = &ProvisionIpamByoasnInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ProvisionIpamByoasn", params, optFns, c.addOperationProvisionIpamByoasnMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ProvisionIpamByoasnOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ProvisionIpamByoasnInput struct { + + // A public 2-byte or 4-byte ASN. + // + // This member is required. + Asn *string + + // An ASN authorization context. + // + // This member is required. + AsnAuthorizationContext *types.AsnAuthorizationContext + + // An IPAM ID. + // + // This member is required. + IpamId *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type ProvisionIpamByoasnOutput struct { + + // An ASN and BYOIP CIDR association. + Byoasn *types.Byoasn + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationProvisionIpamByoasnMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpProvisionIpamByoasn{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpProvisionIpamByoasn{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ProvisionIpamByoasn"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpProvisionIpamByoasnValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opProvisionIpamByoasn(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opProvisionIpamByoasn(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ProvisionIpamByoasn", + } +} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index e4227866052..195b0e246fc 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -1912,6 +1912,97 @@ func awsEc2query_deserializeOpErrorAssociateInstanceEventWindow(response *smithy } } +type awsEc2query_deserializeOpAssociateIpamByoasn struct { +} + +func (*awsEc2query_deserializeOpAssociateIpamByoasn) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpAssociateIpamByoasn) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorAssociateIpamByoasn(response, &metadata) + } + output := &AssociateIpamByoasnOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentAssociateIpamByoasnOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorAssociateIpamByoasn(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpAssociateIpamResourceDiscovery struct { } @@ -18627,6 +18718,97 @@ func awsEc2query_deserializeOpErrorDeprovisionByoipCidr(response *smithyhttp.Res } } +type awsEc2query_deserializeOpDeprovisionIpamByoasn struct { +} + +func (*awsEc2query_deserializeOpDeprovisionIpamByoasn) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDeprovisionIpamByoasn) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorDeprovisionIpamByoasn(response, &metadata) + } + output := &DeprovisionIpamByoasnOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDeprovisionIpamByoasnOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorDeprovisionIpamByoasn(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpDeprovisionIpamPoolCidr struct { } @@ -24246,6 +24428,97 @@ func awsEc2query_deserializeOpErrorDescribeInternetGateways(response *smithyhttp } } +type awsEc2query_deserializeOpDescribeIpamByoasn struct { +} + +func (*awsEc2query_deserializeOpDescribeIpamByoasn) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDescribeIpamByoasn) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorDescribeIpamByoasn(response, &metadata) + } + output := &DescribeIpamByoasnOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDescribeIpamByoasnOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorDescribeIpamByoasn(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpDescribeIpamPools struct { } @@ -34869,14 +35142,14 @@ func awsEc2query_deserializeOpErrorDisassociateInstanceEventWindow(response *smi } } -type awsEc2query_deserializeOpDisassociateIpamResourceDiscovery struct { +type awsEc2query_deserializeOpDisassociateIpamByoasn struct { } -func (*awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) ID() string { +func (*awsEc2query_deserializeOpDisassociateIpamByoasn) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateIpamByoasn) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -34890,9 +35163,9 @@ func (m *awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateIpamResourceDiscovery(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateIpamByoasn(response, &metadata) } - output := &DisassociateIpamResourceDiscoveryOutput{} + output := &DisassociateIpamByoasnOutput{} out.Result = output var buff [1024]byte @@ -34913,7 +35186,7 @@ func (m *awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateIpamResourceDiscoveryOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateIpamByoasnOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -34927,7 +35200,98 @@ func (m *awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorDisassociateIpamResourceDiscovery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateIpamByoasn(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsEc2query_deserializeOpDisassociateIpamResourceDiscovery struct { +} + +func (*awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDisassociateIpamResourceDiscovery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorDisassociateIpamResourceDiscovery(response, &metadata) + } + output := &DisassociateIpamResourceDiscoveryOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDisassociateIpamResourceDiscoveryOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorDisassociateIpamResourceDiscovery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39168,6 +39532,97 @@ func awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(response *smithyhtt } } +type awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses struct { +} + +func (*awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(response, &metadata) + } + output := &GetIpamDiscoveredPublicAddressesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredPublicAddressesOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs struct { } @@ -48516,6 +48971,97 @@ func awsEc2query_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Respo } } +type awsEc2query_deserializeOpProvisionIpamByoasn struct { +} + +func (*awsEc2query_deserializeOpProvisionIpamByoasn) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpProvisionIpamByoasn) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorProvisionIpamByoasn(response, &metadata) + } + output := &ProvisionIpamByoasnOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentProvisionIpamByoasnOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorProvisionIpamByoasn(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpProvisionIpamPoolCidr struct { } @@ -57507,6 +58053,162 @@ func awsEc2query_deserializeDocumentArnListUnwrapped(v *[]string, decoder smithy *v = sv return nil } +func awsEc2query_deserializeDocumentAsnAssociation(v **types.AsnAssociation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AsnAssociation + if *v == nil { + sv = &types.AsnAssociation{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("asn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Asn = ptr.String(xtv) + } + + case strings.EqualFold("cidr", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Cidr = ptr.String(xtv) + } + + case strings.EqualFold("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.AsnAssociationState(xtv) + } + + case strings.EqualFold("statusMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentAsnAssociationSet(v *[]types.AsnAssociation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AsnAssociation + if *v == nil { + sv = make([]types.AsnAssociation, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.AsnAssociation + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentAsnAssociation(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentAsnAssociationSetUnwrapped(v *[]types.AsnAssociation, decoder smithyxml.NodeDecoder) error { + var sv []types.AsnAssociation + if *v == nil { + sv = make([]types.AsnAssociation, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AsnAssociation + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentAsnAssociation(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentAssignedPrivateIpAddress(v **types.AssignedPrivateIpAddress, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -59408,6 +60110,162 @@ func awsEc2query_deserializeDocumentBundleTaskListUnwrapped(v *[]types.BundleTas *v = sv return nil } +func awsEc2query_deserializeDocumentByoasn(v **types.Byoasn, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Byoasn + if *v == nil { + sv = &types.Byoasn{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("asn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Asn = ptr.String(xtv) + } + + case strings.EqualFold("ipamId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IpamId = ptr.String(xtv) + } + + case strings.EqualFold("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.AsnState(xtv) + } + + case strings.EqualFold("statusMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentByoasnSet(v *[]types.Byoasn, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Byoasn + if *v == nil { + sv = make([]types.Byoasn, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.Byoasn + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentByoasn(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentByoasnSetUnwrapped(v *[]types.Byoasn, decoder smithyxml.NodeDecoder) error { + var sv []types.Byoasn + if *v == nil { + sv = make([]types.Byoasn, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Byoasn + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentByoasn(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentByoipCidr(v **types.ByoipCidr, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -59430,6 +60288,12 @@ func awsEc2query_deserializeDocumentByoipCidr(v **types.ByoipCidr, decoder smith originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("asnAssociationSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentAsnAssociationSet(&sv.AsnAssociations, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("cidr", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -64555,6 +65419,354 @@ func awsEc2query_deserializeDocumentConnectionNotificationSetUnwrapped(v *[]type *v = sv return nil } +func awsEc2query_deserializeDocumentConnectionTrackingConfiguration(v **types.ConnectionTrackingConfiguration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConnectionTrackingConfiguration + if *v == nil { + sv = &types.ConnectionTrackingConfiguration{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("tcpEstablishedTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("udpStreamTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpStreamTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("udpTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpTimeout = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentConnectionTrackingSpecification(v **types.ConnectionTrackingSpecification, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConnectionTrackingSpecification + if *v == nil { + sv = &types.ConnectionTrackingSpecification{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("tcpEstablishedTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("udpStreamTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpStreamTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("udpTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpTimeout = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentConnectionTrackingSpecificationRequest(v **types.ConnectionTrackingSpecificationRequest, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConnectionTrackingSpecificationRequest + if *v == nil { + sv = &types.ConnectionTrackingSpecificationRequest{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TcpEstablishedTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("UdpStreamTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpStreamTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("UdpTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpTimeout = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentConnectionTrackingSpecificationResponse(v **types.ConnectionTrackingSpecificationResponse, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConnectionTrackingSpecificationResponse + if *v == nil { + sv = &types.ConnectionTrackingSpecificationResponse{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("tcpEstablishedTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TcpEstablishedTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("udpStreamTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpStreamTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("udpTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UdpTimeout = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentConversionTask(v **types.ConversionTask, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -83064,6 +84276,12 @@ func awsEc2query_deserializeDocumentInstanceNetworkInterface(v **types.InstanceN return err } + case strings.EqualFold("connectionTrackingConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentConnectionTrackingSpecificationResponse(&sv.ConnectionTrackingConfiguration, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("description", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -83612,6 +84830,12 @@ func awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecification(v **ty sv.AssociatePublicIpAddress = ptr.Bool(xtv) } + case strings.EqualFold("ConnectionTrackingSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentConnectionTrackingSpecificationRequest(&sv.ConnectionTrackingSpecification, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("deleteOnTermination", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -86856,12 +88080,38 @@ func awsEc2query_deserializeDocumentIpam(v **types.Ipam, decoder smithyxml.NodeD sv.State = types.IpamState(xtv) } + case strings.EqualFold("stateMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StateMessage = ptr.String(xtv) + } + case strings.EqualFold("tagSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { return err } + case strings.EqualFold("tier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Tier = types.IpamTier(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -87301,6 +88551,347 @@ func awsEc2query_deserializeDocumentIpamDiscoveredAccountSetUnwrapped(v *[]types *v = sv return nil } +func awsEc2query_deserializeDocumentIpamDiscoveredPublicAddress(v **types.IpamDiscoveredPublicAddress, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IpamDiscoveredPublicAddress + if *v == nil { + sv = &types.IpamDiscoveredPublicAddress{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("address", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Address = ptr.String(xtv) + } + + case strings.EqualFold("addressAllocationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AddressAllocationId = ptr.String(xtv) + } + + case strings.EqualFold("addressOwnerId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AddressOwnerId = ptr.String(xtv) + } + + case strings.EqualFold("addressRegion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AddressRegion = ptr.String(xtv) + } + + case strings.EqualFold("addressType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AddressType = types.IpamPublicAddressType(xtv) + } + + case strings.EqualFold("associationStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AssociationStatus = types.IpamPublicAddressAssociationStatus(xtv) + } + + case strings.EqualFold("instanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceId = ptr.String(xtv) + } + + case strings.EqualFold("ipamResourceDiscoveryId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IpamResourceDiscoveryId = ptr.String(xtv) + } + + case strings.EqualFold("networkBorderGroup", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NetworkBorderGroup = ptr.String(xtv) + } + + case strings.EqualFold("networkInterfaceDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NetworkInterfaceDescription = ptr.String(xtv) + } + + case strings.EqualFold("networkInterfaceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NetworkInterfaceId = ptr.String(xtv) + } + + case strings.EqualFold("publicIpv4PoolId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PublicIpv4PoolId = ptr.String(xtv) + } + + case strings.EqualFold("sampleTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SampleTime = ptr.Time(t) + } + + case strings.EqualFold("securityGroupSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroupList(&sv.SecurityGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("service", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Service = types.IpamPublicAddressAwsService(xtv) + } + + case strings.EqualFold("serviceResource", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ServiceResource = ptr.String(xtv) + } + + case strings.EqualFold("subnetId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubnetId = ptr.String(xtv) + } + + case strings.EqualFold("tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamPublicAddressTags(&sv.Tags, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("vpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamDiscoveredPublicAddressSet(v *[]types.IpamDiscoveredPublicAddress, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.IpamDiscoveredPublicAddress + if *v == nil { + sv = make([]types.IpamDiscoveredPublicAddress, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.IpamDiscoveredPublicAddress + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentIpamDiscoveredPublicAddress(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamDiscoveredPublicAddressSetUnwrapped(v *[]types.IpamDiscoveredPublicAddress, decoder smithyxml.NodeDecoder) error { + var sv []types.IpamDiscoveredPublicAddress + if *v == nil { + sv = make([]types.IpamDiscoveredPublicAddress, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.IpamDiscoveredPublicAddress + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentIpamDiscoveredPublicAddress(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentIpamDiscoveredResourceCidr(v **types.IpamDiscoveredResourceCidr, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -88012,6 +89603,12 @@ func awsEc2query_deserializeDocumentIpamPool(v **types.IpamPool, decoder smithyx sv.SourceIpamPoolId = ptr.String(xtv) } + case strings.EqualFold("sourceResource", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamPoolSourceResource(&sv.SourceResource, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("state", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -88093,7 +89690,208 @@ func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocat sv.Cidr = ptr.String(xtv) } - case strings.EqualFold("description", t.Name.Local): + case strings.EqualFold("description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("ipamPoolAllocationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IpamPoolAllocationId = ptr.String(xtv) + } + + case strings.EqualFold("resourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceId = ptr.String(xtv) + } + + case strings.EqualFold("resourceOwner", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceOwner = ptr.String(xtv) + } + + case strings.EqualFold("resourceRegion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceRegion = ptr.String(xtv) + } + + case strings.EqualFold("resourceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceType = types.IpamPoolAllocationResourceType(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamPoolAllocationSet(v *[]types.IpamPoolAllocation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.IpamPoolAllocation + if *v == nil { + sv = make([]types.IpamPoolAllocation, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.IpamPoolAllocation + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentIpamPoolAllocation(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamPoolAllocationSetUnwrapped(v *[]types.IpamPoolAllocation, decoder smithyxml.NodeDecoder) error { + var sv []types.IpamPoolAllocation + if *v == nil { + sv = make([]types.IpamPoolAllocation, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.IpamPoolAllocation + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentIpamPoolAllocation(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IpamPoolCidr + if *v == nil { + sv = &types.IpamPoolCidr{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("cidr", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Cidr = ptr.String(xtv) + } + + case strings.EqualFold("failureReason", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(&sv.FailureReason, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ipamPoolCidrId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88103,10 +89901,10 @@ func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocat } { xtv := string(val) - sv.Description = ptr.String(xtv) + sv.IpamPoolCidrId = ptr.String(xtv) } - case strings.EqualFold("ipamPoolAllocationId", t.Name.Local): + case strings.EqualFold("netmaskLength", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88116,10 +89914,14 @@ func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocat } { xtv := string(val) - sv.IpamPoolAllocationId = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.NetmaskLength = ptr.Int32(int32(i64)) } - case strings.EqualFold("resourceId", t.Name.Local): + case strings.EqualFold("state", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88129,23 +89931,46 @@ func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocat } { xtv := string(val) - sv.ResourceId = ptr.String(xtv) + sv.State = types.IpamPoolCidrState(xtv) } - case strings.EqualFold("resourceOwner", t.Name.Local): - val, err := decoder.Value() + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() if err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.ResourceOwner = ptr.String(xtv) - } - case strings.EqualFold("resourceRegion", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(v **types.IpamPoolCidrFailureReason, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IpamPoolCidrFailureReason + if *v == nil { + sv = &types.IpamPoolCidrFailureReason{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("code", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88155,10 +89980,10 @@ func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocat } { xtv := string(val) - sv.ResourceRegion = ptr.String(xtv) + sv.Code = types.IpamPoolCidrFailureCode(xtv) } - case strings.EqualFold("resourceType", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88168,7 +89993,7 @@ func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocat } { xtv := string(val) - sv.ResourceType = types.IpamPoolAllocationResourceType(xtv) + sv.Message = ptr.String(xtv) } default: @@ -88185,13 +90010,13 @@ func awsEc2query_deserializeDocumentIpamPoolAllocation(v **types.IpamPoolAllocat return nil } -func awsEc2query_deserializeDocumentIpamPoolAllocationSet(v *[]types.IpamPoolAllocation, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeDocumentIpamPoolCidrSet(v *[]types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.IpamPoolAllocation + var sv []types.IpamPoolCidr if *v == nil { - sv = make([]types.IpamPoolAllocation, 0) + sv = make([]types.IpamPoolCidr, 0) } else { sv = *v } @@ -88207,10 +90032,10 @@ func awsEc2query_deserializeDocumentIpamPoolAllocationSet(v *[]types.IpamPoolAll } switch { case strings.EqualFold("item", t.Name.Local): - var col types.IpamPoolAllocation + var col types.IpamPoolCidr nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPoolAllocation(&destAddr, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpamPoolCidr(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -88229,22 +90054,22 @@ func awsEc2query_deserializeDocumentIpamPoolAllocationSet(v *[]types.IpamPoolAll return nil } -func awsEc2query_deserializeDocumentIpamPoolAllocationSetUnwrapped(v *[]types.IpamPoolAllocation, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPoolAllocation +func awsEc2query_deserializeDocumentIpamPoolCidrSetUnwrapped(v *[]types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { + var sv []types.IpamPoolCidr if *v == nil { - sv = make([]types.IpamPoolAllocation, 0) + sv = make([]types.IpamPoolCidr, 0) } else { sv = *v } switch { default: - var mv types.IpamPoolAllocation + var mv types.IpamPoolCidr t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPoolAllocation(&destAddr, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpamPoolCidr(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -88253,13 +90078,81 @@ func awsEc2query_deserializeDocumentIpamPoolAllocationSetUnwrapped(v *[]types.Ip *v = sv return nil } -func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeDocumentIpamPoolSet(v *[]types.IpamPool, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.IpamPoolCidr + var sv []types.IpamPool if *v == nil { - sv = &types.IpamPoolCidr{} + sv = make([]types.IpamPool, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.IpamPool + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentIpamPool(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamPoolSetUnwrapped(v *[]types.IpamPool, decoder smithyxml.NodeDecoder) error { + var sv []types.IpamPool + if *v == nil { + sv = make([]types.IpamPool, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.IpamPool + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentIpamPool(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsEc2query_deserializeDocumentIpamPoolSourceResource(v **types.IpamPoolSourceResource, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IpamPoolSourceResource + if *v == nil { + sv = &types.IpamPoolSourceResource{} } else { sv = *v } @@ -88275,7 +90168,7 @@ func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("cidr", t.Name.Local): + case strings.EqualFold("resourceId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88285,16 +90178,10 @@ func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder } { xtv := string(val) - sv.Cidr = ptr.String(xtv) - } - - case strings.EqualFold("failureReason", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(&sv.FailureReason, nodeDecoder); err != nil { - return err + sv.ResourceId = ptr.String(xtv) } - case strings.EqualFold("ipamPoolCidrId", t.Name.Local): + case strings.EqualFold("resourceOwner", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88304,10 +90191,10 @@ func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder } { xtv := string(val) - sv.IpamPoolCidrId = ptr.String(xtv) + sv.ResourceOwner = ptr.String(xtv) } - case strings.EqualFold("netmaskLength", t.Name.Local): + case strings.EqualFold("resourceRegion", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88317,14 +90204,10 @@ func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NetmaskLength = ptr.Int32(int32(i64)) + sv.ResourceRegion = ptr.String(xtv) } - case strings.EqualFold("state", t.Name.Local): + case strings.EqualFold("resourceType", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88334,7 +90217,7 @@ func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder } { xtv := string(val) - sv.State = types.IpamPoolCidrState(xtv) + sv.ResourceType = types.IpamPoolSourceResourceType(xtv) } default: @@ -88351,13 +90234,13 @@ func awsEc2query_deserializeDocumentIpamPoolCidr(v **types.IpamPoolCidr, decoder return nil } -func awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(v **types.IpamPoolCidrFailureReason, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroup(v **types.IpamPublicAddressSecurityGroup, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.IpamPoolCidrFailureReason + var sv *types.IpamPublicAddressSecurityGroup if *v == nil { - sv = &types.IpamPoolCidrFailureReason{} + sv = &types.IpamPublicAddressSecurityGroup{} } else { sv = *v } @@ -88373,7 +90256,7 @@ func awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(v **types.IpamPool originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("code", t.Name.Local): + case strings.EqualFold("groupId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88383,10 +90266,10 @@ func awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(v **types.IpamPool } { xtv := string(val) - sv.Code = types.IpamPoolCidrFailureCode(xtv) + sv.GroupId = ptr.String(xtv) } - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("groupName", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -88396,7 +90279,7 @@ func awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(v **types.IpamPool } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.GroupName = ptr.String(xtv) } default: @@ -88413,13 +90296,13 @@ func awsEc2query_deserializeDocumentIpamPoolCidrFailureReason(v **types.IpamPool return nil } -func awsEc2query_deserializeDocumentIpamPoolCidrSet(v *[]types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroupList(v *[]types.IpamPublicAddressSecurityGroup, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.IpamPoolCidr + var sv []types.IpamPublicAddressSecurityGroup if *v == nil { - sv = make([]types.IpamPoolCidr, 0) + sv = make([]types.IpamPublicAddressSecurityGroup, 0) } else { sv = *v } @@ -88435,10 +90318,10 @@ func awsEc2query_deserializeDocumentIpamPoolCidrSet(v *[]types.IpamPoolCidr, dec } switch { case strings.EqualFold("item", t.Name.Local): - var col types.IpamPoolCidr + var col types.IpamPublicAddressSecurityGroup nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPoolCidr(&destAddr, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroup(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -88457,22 +90340,22 @@ func awsEc2query_deserializeDocumentIpamPoolCidrSet(v *[]types.IpamPoolCidr, dec return nil } -func awsEc2query_deserializeDocumentIpamPoolCidrSetUnwrapped(v *[]types.IpamPoolCidr, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPoolCidr +func awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroupListUnwrapped(v *[]types.IpamPublicAddressSecurityGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.IpamPublicAddressSecurityGroup if *v == nil { - sv = make([]types.IpamPoolCidr, 0) + sv = make([]types.IpamPublicAddressSecurityGroup, 0) } else { sv = *v } switch { default: - var mv types.IpamPoolCidr + var mv types.IpamPublicAddressSecurityGroup t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPoolCidr(&destAddr, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpamPublicAddressSecurityGroup(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -88481,13 +90364,75 @@ func awsEc2query_deserializeDocumentIpamPoolCidrSetUnwrapped(v *[]types.IpamPool *v = sv return nil } -func awsEc2query_deserializeDocumentIpamPoolSet(v *[]types.IpamPool, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeDocumentIpamPublicAddressTag(v **types.IpamPublicAddressTag, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.IpamPool + var sv *types.IpamPublicAddressTag if *v == nil { - sv = make([]types.IpamPool, 0) + sv = &types.IpamPublicAddressTag{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Key = ptr.String(xtv) + } + + case strings.EqualFold("value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamPublicAddressTagList(v *[]types.IpamPublicAddressTag, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.IpamPublicAddressTag + if *v == nil { + sv = make([]types.IpamPublicAddressTag, 0) } else { sv = *v } @@ -88503,10 +90448,10 @@ func awsEc2query_deserializeDocumentIpamPoolSet(v *[]types.IpamPool, decoder smi } switch { case strings.EqualFold("item", t.Name.Local): - var col types.IpamPool + var col types.IpamPublicAddressTag nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsEc2query_deserializeDocumentIpamPool(&destAddr, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpamPublicAddressTag(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -88525,22 +90470,22 @@ func awsEc2query_deserializeDocumentIpamPoolSet(v *[]types.IpamPool, decoder smi return nil } -func awsEc2query_deserializeDocumentIpamPoolSetUnwrapped(v *[]types.IpamPool, decoder smithyxml.NodeDecoder) error { - var sv []types.IpamPool +func awsEc2query_deserializeDocumentIpamPublicAddressTagListUnwrapped(v *[]types.IpamPublicAddressTag, decoder smithyxml.NodeDecoder) error { + var sv []types.IpamPublicAddressTag if *v == nil { - sv = make([]types.IpamPool, 0) + sv = make([]types.IpamPublicAddressTag, 0) } else { sv = *v } switch { default: - var mv types.IpamPool + var mv types.IpamPublicAddressTag t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsEc2query_deserializeDocumentIpamPool(&destAddr, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpamPublicAddressTag(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -88549,6 +90494,48 @@ func awsEc2query_deserializeDocumentIpamPoolSetUnwrapped(v *[]types.IpamPool, de *v = sv return nil } +func awsEc2query_deserializeDocumentIpamPublicAddressTags(v **types.IpamPublicAddressTags, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IpamPublicAddressTags + if *v == nil { + sv = &types.IpamPublicAddressTags{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("eipTagSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamPublicAddressTagList(&sv.EipTags, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentIpamResourceCidr(v **types.IpamResourceCidr, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -93606,6 +95593,12 @@ func awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecif sv.AssociatePublicIpAddress = ptr.Bool(xtv) } + case strings.EqualFold("connectionTrackingSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentConnectionTrackingSpecification(&sv.ConnectionTrackingSpecification, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("deleteOnTermination", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -100518,6 +102511,12 @@ func awsEc2query_deserializeDocumentNetworkInterface(v **types.NetworkInterface, sv.AvailabilityZone = ptr.String(xtv) } + case strings.EqualFold("connectionTrackingConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentConnectionTrackingConfiguration(&sv.ConnectionTrackingConfiguration, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("denyAllIgwTraffic", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -137255,6 +139254,48 @@ func awsEc2query_deserializeOpDocumentAssociateInstanceEventWindowOutput(v **Ass return nil } +func awsEc2query_deserializeOpDocumentAssociateIpamByoasnOutput(v **AssociateIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AssociateIpamByoasnOutput + if *v == nil { + sv = &AssociateIpamByoasnOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("asnAssociation", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentAsnAssociation(&sv.AsnAssociation, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentAssociateIpamResourceDiscoveryOutput(v **AssociateIpamResourceDiscoveryOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -145625,6 +147666,48 @@ func awsEc2query_deserializeOpDocumentDeprovisionByoipCidrOutput(v **Deprovision return nil } +func awsEc2query_deserializeOpDocumentDeprovisionIpamByoasnOutput(v **DeprovisionIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeprovisionIpamByoasnOutput + if *v == nil { + sv = &DeprovisionIpamByoasnOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("byoasn", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentByoasn(&sv.Byoasn, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDeprovisionIpamPoolCidrOutput(v **DeprovisionIpamPoolCidrOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -149021,6 +151104,61 @@ func awsEc2query_deserializeOpDocumentDescribeInternetGatewaysOutput(v **Describ return nil } +func awsEc2query_deserializeOpDocumentDescribeIpamByoasnOutput(v **DescribeIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeIpamByoasnOutput + if *v == nil { + sv = &DescribeIpamByoasnOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("byoasnSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentByoasnSet(&sv.Byoasns, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDescribeIpamPoolsOutput(v **DescribeIpamPoolsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -155264,6 +157402,48 @@ func awsEc2query_deserializeOpDocumentDisassociateInstanceEventWindowOutput(v ** return nil } +func awsEc2query_deserializeOpDocumentDisassociateIpamByoasnOutput(v **DisassociateIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DisassociateIpamByoasnOutput + if *v == nil { + sv = &DisassociateIpamByoasnOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("asnAssociation", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentAsnAssociation(&sv.AsnAssociation, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDisassociateIpamResourceDiscoveryOutput(v **DisassociateIpamResourceDiscoveryOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -157937,6 +160117,78 @@ func awsEc2query_deserializeOpDocumentGetIpamDiscoveredAccountsOutput(v **GetIpa return nil } +func awsEc2query_deserializeOpDocumentGetIpamDiscoveredPublicAddressesOutput(v **GetIpamDiscoveredPublicAddressesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetIpamDiscoveredPublicAddressesOutput + if *v == nil { + sv = &GetIpamDiscoveredPublicAddressesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ipamDiscoveredPublicAddressSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamDiscoveredPublicAddressSet(&sv.IpamDiscoveredPublicAddresses, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + case strings.EqualFold("oldestSampleTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.OldestSampleTime = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentGetIpamDiscoveredResourceCidrsOutput(v **GetIpamDiscoveredResourceCidrsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -163230,6 +165482,48 @@ func awsEc2query_deserializeOpDocumentProvisionByoipCidrOutput(v **ProvisionByoi return nil } +func awsEc2query_deserializeOpDocumentProvisionIpamByoasnOutput(v **ProvisionIpamByoasnOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ProvisionIpamByoasnOutput + if *v == nil { + sv = &ProvisionIpamByoasnOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("byoasn", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentByoasn(&sv.Byoasn, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentProvisionIpamPoolCidrOutput(v **ProvisionIpamPoolCidrOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/generated.json b/service/ec2/generated.json index 4e12cd44879..59d3242595b 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -33,6 +33,7 @@ "api_op_AssociateEnclaveCertificateIamRole.go", "api_op_AssociateIamInstanceProfile.go", "api_op_AssociateInstanceEventWindow.go", + "api_op_AssociateIpamByoasn.go", "api_op_AssociateIpamResourceDiscovery.go", "api_op_AssociateNatGatewayAddress.go", "api_op_AssociateRouteTable.go", @@ -224,6 +225,7 @@ "api_op_DeleteVpnConnectionRoute.go", "api_op_DeleteVpnGateway.go", "api_op_DeprovisionByoipCidr.go", + "api_op_DeprovisionIpamByoasn.go", "api_op_DeprovisionIpamPoolCidr.go", "api_op_DeprovisionPublicIpv4PoolCidr.go", "api_op_DeregisterImage.go", @@ -286,6 +288,7 @@ "api_op_DescribeInstanceTypes.go", "api_op_DescribeInstances.go", "api_op_DescribeInternetGateways.go", + "api_op_DescribeIpamByoasn.go", "api_op_DescribeIpamPools.go", "api_op_DescribeIpamResourceDiscoveries.go", "api_op_DescribeIpamResourceDiscoveryAssociations.go", @@ -404,6 +407,7 @@ "api_op_DisassociateEnclaveCertificateIamRole.go", "api_op_DisassociateIamInstanceProfile.go", "api_op_DisassociateInstanceEventWindow.go", + "api_op_DisassociateIpamByoasn.go", "api_op_DisassociateIpamResourceDiscovery.go", "api_op_DisassociateNatGatewayAddress.go", "api_op_DisassociateRouteTable.go", @@ -452,6 +456,7 @@ "api_op_GetInstanceUefiData.go", "api_op_GetIpamAddressHistory.go", "api_op_GetIpamDiscoveredAccounts.go", + "api_op_GetIpamDiscoveredPublicAddresses.go", "api_op_GetIpamDiscoveredResourceCidrs.go", "api_op_GetIpamPoolAllocations.go", "api_op_GetIpamPoolCidrs.go", @@ -557,6 +562,7 @@ "api_op_MoveAddressToVpc.go", "api_op_MoveByoipCidrToIpam.go", "api_op_ProvisionByoipCidr.go", + "api_op_ProvisionIpamByoasn.go", "api_op_ProvisionIpamPoolCidr.go", "api_op_ProvisionPublicIpv4PoolCidr.go", "api_op_PurchaseCapacityBlock.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index cf5e714d8f0..8f8f61147f6 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -1361,6 +1361,70 @@ func (m *awsEc2query_serializeOpAssociateInstanceEventWindow) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpAssociateIpamByoasn struct { +} + +func (*awsEc2query_serializeOpAssociateIpamByoasn) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpAssociateIpamByoasn) 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.(*AssociateIpamByoasnInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AssociateIpamByoasn") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentAssociateIpamByoasnInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpAssociateIpamResourceDiscovery struct { } @@ -13521,6 +13585,70 @@ func (m *awsEc2query_serializeOpDeprovisionByoipCidr) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDeprovisionIpamByoasn struct { +} + +func (*awsEc2query_serializeOpDeprovisionIpamByoasn) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDeprovisionIpamByoasn) 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.(*DeprovisionIpamByoasnInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeprovisionIpamByoasn") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDeprovisionIpamByoasnInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpDeprovisionIpamPoolCidr struct { } @@ -17489,6 +17617,70 @@ func (m *awsEc2query_serializeOpDescribeInternetGateways) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDescribeIpamByoasn struct { +} + +func (*awsEc2query_serializeOpDescribeIpamByoasn) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDescribeIpamByoasn) 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.(*DescribeIpamByoasnInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeIpamByoasn") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDescribeIpamByoasnInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpDescribeIpamPools struct { } @@ -25041,6 +25233,70 @@ func (m *awsEc2query_serializeOpDisassociateInstanceEventWindow) HandleSerialize return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDisassociateIpamByoasn struct { +} + +func (*awsEc2query_serializeOpDisassociateIpamByoasn) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDisassociateIpamByoasn) 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.(*DisassociateIpamByoasnInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DisassociateIpamByoasn") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDisassociateIpamByoasnInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpDisassociateIpamResourceDiscovery struct { } @@ -28113,14 +28369,14 @@ func (m *awsEc2query_serializeOpGetIpamDiscoveredAccounts) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs struct { +type awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses struct { } -func (*awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) ID() string { +func (*awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses) ID() string { return "OperationSerializer" } -func (m *awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsEc2query_serializeOpGetIpamDiscoveredPublicAddresses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -28128,7 +28384,7 @@ func (m *awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetIpamDiscoveredResourceCidrsInput) + input, ok := in.Parameters.(*GetIpamDiscoveredPublicAddressesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -28153,10 +28409,10 @@ func (m *awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) HandleSerialize( bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("GetIpamDiscoveredResourceCidrs") + body.Key("Action").String("GetIpamDiscoveredPublicAddresses") body.Key("Version").String("2016-11-15") - if err := awsEc2query_serializeOpDocumentGetIpamDiscoveredResourceCidrsInput(input, bodyEncoder.Value); err != nil { + if err := awsEc2query_serializeOpDocumentGetIpamDiscoveredPublicAddressesInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -28177,14 +28433,14 @@ func (m *awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) HandleSerialize( return next.HandleSerialize(ctx, in) } -type awsEc2query_serializeOpGetIpamPoolAllocations struct { +type awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs struct { } -func (*awsEc2query_serializeOpGetIpamPoolAllocations) ID() string { +func (*awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) ID() string { return "OperationSerializer" } -func (m *awsEc2query_serializeOpGetIpamPoolAllocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsEc2query_serializeOpGetIpamDiscoveredResourceCidrs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -28192,7 +28448,7 @@ func (m *awsEc2query_serializeOpGetIpamPoolAllocations) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetIpamPoolAllocationsInput) + input, ok := in.Parameters.(*GetIpamDiscoveredResourceCidrsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -28217,10 +28473,10 @@ func (m *awsEc2query_serializeOpGetIpamPoolAllocations) HandleSerialize(ctx cont bodyWriter := bytes.NewBuffer(nil) bodyEncoder := query.NewEncoder(bodyWriter) body := bodyEncoder.Object() - body.Key("Action").String("GetIpamPoolAllocations") + body.Key("Action").String("GetIpamDiscoveredResourceCidrs") body.Key("Version").String("2016-11-15") - if err := awsEc2query_serializeOpDocumentGetIpamPoolAllocationsInput(input, bodyEncoder.Value); err != nil { + if err := awsEc2query_serializeOpDocumentGetIpamDiscoveredResourceCidrsInput(input, bodyEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -28241,14 +28497,14 @@ func (m *awsEc2query_serializeOpGetIpamPoolAllocations) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsEc2query_serializeOpGetIpamPoolCidrs struct { +type awsEc2query_serializeOpGetIpamPoolAllocations struct { } -func (*awsEc2query_serializeOpGetIpamPoolCidrs) ID() string { +func (*awsEc2query_serializeOpGetIpamPoolAllocations) ID() string { return "OperationSerializer" } -func (m *awsEc2query_serializeOpGetIpamPoolCidrs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsEc2query_serializeOpGetIpamPoolAllocations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -28256,7 +28512,71 @@ func (m *awsEc2query_serializeOpGetIpamPoolCidrs) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetIpamPoolCidrsInput) + input, ok := in.Parameters.(*GetIpamPoolAllocationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetIpamPoolAllocations") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentGetIpamPoolAllocationsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsEc2query_serializeOpGetIpamPoolCidrs struct { +} + +func (*awsEc2query_serializeOpGetIpamPoolCidrs) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpGetIpamPoolCidrs) 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.(*GetIpamPoolCidrsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -34833,6 +35153,70 @@ func (m *awsEc2query_serializeOpProvisionByoipCidr) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpProvisionIpamByoasn struct { +} + +func (*awsEc2query_serializeOpProvisionIpamByoasn) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpProvisionIpamByoasn) 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.(*ProvisionIpamByoasnInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ProvisionIpamByoasn") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentProvisionIpamByoasnInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpProvisionIpamPoolCidr struct { } @@ -39243,6 +39627,23 @@ func awsEc2query_serializeDocumentArnList(v []string, value query.Value) error { return nil } +func awsEc2query_serializeDocumentAsnAuthorizationContext(v *types.AsnAuthorizationContext, value query.Value) error { + object := value.Object() + _ = object + + if v.Message != nil { + objectKey := object.Key("Message") + objectKey.String(*v.Message) + } + + if v.Signature != nil { + objectKey := object.Key("Signature") + objectKey.String(*v.Signature) + } + + return nil +} + func awsEc2query_serializeDocumentAssetIdList(v []string, value query.Value) error { array := value.Array("Member") @@ -39803,6 +40204,28 @@ func awsEc2query_serializeDocumentConnectionNotificationIdsList(v []string, valu return nil } +func awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v *types.ConnectionTrackingSpecificationRequest, value query.Value) error { + object := value.Object() + _ = object + + if v.TcpEstablishedTimeout != nil { + objectKey := object.Key("TcpEstablishedTimeout") + objectKey.Integer(*v.TcpEstablishedTimeout) + } + + if v.UdpStreamTimeout != nil { + objectKey := object.Key("UdpStreamTimeout") + objectKey.Integer(*v.UdpStreamTimeout) + } + + if v.UdpTimeout != nil { + objectKey := object.Key("UdpTimeout") + objectKey.Integer(*v.UdpTimeout) + } + + return nil +} + func awsEc2query_serializeDocumentConversionIdStringList(v []string, value query.Value) error { array := value.Array("Item") @@ -41678,6 +42101,13 @@ func awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecification(v *types objectKey.Boolean(*v.AssociatePublicIpAddress) } + if v.ConnectionTrackingSpecification != nil { + objectKey := object.Key("ConnectionTrackingSpecification") + if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { + return err + } + } + if v.DeleteOnTermination != nil { objectKey := object.Key("DeleteOnTermination") objectKey.Boolean(*v.DeleteOnTermination) @@ -42235,6 +42665,16 @@ func awsEc2query_serializeDocumentIpamCidrAuthorizationContext(v *types.IpamCidr return nil } +func awsEc2query_serializeDocumentIpamPoolAllocationAllowedCidrs(v []string, value query.Value) error { + array := value.Array("Item") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsEc2query_serializeDocumentIpamPoolAllocationDisallowedCidrs(v []string, value query.Value) error { array := value.Array("Item") @@ -42245,6 +42685,33 @@ func awsEc2query_serializeDocumentIpamPoolAllocationDisallowedCidrs(v []string, return nil } +func awsEc2query_serializeDocumentIpamPoolSourceResourceRequest(v *types.IpamPoolSourceResourceRequest, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceId != nil { + objectKey := object.Key("ResourceId") + objectKey.String(*v.ResourceId) + } + + if v.ResourceOwner != nil { + objectKey := object.Key("ResourceOwner") + objectKey.String(*v.ResourceOwner) + } + + if v.ResourceRegion != nil { + objectKey := object.Key("ResourceRegion") + objectKey.String(*v.ResourceRegion) + } + + if len(v.ResourceType) > 0 { + objectKey := object.Key("ResourceType") + objectKey.String(string(v.ResourceType)) + } + + return nil +} + func awsEc2query_serializeDocumentIpList(v []string, value query.Value) error { array := value.Array("Item") @@ -42864,6 +43331,13 @@ func awsEc2query_serializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecific objectKey.Boolean(*v.AssociatePublicIpAddress) } + if v.ConnectionTrackingSpecification != nil { + objectKey := object.Key("ConnectionTrackingSpecification") + if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { + return err + } + } + if v.DeleteOnTermination != nil { objectKey := object.Key("DeleteOnTermination") objectKey.Boolean(*v.DeleteOnTermination) @@ -48169,6 +48643,11 @@ func awsEc2query_serializeOpDocumentAdvertiseByoipCidrInput(v *AdvertiseByoipCid object := value.Object() _ = object + if v.Asn != nil { + objectKey := object.Key("Asn") + objectKey.String(*v.Asn) + } + if v.Cidr != nil { objectKey := object.Key("Cidr") objectKey.String(*v.Cidr) @@ -48296,6 +48775,13 @@ func awsEc2query_serializeOpDocumentAllocateIpamPoolCidrInput(v *AllocateIpamPoo object := value.Object() _ = object + if v.AllowedCidrs != nil { + objectKey := object.FlatKey("AllowedCidr") + if err := awsEc2query_serializeDocumentIpamPoolAllocationAllowedCidrs(v.AllowedCidrs, objectKey); err != nil { + return err + } + } + if v.Cidr != nil { objectKey := object.Key("Cidr") objectKey.String(*v.Cidr) @@ -48632,6 +49118,28 @@ func awsEc2query_serializeOpDocumentAssociateInstanceEventWindowInput(v *Associa return nil } +func awsEc2query_serializeOpDocumentAssociateIpamByoasnInput(v *AssociateIpamByoasnInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Asn != nil { + objectKey := object.Key("Asn") + objectKey.String(*v.Asn) + } + + if v.Cidr != nil { + objectKey := object.Key("Cidr") + objectKey.String(*v.Cidr) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + return nil +} + func awsEc2query_serializeOpDocumentAssociateIpamResourceDiscoveryInput(v *AssociateIpamResourceDiscoveryInput, value query.Value) error { object := value.Object() _ = object @@ -48733,6 +49241,16 @@ func awsEc2query_serializeOpDocumentAssociateSubnetCidrBlockInput(v *AssociateSu objectKey.String(*v.Ipv6CidrBlock) } + if v.Ipv6IpamPoolId != nil { + objectKey := object.Key("Ipv6IpamPoolId") + objectKey.String(*v.Ipv6IpamPoolId) + } + + if v.Ipv6NetmaskLength != nil { + objectKey := object.Key("Ipv6NetmaskLength") + objectKey.Integer(*v.Ipv6NetmaskLength) + } + if v.SubnetId != nil { objectKey := object.Key("SubnetId") objectKey.String(*v.SubnetId) @@ -50558,6 +51076,11 @@ func awsEc2query_serializeOpDocumentCreateIpamInput(v *CreateIpamInput, value qu } } + if len(v.Tier) > 0 { + objectKey := object.Key("Tier") + objectKey.String(string(v.Tier)) + } + return nil } @@ -50642,6 +51165,13 @@ func awsEc2query_serializeOpDocumentCreateIpamPoolInput(v *CreateIpamPoolInput, objectKey.String(*v.SourceIpamPoolId) } + if v.SourceResource != nil { + objectKey := object.Key("SourceResource") + if err := awsEc2query_serializeDocumentIpamPoolSourceResourceRequest(v.SourceResource, objectKey); err != nil { + return err + } + } + if v.TagSpecifications != nil { objectKey := object.FlatKey("TagSpecification") if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { @@ -51279,6 +51809,13 @@ func awsEc2query_serializeOpDocumentCreateNetworkInterfaceInput(v *CreateNetwork objectKey.String(*v.ClientToken) } + if v.ConnectionTrackingSpecification != nil { + objectKey := object.Key("ConnectionTrackingSpecification") + if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { + return err + } + } + if v.Description != nil { objectKey := object.Key("Description") objectKey.String(*v.Description) @@ -51905,16 +52442,36 @@ func awsEc2query_serializeOpDocumentCreateSubnetInput(v *CreateSubnetInput, valu objectKey.Boolean(*v.DryRun) } + if v.Ipv4IpamPoolId != nil { + objectKey := object.Key("Ipv4IpamPoolId") + objectKey.String(*v.Ipv4IpamPoolId) + } + + if v.Ipv4NetmaskLength != nil { + objectKey := object.Key("Ipv4NetmaskLength") + objectKey.Integer(*v.Ipv4NetmaskLength) + } + if v.Ipv6CidrBlock != nil { objectKey := object.Key("Ipv6CidrBlock") objectKey.String(*v.Ipv6CidrBlock) } + if v.Ipv6IpamPoolId != nil { + objectKey := object.Key("Ipv6IpamPoolId") + objectKey.String(*v.Ipv6IpamPoolId) + } + if v.Ipv6Native != nil { objectKey := object.Key("Ipv6Native") objectKey.Boolean(*v.Ipv6Native) } + if v.Ipv6NetmaskLength != nil { + objectKey := object.Key("Ipv6NetmaskLength") + objectKey.Integer(*v.Ipv6NetmaskLength) + } + if v.OutpostArn != nil { objectKey := object.Key("OutpostArn") objectKey.String(*v.OutpostArn) @@ -53532,6 +54089,11 @@ func awsEc2query_serializeOpDocumentDeleteIpamPoolInput(v *DeleteIpamPoolInput, object := value.Object() _ = object + if v.Cascade != nil { + objectKey := object.Key("Cascade") + objectKey.Boolean(*v.Cascade) + } + if v.DryRun != nil { objectKey := object.Key("DryRun") objectKey.Boolean(*v.DryRun) @@ -54657,6 +55219,28 @@ func awsEc2query_serializeOpDocumentDeprovisionByoipCidrInput(v *DeprovisionByoi return nil } +func awsEc2query_serializeOpDocumentDeprovisionIpamByoasnInput(v *DeprovisionIpamByoasnInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Asn != nil { + objectKey := object.Key("Asn") + objectKey.String(*v.Asn) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.IpamId != nil { + objectKey := object.Key("IpamId") + objectKey.String(*v.IpamId) + } + + return nil +} + func awsEc2query_serializeOpDocumentDeprovisionIpamPoolCidrInput(v *DeprovisionIpamPoolCidrInput, value query.Value) error { object := value.Object() _ = object @@ -56609,6 +57193,28 @@ func awsEc2query_serializeOpDocumentDescribeInternetGatewaysInput(v *DescribeInt return nil } +func awsEc2query_serializeOpDocumentDescribeIpamByoasnInput(v *DescribeIpamByoasnInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + func awsEc2query_serializeOpDocumentDescribeIpamPoolsInput(v *DescribeIpamPoolsInput, value query.Value) error { object := value.Object() _ = object @@ -60405,6 +61011,28 @@ func awsEc2query_serializeOpDocumentDisassociateInstanceEventWindowInput(v *Disa return nil } +func awsEc2query_serializeOpDocumentDisassociateIpamByoasnInput(v *DisassociateIpamByoasnInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Asn != nil { + objectKey := object.Key("Asn") + objectKey.String(*v.Asn) + } + + if v.Cidr != nil { + objectKey := object.Key("Cidr") + objectKey.String(*v.Cidr) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + return nil +} + func awsEc2query_serializeOpDocumentDisassociateIpamResourceDiscoveryInput(v *DisassociateIpamResourceDiscoveryInput, value query.Value) error { object := value.Object() _ = object @@ -61505,6 +62133,45 @@ func awsEc2query_serializeOpDocumentGetIpamDiscoveredAccountsInput(v *GetIpamDis return nil } +func awsEc2query_serializeOpDocumentGetIpamDiscoveredPublicAddressesInput(v *GetIpamDiscoveredPublicAddressesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AddressRegion != nil { + objectKey := object.Key("AddressRegion") + objectKey.String(*v.AddressRegion) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.Filters != nil { + objectKey := object.FlatKey("Filter") + if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.IpamResourceDiscoveryId != nil { + objectKey := object.Key("IpamResourceDiscoveryId") + objectKey.String(*v.IpamResourceDiscoveryId) + } + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + func awsEc2query_serializeOpDocumentGetIpamDiscoveredResourceCidrsInput(v *GetIpamDiscoveredResourceCidrsInput, value query.Value) error { object := value.Object() _ = object @@ -63592,6 +64259,11 @@ func awsEc2query_serializeOpDocumentModifyIpamInput(v *ModifyIpamInput, value qu } } + if len(v.Tier) > 0 { + objectKey := object.Key("Tier") + objectKey.String(string(v.Tier)) + } + return nil } @@ -63882,6 +64554,13 @@ func awsEc2query_serializeOpDocumentModifyNetworkInterfaceAttributeInput(v *Modi } } + if v.ConnectionTrackingSpecification != nil { + objectKey := object.Key("ConnectionTrackingSpecification") + if err := awsEc2query_serializeDocumentConnectionTrackingSpecificationRequest(v.ConnectionTrackingSpecification, objectKey); err != nil { + return err + } + } + if v.Description != nil { objectKey := object.Key("Description") if err := awsEc2query_serializeDocumentAttributeValue(v.Description, objectKey); err != nil { @@ -65347,6 +66026,35 @@ func awsEc2query_serializeOpDocumentProvisionByoipCidrInput(v *ProvisionByoipCid return nil } +func awsEc2query_serializeOpDocumentProvisionIpamByoasnInput(v *ProvisionIpamByoasnInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Asn != nil { + objectKey := object.Key("Asn") + objectKey.String(*v.Asn) + } + + if v.AsnAuthorizationContext != nil { + objectKey := object.Key("AsnAuthorizationContext") + if err := awsEc2query_serializeDocumentAsnAuthorizationContext(v.AsnAuthorizationContext, objectKey); err != nil { + return err + } + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.IpamId != nil { + objectKey := object.Key("IpamId") + objectKey.String(*v.IpamId) + } + + return nil +} + func awsEc2query_serializeOpDocumentProvisionIpamPoolCidrInput(v *ProvisionIpamPoolCidrInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index f4124e96c3b..45ed49352e2 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -376,6 +376,58 @@ func (ArchitectureValues) Values() []ArchitectureValues { } } +type AsnAssociationState string + +// Enum values for AsnAssociationState +const ( + AsnAssociationStateDisassociated AsnAssociationState = "disassociated" + AsnAssociationStateFailedDisassociation AsnAssociationState = "failed-disassociation" + AsnAssociationStateFailedAssociation AsnAssociationState = "failed-association" + AsnAssociationStatePendingDisassociation AsnAssociationState = "pending-disassociation" + AsnAssociationStatePendingAssociation AsnAssociationState = "pending-association" + AsnAssociationStateAssociated AsnAssociationState = "associated" +) + +// Values returns all known values for AsnAssociationState. 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 (AsnAssociationState) Values() []AsnAssociationState { + return []AsnAssociationState{ + "disassociated", + "failed-disassociation", + "failed-association", + "pending-disassociation", + "pending-association", + "associated", + } +} + +type AsnState string + +// Enum values for AsnState +const ( + AsnStateDeprovisioned AsnState = "deprovisioned" + AsnStateFailedDeprovision AsnState = "failed-deprovision" + AsnStateFailedProvision AsnState = "failed-provision" + AsnStatePendingDeprovision AsnState = "pending-deprovision" + AsnStatePendingProvision AsnState = "pending-provision" + AsnStateProvisioned AsnState = "provisioned" +) + +// Values returns all known values for AsnState. 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 (AsnState) Values() []AsnState { + return []AsnState{ + "deprovisioned", + "failed-deprovision", + "failed-provision", + "pending-deprovision", + "pending-provision", + "provisioned", + } +} + type AssociatedNetworkType string // Enum values for AssociatedNetworkType @@ -4618,6 +4670,7 @@ const ( IpamPoolAllocationResourceTypeVpc IpamPoolAllocationResourceType = "vpc" IpamPoolAllocationResourceTypeEc2PublicIpv4Pool IpamPoolAllocationResourceType = "ec2-public-ipv4-pool" IpamPoolAllocationResourceTypeCustom IpamPoolAllocationResourceType = "custom" + IpamPoolAllocationResourceTypeSubnet IpamPoolAllocationResourceType = "subnet" ) // Values returns all known values for IpamPoolAllocationResourceType. Note that @@ -4630,6 +4683,7 @@ func (IpamPoolAllocationResourceType) Values() []IpamPoolAllocationResourceType "vpc", "ec2-public-ipv4-pool", "custom", + "subnet", } } @@ -4715,6 +4769,22 @@ func (IpamPoolPublicIpSource) Values() []IpamPoolPublicIpSource { } } +type IpamPoolSourceResourceType string + +// Enum values for IpamPoolSourceResourceType +const ( + IpamPoolSourceResourceTypeVpc IpamPoolSourceResourceType = "vpc" +) + +// Values returns all known values for IpamPoolSourceResourceType. 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 (IpamPoolSourceResourceType) Values() []IpamPoolSourceResourceType { + return []IpamPoolSourceResourceType{ + "vpc", + } +} + type IpamPoolState string // Enum values for IpamPoolState @@ -4753,6 +4823,81 @@ func (IpamPoolState) Values() []IpamPoolState { } } +type IpamPublicAddressAssociationStatus string + +// Enum values for IpamPublicAddressAssociationStatus +const ( + IpamPublicAddressAssociationStatusAssociated IpamPublicAddressAssociationStatus = "associated" + IpamPublicAddressAssociationStatusDisassociated IpamPublicAddressAssociationStatus = "disassociated" +) + +// Values returns all known values for IpamPublicAddressAssociationStatus. 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 (IpamPublicAddressAssociationStatus) Values() []IpamPublicAddressAssociationStatus { + return []IpamPublicAddressAssociationStatus{ + "associated", + "disassociated", + } +} + +type IpamPublicAddressAwsService string + +// Enum values for IpamPublicAddressAwsService +const ( + IpamPublicAddressAwsServiceNatGateway IpamPublicAddressAwsService = "nat-gateway" + IpamPublicAddressAwsServiceDms IpamPublicAddressAwsService = "database-migration-service" + IpamPublicAddressAwsServiceRedshift IpamPublicAddressAwsService = "redshift" + IpamPublicAddressAwsServiceEcs IpamPublicAddressAwsService = "elastic-container-service" + IpamPublicAddressAwsServiceRds IpamPublicAddressAwsService = "relational-database-service" + IpamPublicAddressAwsServiceS2sVpn IpamPublicAddressAwsService = "site-to-site-vpn" + IpamPublicAddressAwsServiceEc2Lb IpamPublicAddressAwsService = "load-balancer" + IpamPublicAddressAwsServiceAga IpamPublicAddressAwsService = "global-accelerator" + IpamPublicAddressAwsServiceOther IpamPublicAddressAwsService = "other" +) + +// Values returns all known values for IpamPublicAddressAwsService. 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 (IpamPublicAddressAwsService) Values() []IpamPublicAddressAwsService { + return []IpamPublicAddressAwsService{ + "nat-gateway", + "database-migration-service", + "redshift", + "elastic-container-service", + "relational-database-service", + "site-to-site-vpn", + "load-balancer", + "global-accelerator", + "other", + } +} + +type IpamPublicAddressType string + +// Enum values for IpamPublicAddressType +const ( + IpamPublicAddressTypeServiceManagedIp IpamPublicAddressType = "service-managed-ip" + IpamPublicAddressTypeServiceManagedByoip IpamPublicAddressType = "service-managed-byoip" + IpamPublicAddressTypeAmazonOwnedEip IpamPublicAddressType = "amazon-owned-eip" + IpamPublicAddressTypeByoip IpamPublicAddressType = "byoip" + IpamPublicAddressTypeEc2PublicIp IpamPublicAddressType = "ec2-public-ip" +) + +// Values returns all known values for IpamPublicAddressType. 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 (IpamPublicAddressType) Values() []IpamPublicAddressType { + return []IpamPublicAddressType{ + "service-managed-ip", + "service-managed-byoip", + "amazon-owned-eip", + "byoip", + "ec2-public-ip", + } +} + type IpamResourceDiscoveryAssociationState string // Enum values for IpamResourceDiscoveryAssociationState @@ -4833,6 +4978,7 @@ const ( IpamResourceTypeEip IpamResourceType = "eip" IpamResourceTypePublicIpv4Pool IpamResourceType = "public-ipv4-pool" IpamResourceTypeIpv6Pool IpamResourceType = "ipv6-pool" + IpamResourceTypeEni IpamResourceType = "eni" ) // Values returns all known values for IpamResourceType. Note that this can be @@ -4845,6 +4991,7 @@ func (IpamResourceType) Values() []IpamResourceType { "eip", "public-ipv4-pool", "ipv6-pool", + "eni", } } @@ -4942,6 +5089,24 @@ func (IpamState) Values() []IpamState { } } +type IpamTier string + +// Enum values for IpamTier +const ( + IpamTierFree IpamTier = "free" + IpamTierAdvanced IpamTier = "advanced" +) + +// Values returns all known values for IpamTier. 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 (IpamTier) Values() []IpamTier { + return []IpamTier{ + "free", + "advanced", + } +} + type Ipv6SupportValue string // Enum values for Ipv6SupportValue diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 18b32146504..fb03e92860b 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -536,6 +536,44 @@ type AnalysisSecurityGroupRule struct { noSmithyDocumentSerde } +// An Autonomous System Number (ASN) and BYOIP CIDR association. +type AsnAssociation struct { + + // The association's ASN. + Asn *string + + // The association's CIDR. + Cidr *string + + // The association's state. + State AsnAssociationState + + // The association's status message. + StatusMessage *string + + noSmithyDocumentSerde +} + +// Provides authorization for Amazon to bring an Autonomous System Number (ASN) to +// a specific Amazon Web Services account using bring your own ASN (BYOASN). For +// details on the format of the message and signature, see Tutorial: Bring your +// ASN to IPAM (https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html) +// in the Amazon VPC IPAM guide. +type AsnAuthorizationContext struct { + + // The authorization context's message. + // + // This member is required. + Message *string + + // The authorization context's signature. + // + // This member is required. + Signature *string + + noSmithyDocumentSerde +} + // Describes the private IP addresses assigned to a network interface. type AssignedPrivateIpAddress struct { @@ -877,10 +915,31 @@ type BundleTaskError struct { noSmithyDocumentSerde } +// The Autonomous System Number (ASN) and BYOIP CIDR association. +type Byoasn struct { + + // A public 2-byte or 4-byte ASN. + Asn *string + + // An IPAM ID. + IpamId *string + + // The provisioning state of the BYOASN. + State AsnState + + // The status message. + StatusMessage *string + + noSmithyDocumentSerde +} + // Information about an address range that is provisioned for use with your Amazon // Web Services resources through bring your own IP addresses (BYOIP). type ByoipCidr struct { + // The BYOIP CIDR associations with ASNs. + AsnAssociations []AsnAssociation + // The address range, in CIDR notation. Cidr *string @@ -2005,6 +2064,102 @@ type ConnectionNotification struct { noSmithyDocumentSerde } +// A security group connection tracking configuration that enables you to set the +// idle timeout for connection tracking on an Elastic network interface. For more +// information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) +// in the Amazon Elastic Compute Cloud User Guide. +type ConnectionTrackingConfiguration struct { + + // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 + // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: + // Less than 432000 seconds. + TcpEstablishedTimeout *int32 + + // Timeout (in seconds) for idle UDP flows classified as streams which have seen + // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 + // minutes). Default: 180 seconds. + UdpStreamTimeout *int32 + + // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single + // direction or a single request-response transaction. Min: 30 seconds. Max: 60 + // seconds. Default: 30 seconds. + UdpTimeout *int32 + + noSmithyDocumentSerde +} + +// A security group connection tracking specification that enables you to set the +// idle timeout for connection tracking on an Elastic network interface. For more +// information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) +// in the Amazon Elastic Compute Cloud User Guide. +type ConnectionTrackingSpecification struct { + + // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 + // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: + // Less than 432000 seconds. + TcpEstablishedTimeout *int32 + + // Timeout (in seconds) for idle UDP flows classified as streams which have seen + // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 + // minutes). Default: 180 seconds. + UdpStreamTimeout *int32 + + // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single + // direction or a single request-response transaction. Min: 30 seconds. Max: 60 + // seconds. Default: 30 seconds. + UdpTimeout *int32 + + noSmithyDocumentSerde +} + +// A security group connection tracking specification request that enables you to +// set the idle timeout for connection tracking on an Elastic network interface. +// For more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) +// in the Amazon Elastic Compute Cloud User Guide. +type ConnectionTrackingSpecificationRequest struct { + + // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 + // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: + // Less than 432000 seconds. + TcpEstablishedTimeout *int32 + + // Timeout (in seconds) for idle UDP flows classified as streams which have seen + // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 + // minutes). Default: 180 seconds. + UdpStreamTimeout *int32 + + // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single + // direction or a single request-response transaction. Min: 30 seconds. Max: 60 + // seconds. Default: 30 seconds. + UdpTimeout *int32 + + noSmithyDocumentSerde +} + +// A security group connection tracking specification response that enables you to +// set the idle timeout for connection tracking on an Elastic network interface. +// For more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) +// in the Amazon Elastic Compute Cloud User Guide. +type ConnectionTrackingSpecificationResponse struct { + + // Timeout (in seconds) for idle TCP connections in an established state. Min: 60 + // seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: + // Less than 432000 seconds. + TcpEstablishedTimeout *int32 + + // Timeout (in seconds) for idle UDP flows classified as streams which have seen + // more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 + // minutes). Default: 180 seconds. + UdpStreamTimeout *int32 + + // Timeout (in seconds) for idle UDP flows that have seen traffic only in a single + // direction or a single request-response transaction. Min: 30 seconds. Max: 60 + // seconds. Default: 30 seconds. + UdpTimeout *int32 + + noSmithyDocumentSerde +} + // Describes a conversion task. type ConversionTask struct { @@ -5600,7 +5755,8 @@ type Instance struct { // The location where the instance launched, if applicable. Placement *Placement - // The value is Windows for Windows instances; otherwise blank. + // The platform. This value is windows for Windows instances; otherwise, it is + // empty. Platform PlatformValues // The platform details value for the instance. For more information, see AMI @@ -6161,6 +6317,12 @@ type InstanceNetworkInterface struct { // The network interface attachment. Attachment *InstanceNetworkInterfaceAttachment + // A security group connection tracking configuration that enables you to set the + // timeout for connection tracking on an Elastic network interface. For more + // information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) + // in the Amazon Elastic Compute Cloud User Guide. + ConnectionTrackingConfiguration *ConnectionTrackingSpecificationResponse + // The description. Description *string @@ -6279,6 +6441,12 @@ type InstanceNetworkInterfaceSpecification struct { // into a default subnet, the default value is true . AssociatePublicIpAddress *bool + // A security group connection tracking specification that enables you to set the + // timeout for connection tracking on an Elastic network interface. For more + // information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) + // in the Amazon Elastic Compute Cloud User Guide. + ConnectionTrackingSpecification *ConnectionTrackingSpecificationRequest + // If set to true , the interface is deleted when the instance is terminated. You // can specify true only if creating a new network interface when launching an // instance. @@ -7262,12 +7430,20 @@ type Ipam struct { // The state of the IPAM. State IpamState + // The state message. + StateMessage *string + // The key/value combination of a tag assigned to the resource. Use the tag key in // the filter name and the tag value as the filter value. For example, to find all // resources that have a tag with the key Owner and the value TeamA , specify // tag:Owner for the filter name and TeamA for the filter value. Tags []Tag + // IPAM is offered in a Free Tier and an Advanced Tier. For more information about + // the features available in each tier and the costs associated with the tiers, see + // Amazon VPC pricing > IPAM tab (http://aws.amazon.com/vpc/pricing/) . + Tier IpamTier + noSmithyDocumentSerde } @@ -7360,6 +7536,71 @@ type IpamDiscoveredAccount struct { noSmithyDocumentSerde } +// A public IP Address discovered by IPAM. +type IpamDiscoveredPublicAddress struct { + + // The IP address. + Address *string + + // The allocation ID of the resource the IP address is assigned to. + AddressAllocationId *string + + // The ID of the owner of the resource the IP address is assigned to. + AddressOwnerId *string + + // The Region of the resource the IP address is assigned to. + AddressRegion *string + + // The IP address type. + AddressType IpamPublicAddressType + + // The association status. + AssociationStatus IpamPublicAddressAssociationStatus + + // The instance ID of the instance the assigned IP address is assigned to. + InstanceId *string + + // The resource discovery ID. + IpamResourceDiscoveryId *string + + // The network border group that the resource that the IP address is assigned to + // is in. + NetworkBorderGroup *string + + // The description of the network interface that IP address is assigned to. + NetworkInterfaceDescription *string + + // The network interface ID of the resource with the assigned IP address. + NetworkInterfaceId *string + + // The ID of the public IPv4 pool that the resource with the assigned IP address + // is from. + PublicIpv4PoolId *string + + // The last successful resource discovery time. + SampleTime *time.Time + + // Security groups associated with the resource that the IP address is assigned to. + SecurityGroups []IpamPublicAddressSecurityGroup + + // The Amazon Web Services service associated with the IP address. + Service IpamPublicAddressAwsService + + // The resource ARN or ID. + ServiceResource *string + + // The ID of the subnet that the resource with the assigned IP address is in. + SubnetId *string + + // Tags associated with the IP address. + Tags *IpamPublicAddressTags + + // The ID of the VPC that the resource with the assigned IP address is in. + VpcId *string + + noSmithyDocumentSerde +} + // An IPAM discovered resource CIDR. A discovered resource is a resource CIDR // monitored under a resource discovery. The following resources can be discovered: // VPCs, Public IPv4 pools, VPC subnets, and Elastic IP addresses. The discovered @@ -7556,10 +7797,13 @@ type IpamPool struct { // within an existing source pool. SourceIpamPoolId *string + // The resource used to provision CIDRs to a resource planning pool. + SourceResource *IpamPoolSourceResource + // The state of the IPAM pool. State IpamPoolState - // A message related to the failed creation of an IPAM pool. + // The state message. StateMessage *string // The key/value combination of a tag assigned to the resource. Use the tag key in @@ -7640,6 +7884,75 @@ type IpamPoolCidrFailureReason struct { noSmithyDocumentSerde } +// The resource used to provision CIDRs to a resource planning pool. +type IpamPoolSourceResource struct { + + // The source resource ID. + ResourceId *string + + // The source resource owner. + ResourceOwner *string + + // The source resource Region. + ResourceRegion *string + + // The source resource type. + ResourceType IpamPoolSourceResourceType + + noSmithyDocumentSerde +} + +// The resource used to provision CIDRs to a resource planning pool. +type IpamPoolSourceResourceRequest struct { + + // The source resource ID. + ResourceId *string + + // The source resource owner. + ResourceOwner *string + + // The source resource Region. + ResourceRegion *string + + // The source resource type. + ResourceType IpamPoolSourceResourceType + + noSmithyDocumentSerde +} + +// The security group that the resource with the public IP address is in. +type IpamPublicAddressSecurityGroup struct { + + // The security group's ID. + GroupId *string + + // The security group's name. + GroupName *string + + noSmithyDocumentSerde +} + +// A tag for a public IP address discovered by IPAM. +type IpamPublicAddressTag struct { + + // The tag's key. + Key *string + + // The tag's value. + Value *string + + noSmithyDocumentSerde +} + +// Tags for a public IP address discovered by IPAM. +type IpamPublicAddressTags struct { + + // Tags for an Elastic IP address. + EipTags []IpamPublicAddressTag + + noSmithyDocumentSerde +} + // The CIDR for an IPAM resource. type IpamResourceCidr struct { @@ -8737,6 +9050,12 @@ type LaunchTemplateInstanceNetworkInterfaceSpecification struct { // network interface. AssociatePublicIpAddress *bool + // A security group connection tracking specification that enables you to set the + // timeout for connection tracking on an Elastic network interface. For more + // information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) + // in the Amazon Elastic Compute Cloud User Guide. + ConnectionTrackingSpecification *ConnectionTrackingSpecification + // Indicates whether the network interface is deleted when the instance is // terminated. DeleteOnTermination *bool @@ -8818,6 +9137,12 @@ type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct { // Associates a public IPv4 address with eth0 for a new network interface. AssociatePublicIpAddress *bool + // A security group connection tracking specification that enables you to set the + // timeout for connection tracking on an Elastic network interface. For more + // information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) + // in the Amazon Elastic Compute Cloud User Guide. + ConnectionTrackingSpecification *ConnectionTrackingSpecificationRequest + // Indicates whether the network interface is deleted when the instance is // terminated. DeleteOnTermination *bool @@ -10451,6 +10776,12 @@ type NetworkInterface struct { // The Availability Zone. AvailabilityZone *string + // A security group connection tracking configuration that enables you to set the + // timeout for connection tracking on an Elastic network interface. For more + // information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts) + // in the Amazon Elastic Compute Cloud User Guide. + ConnectionTrackingConfiguration *ConnectionTrackingConfiguration + // Indicates whether a network interface with an IPv6 address is unreachable from // the public internet. If the value is true , inbound traffic from the internet is // dropped and you cannot assign an elastic IP address to the network interface. @@ -16443,9 +16774,8 @@ type TransitGatewayVpcAttachmentOptions struct { noSmithyDocumentSerde } -// Currently available in limited preview only. If you are interested in using -// this feature, contact your account manager. Information about an association -// between a branch network interface with a trunk network interface. +// Information about an association between a branch network interface with a +// trunk network interface. type TrunkInterfaceAssociation struct { // The ID of the association. diff --git a/service/ec2/validators.go b/service/ec2/validators.go index 47c44b0a8c6..889864af49a 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -370,6 +370,26 @@ func (m *validateOpAssociateInstanceEventWindow) HandleInitialize(ctx context.Co return next.HandleInitialize(ctx, in) } +type validateOpAssociateIpamByoasn struct { +} + +func (*validateOpAssociateIpamByoasn) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateIpamByoasnInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateIpamByoasnInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpAssociateIpamResourceDiscovery struct { } @@ -3790,6 +3810,26 @@ func (m *validateOpDeprovisionByoipCidr) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpDeprovisionIpamByoasn struct { +} + +func (*validateOpDeprovisionIpamByoasn) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeprovisionIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeprovisionIpamByoasnInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeprovisionIpamByoasnInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeprovisionIpamPoolCidr struct { } @@ -4690,6 +4730,26 @@ func (m *validateOpDisassociateInstanceEventWindow) HandleInitialize(ctx context return next.HandleInitialize(ctx, in) } +type validateOpDisassociateIpamByoasn struct { +} + +func (*validateOpDisassociateIpamByoasn) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateIpamByoasnInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateIpamByoasnInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisassociateIpamResourceDiscovery struct { } @@ -5470,6 +5530,26 @@ func (m *validateOpGetIpamDiscoveredAccounts) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpGetIpamDiscoveredPublicAddresses struct { +} + +func (*validateOpGetIpamDiscoveredPublicAddresses) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIpamDiscoveredPublicAddresses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIpamDiscoveredPublicAddressesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIpamDiscoveredPublicAddressesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetIpamDiscoveredResourceCidrs struct { } @@ -7410,6 +7490,26 @@ func (m *validateOpProvisionByoipCidr) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpProvisionIpamByoasn struct { +} + +func (*validateOpProvisionIpamByoasn) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpProvisionIpamByoasn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ProvisionIpamByoasnInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpProvisionIpamByoasnInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpProvisionIpamPoolCidr struct { } @@ -8662,6 +8762,10 @@ func addOpAssociateInstanceEventWindowValidationMiddleware(stack *middleware.Sta return stack.Initialize.Add(&validateOpAssociateInstanceEventWindow{}, middleware.After) } +func addOpAssociateIpamByoasnValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateIpamByoasn{}, middleware.After) +} + func addOpAssociateIpamResourceDiscoveryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateIpamResourceDiscovery{}, middleware.After) } @@ -9346,6 +9450,10 @@ func addOpDeprovisionByoipCidrValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpDeprovisionByoipCidr{}, middleware.After) } +func addOpDeprovisionIpamByoasnValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeprovisionIpamByoasn{}, middleware.After) +} + func addOpDeprovisionIpamPoolCidrValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeprovisionIpamPoolCidr{}, middleware.After) } @@ -9526,6 +9634,10 @@ func addOpDisassociateInstanceEventWindowValidationMiddleware(stack *middleware. return stack.Initialize.Add(&validateOpDisassociateInstanceEventWindow{}, middleware.After) } +func addOpDisassociateIpamByoasnValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateIpamByoasn{}, middleware.After) +} + func addOpDisassociateIpamResourceDiscoveryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateIpamResourceDiscovery{}, middleware.After) } @@ -9682,6 +9794,10 @@ func addOpGetIpamDiscoveredAccountsValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpGetIpamDiscoveredAccounts{}, middleware.After) } +func addOpGetIpamDiscoveredPublicAddressesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIpamDiscoveredPublicAddresses{}, middleware.After) +} + func addOpGetIpamDiscoveredResourceCidrsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetIpamDiscoveredResourceCidrs{}, middleware.After) } @@ -10070,6 +10186,10 @@ func addOpProvisionByoipCidrValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpProvisionByoipCidr{}, middleware.After) } +func addOpProvisionIpamByoasnValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpProvisionIpamByoasn{}, middleware.After) +} + func addOpProvisionIpamPoolCidrValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpProvisionIpamPoolCidr{}, middleware.After) } @@ -10338,6 +10458,24 @@ func validateAddPrefixListEntry(v *types.AddPrefixListEntry) error { } } +func validateAsnAuthorizationContext(v *types.AsnAuthorizationContext) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AsnAuthorizationContext"} + if v.Message == nil { + invalidParams.Add(smithy.NewErrParamRequired("Message")) + } + if v.Signature == nil { + invalidParams.Add(smithy.NewErrParamRequired("Signature")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAthenaIntegration(v *types.AthenaIntegration) error { if v == nil { return nil @@ -11476,6 +11614,24 @@ func validateOpAssociateInstanceEventWindowInput(v *AssociateInstanceEventWindow } } +func validateOpAssociateIpamByoasnInput(v *AssociateIpamByoasnInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateIpamByoasnInput"} + if v.Asn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Asn")) + } + if v.Cidr == nil { + invalidParams.Add(smithy.NewErrParamRequired("Cidr")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAssociateIpamResourceDiscoveryInput(v *AssociateIpamResourceDiscoveryInput) error { if v == nil { return nil @@ -11532,9 +11688,6 @@ func validateOpAssociateSubnetCidrBlockInput(v *AssociateSubnetCidrBlockInput) e return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateSubnetCidrBlockInput"} - if v.Ipv6CidrBlock == nil { - invalidParams.Add(smithy.NewErrParamRequired("Ipv6CidrBlock")) - } if v.SubnetId == nil { invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) } @@ -14364,6 +14517,24 @@ func validateOpDeprovisionByoipCidrInput(v *DeprovisionByoipCidrInput) error { } } +func validateOpDeprovisionIpamByoasnInput(v *DeprovisionIpamByoasnInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeprovisionIpamByoasnInput"} + if v.IpamId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IpamId")) + } + if v.Asn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Asn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeprovisionIpamPoolCidrInput(v *DeprovisionIpamPoolCidrInput) error { if v == nil { return nil @@ -15106,6 +15277,24 @@ func validateOpDisassociateInstanceEventWindowInput(v *DisassociateInstanceEvent } } +func validateOpDisassociateIpamByoasnInput(v *DisassociateIpamByoasnInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateIpamByoasnInput"} + if v.Asn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Asn")) + } + if v.Cidr == nil { + invalidParams.Add(smithy.NewErrParamRequired("Cidr")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisassociateIpamResourceDiscoveryInput(v *DisassociateIpamResourceDiscoveryInput) error { if v == nil { return nil @@ -15765,6 +15954,24 @@ func validateOpGetIpamDiscoveredAccountsInput(v *GetIpamDiscoveredAccountsInput) } } +func validateOpGetIpamDiscoveredPublicAddressesInput(v *GetIpamDiscoveredPublicAddressesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIpamDiscoveredPublicAddressesInput"} + if v.IpamResourceDiscoveryId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IpamResourceDiscoveryId")) + } + if v.AddressRegion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AddressRegion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetIpamDiscoveredResourceCidrsInput(v *GetIpamDiscoveredResourceCidrsInput) error { if v == nil { return nil @@ -17373,6 +17580,31 @@ func validateOpProvisionByoipCidrInput(v *ProvisionByoipCidrInput) error { } } +func validateOpProvisionIpamByoasnInput(v *ProvisionIpamByoasnInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ProvisionIpamByoasnInput"} + if v.IpamId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IpamId")) + } + if v.Asn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Asn")) + } + if v.AsnAuthorizationContext == nil { + invalidParams.Add(smithy.NewErrParamRequired("AsnAuthorizationContext")) + } else if v.AsnAuthorizationContext != nil { + if err := validateAsnAuthorizationContext(v.AsnAuthorizationContext); err != nil { + invalidParams.AddNested("AsnAuthorizationContext", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpProvisionIpamPoolCidrInput(v *ProvisionIpamPoolCidrInput) error { if v == nil { return nil diff --git a/service/ecr/api_op_CreatePullThroughCacheRule.go b/service/ecr/api_op_CreatePullThroughCacheRule.go index 180b9761a28..19c67369a0f 100644 --- a/service/ecr/api_op_CreatePullThroughCacheRule.go +++ b/service/ecr/api_op_CreatePullThroughCacheRule.go @@ -7,14 +7,16 @@ 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/ecr/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a pull through cache rule. A pull through cache rule provides a way to -// cache images from an external public registry in your Amazon ECR private -// registry. +// cache images from an upstream registry source in your Amazon ECR private +// registry. For more information, see Using pull through cache rules (https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache.html) +// in the Amazon Elastic Container Registry User Guide. func (c *Client) CreatePullThroughCacheRule(ctx context.Context, params *CreatePullThroughCacheRuleInput, optFns ...func(*Options)) (*CreatePullThroughCacheRuleOutput, error) { if params == nil { params = &CreatePullThroughCacheRuleInput{} @@ -38,16 +40,31 @@ type CreatePullThroughCacheRuleInput struct { EcrRepositoryPrefix *string // The registry URL of the upstream public registry to use as the source for the - // pull through cache rule. + // pull through cache rule. The following is the syntax to use for each supported + // upstream registry. + // - Amazon ECR Public ( ecr-public ) - public.ecr.aws + // - Docker Hub ( docker-hub ) - registry-1.docker.io + // - Quay ( quay ) - quay.io + // - Kubernetes ( k8s ) - registry.k8s.io + // - GitHub Container Registry ( github-container-registry ) - ghcr.io + // - Microsoft Azure Container Registry ( azure-container-registry ) - + // .azurecr.io // // This member is required. UpstreamRegistryUrl *string + // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager + // secret that identifies the credentials to authenticate to the upstream registry. + CredentialArn *string + // The Amazon Web Services account ID associated with the registry to create the // pull through cache rule for. If you do not specify a registry, the default // registry is assumed. RegistryId *string + // The name of the upstream registry. + UpstreamRegistry types.UpstreamRegistry + noSmithyDocumentSerde } @@ -57,12 +74,19 @@ type CreatePullThroughCacheRuleOutput struct { // was created. CreatedAt *time.Time + // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager + // secret associated with the pull through cache rule. + CredentialArn *string + // The Amazon ECR repository prefix associated with the pull through cache rule. EcrRepositoryPrefix *string // The registry ID associated with the request. RegistryId *string + // The name of the upstream registry associated with the pull through cache rule. + UpstreamRegistry types.UpstreamRegistry + // The upstream registry URL associated with the pull through cache rule. UpstreamRegistryUrl *string diff --git a/service/ecr/api_op_DeletePullThroughCacheRule.go b/service/ecr/api_op_DeletePullThroughCacheRule.go index b8f9e7cdb97..2cfef5fda63 100644 --- a/service/ecr/api_op_DeletePullThroughCacheRule.go +++ b/service/ecr/api_op_DeletePullThroughCacheRule.go @@ -49,6 +49,10 @@ type DeletePullThroughCacheRuleOutput struct { // The timestamp associated with the pull through cache rule. CreatedAt *time.Time + // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager + // secret associated with the pull through cache rule. + CredentialArn *string + // The Amazon ECR repository prefix associated with the request. EcrRepositoryPrefix *string diff --git a/service/ecr/api_op_DeleteRepository.go b/service/ecr/api_op_DeleteRepository.go index 4cdbb0fd791..a96d7456ad2 100644 --- a/service/ecr/api_op_DeleteRepository.go +++ b/service/ecr/api_op_DeleteRepository.go @@ -12,8 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a repository. If the repository contains images, you must either delete -// all images in the repository or use the force option to delete the repository. +// Deletes a repository. If the repository isn't empty, you must either delete the +// contents of the repository or use the force option to delete the repository and +// have Amazon ECR delete all of its contents on your behalf. func (c *Client) DeleteRepository(ctx context.Context, params *DeleteRepositoryInput, optFns ...func(*Options)) (*DeleteRepositoryOutput, error) { if params == nil { params = &DeleteRepositoryInput{} @@ -36,7 +37,8 @@ type DeleteRepositoryInput struct { // This member is required. RepositoryName *string - // If a repository contains images, forces the deletion. + // If true, deleting the repository force deletes the contents of the repository. + // If false, the repository must be empty before attempting to delete it. Force bool // The Amazon Web Services account ID associated with the registry that contains diff --git a/service/ecr/api_op_UpdatePullThroughCacheRule.go b/service/ecr/api_op_UpdatePullThroughCacheRule.go new file mode 100644 index 00000000000..bee3cd8420d --- /dev/null +++ b/service/ecr/api_op_UpdatePullThroughCacheRule.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates an existing pull through cache rule. +func (c *Client) UpdatePullThroughCacheRule(ctx context.Context, params *UpdatePullThroughCacheRuleInput, optFns ...func(*Options)) (*UpdatePullThroughCacheRuleOutput, error) { + if params == nil { + params = &UpdatePullThroughCacheRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePullThroughCacheRule", params, optFns, c.addOperationUpdatePullThroughCacheRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePullThroughCacheRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePullThroughCacheRuleInput struct { + + // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager + // secret that identifies the credentials to authenticate to the upstream registry. + // + // This member is required. + CredentialArn *string + + // The repository name prefix to use when caching images from the source registry. + // + // This member is required. + EcrRepositoryPrefix *string + + // The Amazon Web Services account ID associated with the registry associated with + // the pull through cache rule. If you do not specify a registry, the default + // registry is assumed. + RegistryId *string + + noSmithyDocumentSerde +} + +type UpdatePullThroughCacheRuleOutput struct { + + // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager + // secret associated with the pull through cache rule. + CredentialArn *string + + // The Amazon ECR repository prefix associated with the pull through cache rule. + EcrRepositoryPrefix *string + + // The registry ID associated with the request. + RegistryId *string + + // The date and time, in JavaScript date format, when the pull through cache rule + // was updated. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdatePullThroughCacheRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdatePullThroughCacheRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePullThroughCacheRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdatePullThroughCacheRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePullThroughCacheRule(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdatePullThroughCacheRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdatePullThroughCacheRule", + } +} diff --git a/service/ecr/api_op_ValidatePullThroughCacheRule.go b/service/ecr/api_op_ValidatePullThroughCacheRule.go new file mode 100644 index 00000000000..d852029ce1a --- /dev/null +++ b/service/ecr/api_op_ValidatePullThroughCacheRule.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Validates an existing pull through cache rule for an upstream registry that +// requires authentication. This will retrieve the contents of the Amazon Web +// Services Secrets Manager secret, verify the syntax, and then validate that +// authentication to the upstream registry is successful. +func (c *Client) ValidatePullThroughCacheRule(ctx context.Context, params *ValidatePullThroughCacheRuleInput, optFns ...func(*Options)) (*ValidatePullThroughCacheRuleOutput, error) { + if params == nil { + params = &ValidatePullThroughCacheRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ValidatePullThroughCacheRule", params, optFns, c.addOperationValidatePullThroughCacheRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ValidatePullThroughCacheRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ValidatePullThroughCacheRuleInput struct { + + // The repository name prefix associated with the pull through cache rule. + // + // This member is required. + EcrRepositoryPrefix *string + + // The registry ID associated with the pull through cache rule. If you do not + // specify a registry, the default registry is assumed. + RegistryId *string + + noSmithyDocumentSerde +} + +type ValidatePullThroughCacheRuleOutput struct { + + // The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager + // secret associated with the pull through cache rule. + CredentialArn *string + + // The Amazon ECR repository prefix associated with the pull through cache rule. + EcrRepositoryPrefix *string + + // The reason the validation failed. For more details about possible causes and + // how to address them, see Using pull through cache rules (https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache.html) + // in the Amazon Elastic Container Registry User Guide. + Failure *string + + // Whether or not the pull through cache rule was validated. If true , Amazon ECR + // was able to reach the upstream registry and authentication was successful. If + // false , there was an issue and validation failed. The failure reason indicates + // the cause. + IsValid bool + + // The registry ID associated with the request. + RegistryId *string + + // The upstream registry URL associated with the pull through cache rule. + UpstreamRegistryUrl *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationValidatePullThroughCacheRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpValidatePullThroughCacheRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpValidatePullThroughCacheRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ValidatePullThroughCacheRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpValidatePullThroughCacheRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidatePullThroughCacheRule(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opValidatePullThroughCacheRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ValidatePullThroughCacheRule", + } +} diff --git a/service/ecr/deserializers.go b/service/ecr/deserializers.go index 7d849ef5410..640382acf75 100644 --- a/service/ecr/deserializers.go +++ b/service/ecr/deserializers.go @@ -355,12 +355,18 @@ func awsAwsjson11_deserializeOpErrorBatchGetImage(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("RepositoryNotFoundException", errorCode): return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("UnableToGetUpstreamImageException", errorCode): + return awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -733,9 +739,18 @@ func awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response *smithyh case strings.EqualFold("PullThroughCacheRuleAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorPullThroughCacheRuleAlreadyExistsException(response, errorBody) + case strings.EqualFold("SecretNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorSecretNotFoundException(response, errorBody) + case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("UnableToAccessSecretException", errorCode): + return awsAwsjson11_deserializeErrorUnableToAccessSecretException(response, errorBody) + + case strings.EqualFold("UnableToDecryptSecretValueException", errorCode): + return awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response, errorBody) + case strings.EqualFold("UnsupportedUpstreamRegistryException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response, errorBody) @@ -2437,6 +2452,9 @@ func awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response *smithyhttp. case strings.EqualFold("ServerException", errorCode): return awsAwsjson11_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("UnableToGetUpstreamLayerException", errorCode): + return awsAwsjson11_deserializeErrorUnableToGetUpstreamLayerException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4868,6 +4886,135 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpUpdatePullThroughCacheRule struct { +} + +func (*awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) HandleDeserialize(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_deserializeOpErrorUpdatePullThroughCacheRule(response, &metadata) + } + output := &UpdatePullThroughCacheRuleOutput{} + 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_deserializeOpDocumentUpdatePullThroughCacheRuleOutput(&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_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody) + + case strings.EqualFold("SecretNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorSecretNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("UnableToAccessSecretException", errorCode): + return awsAwsjson11_deserializeErrorUnableToAccessSecretException(response, errorBody) + + case strings.EqualFold("UnableToDecryptSecretValueException", errorCode): + return awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpUploadLayerPart struct { } @@ -4997,6 +5144,126 @@ func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Respons } } +type awsAwsjson11_deserializeOpValidatePullThroughCacheRule struct { +} + +func (*awsAwsjson11_deserializeOpValidatePullThroughCacheRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpValidatePullThroughCacheRule) HandleDeserialize(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_deserializeOpErrorValidatePullThroughCacheRule(response, &metadata) + } + output := &ValidatePullThroughCacheRuleOutput{} + 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_deserializeOpDocumentValidatePullThroughCacheRuleOutput(&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_deserializeOpErrorValidatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsAwsjson11_deserializeErrorEmptyUploadException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5942,7 +6209,7 @@ func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Res return output } -func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5960,8 +6227,8 @@ func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, return err } - output := &types.ServerException{} - err := awsAwsjson11_deserializeDocumentServerException(&output, shape) + output := &types.SecretNotFoundException{} + err := awsAwsjson11_deserializeDocumentSecretNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -5977,7 +6244,7 @@ func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, return output } -func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -5995,8 +6262,8 @@ func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Resp return err } - output := &types.TooManyTagsException{} - err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) + output := &types.ServerException{} + err := awsAwsjson11_deserializeDocumentServerException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6012,7 +6279,7 @@ func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Resp return output } -func awsAwsjson11_deserializeErrorUnsupportedImageTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6030,8 +6297,8 @@ func awsAwsjson11_deserializeErrorUnsupportedImageTypeException(response *smithy return err } - output := &types.UnsupportedImageTypeException{} - err := awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(&output, shape) + output := &types.TooManyTagsException{} + err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6047,7 +6314,7 @@ func awsAwsjson11_deserializeErrorUnsupportedImageTypeException(response *smithy return output } -func awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorUnableToAccessSecretException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6065,8 +6332,8 @@ func awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response return err } - output := &types.UnsupportedUpstreamRegistryException{} - err := awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(&output, shape) + output := &types.UnableToAccessSecretException{} + err := awsAwsjson11_deserializeDocumentUnableToAccessSecretException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -6082,7 +6349,182 @@ func awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response return output } -func awsAwsjson11_deserializeErrorUploadNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(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.UnableToDecryptSecretValueException{} + err := awsAwsjson11_deserializeDocumentUnableToDecryptSecretValueException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(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.UnableToGetUpstreamImageException{} + err := awsAwsjson11_deserializeDocumentUnableToGetUpstreamImageException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUnableToGetUpstreamLayerException(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.UnableToGetUpstreamLayerException{} + err := awsAwsjson11_deserializeDocumentUnableToGetUpstreamLayerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUnsupportedImageTypeException(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.UnsupportedImageTypeException{} + err := awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(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.UnsupportedUpstreamRegistryException{} + err := awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUploadNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -9346,6 +9788,15 @@ func awsAwsjson11_deserializeDocumentPullThroughCacheRule(v **types.PullThroughC } } + case "credentialArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) + } + sv.CredentialArn = ptr.String(jtv) + } + case "ecrRepositoryPrefix": if value != nil { jtv, ok := value.(string) @@ -9364,6 +9815,31 @@ func awsAwsjson11_deserializeDocumentPullThroughCacheRule(v **types.PullThroughC sv.RegistryId = ptr.String(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 UpdatedTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "upstreamRegistry": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpstreamRegistry to be of type string, got %T instead", value) + } + sv.UpstreamRegistry = types.UpstreamRegistry(jtv) + } + case "upstreamRegistryUrl": if value != nil { jtv, ok := value.(string) @@ -10916,6 +11392,46 @@ func awsAwsjson11_deserializeDocumentScoreDetails(v **types.ScoreDetails, value return nil } +func awsAwsjson11_deserializeDocumentSecretNotFoundException(v **types.SecretNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SecretNotFoundException + if *v == nil { + sv = &types.SecretNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentServerException(v **types.ServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11115,7 +11631,7 @@ func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsE return nil } -func awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(v **types.UnsupportedImageTypeException, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnableToAccessSecretException(v **types.UnableToAccessSecretException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11128,9 +11644,9 @@ func awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(v **types.Uns return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnsupportedImageTypeException + var sv *types.UnableToAccessSecretException if *v == nil { - sv = &types.UnsupportedImageTypeException{} + sv = &types.UnableToAccessSecretException{} } else { sv = *v } @@ -11155,7 +11671,7 @@ func awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(v **types.Uns return nil } -func awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(v **types.UnsupportedUpstreamRegistryException, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnableToDecryptSecretValueException(v **types.UnableToDecryptSecretValueException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11168,9 +11684,9 @@ func awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(v **ty return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnsupportedUpstreamRegistryException + var sv *types.UnableToDecryptSecretValueException if *v == nil { - sv = &types.UnsupportedUpstreamRegistryException{} + sv = &types.UnableToDecryptSecretValueException{} } else { sv = *v } @@ -11195,7 +11711,7 @@ func awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(v **ty return nil } -func awsAwsjson11_deserializeDocumentUploadNotFoundException(v **types.UploadNotFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnableToGetUpstreamImageException(v **types.UnableToGetUpstreamImageException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11208,9 +11724,9 @@ func awsAwsjson11_deserializeDocumentUploadNotFoundException(v **types.UploadNot return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UploadNotFoundException + var sv *types.UnableToGetUpstreamImageException if *v == nil { - sv = &types.UploadNotFoundException{} + sv = &types.UnableToGetUpstreamImageException{} } else { sv = *v } @@ -11235,7 +11751,7 @@ func awsAwsjson11_deserializeDocumentUploadNotFoundException(v **types.UploadNot return nil } -func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnableToGetUpstreamLayerException(v **types.UnableToGetUpstreamLayerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11248,9 +11764,9 @@ func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationExc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ValidationException + var sv *types.UnableToGetUpstreamLayerException if *v == nil { - sv = &types.ValidationException{} + sv = &types.UnableToGetUpstreamLayerException{} } else { sv = *v } @@ -11275,7 +11791,7 @@ func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationExc return nil } -func awsAwsjson11_deserializeDocumentVulnerablePackage(v **types.VulnerablePackage, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(v **types.UnsupportedImageTypeException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11288,25 +11804,185 @@ func awsAwsjson11_deserializeDocumentVulnerablePackage(v **types.VulnerablePacka return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.VulnerablePackage + var sv *types.UnsupportedImageTypeException if *v == nil { - sv = &types.VulnerablePackage{} + sv = &types.UnsupportedImageTypeException{} } else { sv = *v } for key, value := range shape { switch key { - case "arch": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arch to be of type string, got %T instead", value) + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } - sv.Arch = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "epoch": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(v **types.UnsupportedUpstreamRegistryException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedUpstreamRegistryException + if *v == nil { + sv = &types.UnsupportedUpstreamRegistryException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentUploadNotFoundException(v **types.UploadNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.UploadNotFoundException + if *v == nil { + sv = &types.UploadNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentVulnerablePackage(v **types.VulnerablePackage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.VulnerablePackage + if *v == nil { + sv = &types.VulnerablePackage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arch": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arch to be of type string, got %T instead", value) + } + sv.Arch = ptr.String(jtv) + } + + case "epoch": if value != nil { jtv, ok := value.(json.Number) if !ok { @@ -11685,6 +12361,15 @@ func awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(v **Crea } } + case "credentialArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) + } + sv.CredentialArn = ptr.String(jtv) + } + case "ecrRepositoryPrefix": if value != nil { jtv, ok := value.(string) @@ -11703,6 +12388,15 @@ func awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(v **Crea sv.RegistryId = ptr.String(jtv) } + case "upstreamRegistry": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpstreamRegistry to be of type string, got %T instead", value) + } + sv.UpstreamRegistry = types.UpstreamRegistry(jtv) + } + case "upstreamRegistryUrl": if value != nil { jtv, ok := value.(string) @@ -11869,6 +12563,15 @@ func awsAwsjson11_deserializeOpDocumentDeletePullThroughCacheRuleOutput(v **Dele } } + case "credentialArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) + } + sv.CredentialArn = ptr.String(jtv) + } + case "ecrRepositoryPrefix": if value != nil { jtv, ok := value.(string) @@ -13455,6 +14158,80 @@ func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutp return nil } +func awsAwsjson11_deserializeOpDocumentUpdatePullThroughCacheRuleOutput(v **UpdatePullThroughCacheRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdatePullThroughCacheRuleOutput + if *v == nil { + sv = &UpdatePullThroughCacheRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "credentialArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) + } + sv.CredentialArn = ptr.String(jtv) + } + + case "ecrRepositoryPrefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value) + } + sv.EcrRepositoryPrefix = ptr.String(jtv) + } + + case "registryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) + } + sv.RegistryId = ptr.String(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 UpdatedTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPartOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13525,3 +14302,88 @@ func awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPart *v = sv return nil } + +func awsAwsjson11_deserializeOpDocumentValidatePullThroughCacheRuleOutput(v **ValidatePullThroughCacheRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ValidatePullThroughCacheRuleOutput + if *v == nil { + sv = &ValidatePullThroughCacheRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "credentialArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value) + } + sv.CredentialArn = ptr.String(jtv) + } + + case "ecrRepositoryPrefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value) + } + sv.EcrRepositoryPrefix = ptr.String(jtv) + } + + case "failure": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PTCValidateFailure to be of type string, got %T instead", value) + } + sv.Failure = ptr.String(jtv) + } + + case "isValid": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsPTCRuleValid to be of type *bool, got %T instead", value) + } + sv.IsValid = jtv + } + + case "registryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value) + } + sv.RegistryId = ptr.String(jtv) + } + + case "upstreamRegistryUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.UpstreamRegistryUrl = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/ecr/endpoints.go b/service/ecr/endpoints.go index 5a557055b4c..b928bb088ec 100644 --- a/service/ecr/endpoints.go +++ b/service/ecr/endpoints.go @@ -366,8 +366,8 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - if "aws" == _PartitionResult.Name { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws" { uriString := func() string { var out strings.Builder out.WriteString("https://ecr-fips.") @@ -386,7 +386,7 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, }, nil } - if "aws-us-gov" == _PartitionResult.Name { + if _PartitionResult.Name == "aws-us-gov" { uriString := func() string { var out strings.Builder out.WriteString("https://ecr-fips.") diff --git a/service/ecr/generated.json b/service/ecr/generated.json index 6bf9d83180a..159e1c198b4 100644 --- a/service/ecr/generated.json +++ b/service/ecr/generated.json @@ -50,7 +50,9 @@ "api_op_StartLifecyclePolicyPreview.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdatePullThroughCacheRule.go", "api_op_UploadLayerPart.go", + "api_op_ValidatePullThroughCacheRule.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/ecr/serializers.go b/service/ecr/serializers.go index e513d0312fd..fbeb274d4e0 100644 --- a/service/ecr/serializers.go +++ b/service/ecr/serializers.go @@ -2215,6 +2215,61 @@ func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdatePullThroughCacheRule struct { +} + +func (*awsAwsjson11_serializeOpUpdatePullThroughCacheRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdatePullThroughCacheRule) 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.(*UpdatePullThroughCacheRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.UpdatePullThroughCacheRule") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdatePullThroughCacheRuleInput(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_serializeOpUploadLayerPart struct { } @@ -2269,6 +2324,61 @@ func (m *awsAwsjson11_serializeOpUploadLayerPart) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } + +type awsAwsjson11_serializeOpValidatePullThroughCacheRule struct { +} + +func (*awsAwsjson11_serializeOpValidatePullThroughCacheRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpValidatePullThroughCacheRule) 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.(*ValidatePullThroughCacheRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonEC2ContainerRegistry_V20150921.ValidatePullThroughCacheRule") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentValidatePullThroughCacheRuleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} func awsAwsjson11_serializeDocumentBatchedOperationLayerDigestList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2778,6 +2888,11 @@ func awsAwsjson11_serializeOpDocumentCreatePullThroughCacheRuleInput(v *CreatePu object := value.Object() defer object.Close() + if v.CredentialArn != nil { + ok := object.Key("credentialArn") + ok.String(*v.CredentialArn) + } + if v.EcrRepositoryPrefix != nil { ok := object.Key("ecrRepositoryPrefix") ok.String(*v.EcrRepositoryPrefix) @@ -2788,6 +2903,11 @@ func awsAwsjson11_serializeOpDocumentCreatePullThroughCacheRuleInput(v *CreatePu ok.String(*v.RegistryId) } + if len(v.UpstreamRegistry) > 0 { + ok := object.Key("upstreamRegistry") + ok.String(string(v.UpstreamRegistry)) + } + if v.UpstreamRegistryUrl != nil { ok := object.Key("upstreamRegistryUrl") ok.String(*v.UpstreamRegistryUrl) @@ -3532,6 +3652,28 @@ func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, v return nil } +func awsAwsjson11_serializeOpDocumentUpdatePullThroughCacheRuleInput(v *UpdatePullThroughCacheRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CredentialArn != nil { + ok := object.Key("credentialArn") + ok.String(*v.CredentialArn) + } + + if v.EcrRepositoryPrefix != nil { + ok := object.Key("ecrRepositoryPrefix") + ok.String(*v.EcrRepositoryPrefix) + } + + if v.RegistryId != nil { + ok := object.Key("registryId") + ok.String(*v.RegistryId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUploadLayerPartInput(v *UploadLayerPartInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3568,3 +3710,20 @@ func awsAwsjson11_serializeOpDocumentUploadLayerPartInput(v *UploadLayerPartInpu return nil } + +func awsAwsjson11_serializeOpDocumentValidatePullThroughCacheRuleInput(v *ValidatePullThroughCacheRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EcrRepositoryPrefix != nil { + ok := object.Key("ecrRepositoryPrefix") + ok.String(*v.EcrRepositoryPrefix) + } + + if v.RegistryId != nil { + ok := object.Key("registryId") + ok.String(*v.RegistryId) + } + + return nil +} diff --git a/service/ecr/types/enums.go b/service/ecr/types/enums.go index d782c4ec9c2..1ff5684677f 100644 --- a/service/ecr/types/enums.go +++ b/service/ecr/types/enums.go @@ -73,6 +73,9 @@ const ( ImageFailureCodeMissingDigestAndTag ImageFailureCode = "MissingDigestAndTag" ImageFailureCodeImageReferencedByManifestList ImageFailureCode = "ImageReferencedByManifestList" ImageFailureCodeKmsError ImageFailureCode = "KmsError" + ImageFailureCodeUpstreamAccessDenied ImageFailureCode = "UpstreamAccessDenied" + ImageFailureCodeUpstreamTooManyRequests ImageFailureCode = "UpstreamTooManyRequests" + ImageFailureCodeUpstreamUnavailable ImageFailureCode = "UpstreamUnavailable" ) // Values returns all known values for ImageFailureCode. Note that this can be @@ -87,6 +90,9 @@ func (ImageFailureCode) Values() []ImageFailureCode { "MissingDigestAndTag", "ImageReferencedByManifestList", "KmsError", + "UpstreamAccessDenied", + "UpstreamTooManyRequests", + "UpstreamUnavailable", } } @@ -324,3 +330,29 @@ func (TagStatus) Values() []TagStatus { "ANY", } } + +type UpstreamRegistry string + +// Enum values for UpstreamRegistry +const ( + UpstreamRegistryEcrPublic UpstreamRegistry = "ecr-public" + UpstreamRegistryQuay UpstreamRegistry = "quay" + UpstreamRegistryK8s UpstreamRegistry = "k8s" + UpstreamRegistryDockerHub UpstreamRegistry = "docker-hub" + UpstreamRegistryGitHubContainerRegistry UpstreamRegistry = "github-container-registry" + UpstreamRegistryAzureContainerRegistry UpstreamRegistry = "azure-container-registry" +) + +// Values returns all known values for UpstreamRegistry. 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 (UpstreamRegistry) Values() []UpstreamRegistry { + return []UpstreamRegistry{ + "ecr-public", + "quay", + "k8s", + "docker-hub", + "github-container-registry", + "azure-container-registry", + } +} diff --git a/service/ecr/types/errors.go b/service/ecr/types/errors.go index 4b4782c5a5d..01365bf0bf9 100644 --- a/service/ecr/types/errors.go +++ b/service/ecr/types/errors.go @@ -744,6 +744,33 @@ func (e *ScanNotFoundException) ErrorCode() string { } func (e *ScanNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The ARN of the secret specified in the pull through cache rule was not found. +// Update the pull through cache rule with a valid secret ARN and try again. +type SecretNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SecretNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SecretNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SecretNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SecretNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *SecretNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // These errors are usually caused by a server-side issue. type ServerException struct { Message *string @@ -797,6 +824,117 @@ func (e *TooManyTagsException) ErrorCode() string { } func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The secret is unable to be accessed. Verify the resource permissions for the +// secret and try again. +type UnableToAccessSecretException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnableToAccessSecretException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnableToAccessSecretException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnableToAccessSecretException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnableToAccessSecretException" + } + return *e.ErrorCodeOverride +} +func (e *UnableToAccessSecretException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The secret is accessible but is unable to be decrypted. Verify the resource +// permisisons and try again. +type UnableToDecryptSecretValueException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnableToDecryptSecretValueException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnableToDecryptSecretValueException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnableToDecryptSecretValueException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnableToDecryptSecretValueException" + } + return *e.ErrorCodeOverride +} +func (e *UnableToDecryptSecretValueException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The image or images were unable to be pulled using the pull through cache rule. +// This is usually caused because of an issue with the Secrets Manager secret +// containing the credentials for the upstream registry. +type UnableToGetUpstreamImageException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnableToGetUpstreamImageException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnableToGetUpstreamImageException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnableToGetUpstreamImageException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnableToGetUpstreamImageException" + } + return *e.ErrorCodeOverride +} +func (e *UnableToGetUpstreamImageException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// There was an issue getting the upstream layer matching the pull through cache +// rule. +type UnableToGetUpstreamLayerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnableToGetUpstreamLayerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnableToGetUpstreamLayerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnableToGetUpstreamLayerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnableToGetUpstreamLayerException" + } + return *e.ErrorCodeOverride +} +func (e *UnableToGetUpstreamLayerException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The image is of a type that cannot be scanned. type UnsupportedImageTypeException struct { Message *string diff --git a/service/ecr/types/types.go b/service/ecr/types/types.go index 1dbaf772597..e707591dfa9 100644 --- a/service/ecr/types/types.go +++ b/service/ecr/types/types.go @@ -563,6 +563,10 @@ type PullThroughCacheRule struct { // The date and time the pull through cache was created. CreatedAt *time.Time + // The ARN of the Secrets Manager secret associated with the pull through cache + // rule. + CredentialArn *string + // The Amazon ECR repository prefix associated with the pull through cache rule. EcrRepositoryPrefix *string @@ -570,6 +574,14 @@ type PullThroughCacheRule struct { // through cache rule is associated with. RegistryId *string + // The date and time, in JavaScript date format, when the pull through cache rule + // was last updated. + UpdatedAt *time.Time + + // The name of the upstream source registry associated with the pull through cache + // rule. + UpstreamRegistry UpstreamRegistry + // The upstream registry URL associated with the pull through cache rule. UpstreamRegistryUrl *string diff --git a/service/ecr/validators.go b/service/ecr/validators.go index 754611f1c8d..d9889a1148b 100644 --- a/service/ecr/validators.go +++ b/service/ecr/validators.go @@ -670,6 +670,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdatePullThroughCacheRule struct { +} + +func (*validateOpUpdatePullThroughCacheRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePullThroughCacheRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePullThroughCacheRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePullThroughCacheRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUploadLayerPart struct { } @@ -690,6 +710,26 @@ func (m *validateOpUploadLayerPart) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpValidatePullThroughCacheRule struct { +} + +func (*validateOpValidatePullThroughCacheRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpValidatePullThroughCacheRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ValidatePullThroughCacheRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpValidatePullThroughCacheRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpBatchCheckLayerAvailabilityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchCheckLayerAvailability{}, middleware.After) } @@ -822,10 +862,18 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdatePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePullThroughCacheRule{}, middleware.After) +} + func addOpUploadLayerPartValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUploadLayerPart{}, middleware.After) } +func addOpValidatePullThroughCacheRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpValidatePullThroughCacheRule{}, middleware.After) +} + func validateEncryptionConfiguration(v *types.EncryptionConfiguration) error { if v == nil { return nil @@ -1646,6 +1694,24 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdatePullThroughCacheRuleInput(v *UpdatePullThroughCacheRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePullThroughCacheRuleInput"} + if v.EcrRepositoryPrefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("EcrRepositoryPrefix")) + } + if v.CredentialArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUploadLayerPartInput(v *UploadLayerPartInput) error { if v == nil { return nil @@ -1672,3 +1738,18 @@ func validateOpUploadLayerPartInput(v *UploadLayerPartInput) error { return nil } } + +func validateOpValidatePullThroughCacheRuleInput(v *ValidatePullThroughCacheRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ValidatePullThroughCacheRuleInput"} + if v.EcrRepositoryPrefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("EcrRepositoryPrefix")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/emr/api_op_AddInstanceFleet.go b/service/emr/api_op_AddInstanceFleet.go index bb737db7275..bce137ce905 100644 --- a/service/emr/api_op_AddInstanceFleet.go +++ b/service/emr/api_op_AddInstanceFleet.go @@ -13,7 +13,7 @@ import ( ) // Adds an instance fleet to a running cluster. The instance fleet configuration -// is available only in Amazon EMR releases 4.8.0 and higher, excluding 5.0.x. +// is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x. func (c *Client) AddInstanceFleet(ctx context.Context, params *AddInstanceFleetInput, optFns ...func(*Options)) (*AddInstanceFleetOutput, error) { if params == nil { params = &AddInstanceFleetInput{} diff --git a/service/emr/api_op_CancelSteps.go b/service/emr/api_op_CancelSteps.go index 53b4eeff2f1..ffbfd9ab033 100644 --- a/service/emr/api_op_CancelSteps.go +++ b/service/emr/api_op_CancelSteps.go @@ -13,11 +13,11 @@ import ( ) // Cancels a pending step or steps in a running cluster. Available only in Amazon -// EMR versions 4.8.0 and higher, excluding version 5.0.0. A maximum of 256 steps +// EMR versions 4.8.0 and later, excluding version 5.0.0. A maximum of 256 steps // are allowed in each CancelSteps request. CancelSteps is idempotent but // asynchronous; it does not guarantee that a step will be canceled, even if the // request is successfully submitted. When you use Amazon EMR releases 5.28.0 and -// higher, you can cancel steps that are in a PENDING or RUNNING state. In earlier +// later, you can cancel steps that are in a PENDING or RUNNING state. In earlier // versions of Amazon EMR, you can only cancel steps that are in a PENDING state. func (c *Client) CancelSteps(ctx context.Context, params *CancelStepsInput, optFns ...func(*Options)) (*CancelStepsOutput, error) { if params == nil { diff --git a/service/emr/api_op_CreateStudio.go b/service/emr/api_op_CreateStudio.go index c0a905976ac..ea7daff89ae 100644 --- a/service/emr/api_op_CreateStudio.go +++ b/service/emr/api_op_CreateStudio.go @@ -84,6 +84,18 @@ type CreateStudioInput struct { // A detailed description of the Amazon EMR Studio. Description *string + // The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and + // notebook files when backed up to Amazon S3. + EncryptionKeyArn *string + + // The ARN of the IAM Identity Center instance to create the Studio application. + IdcInstanceArn *string + + // Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL . + // If the value is set to REQUIRED , users must be explicitly assigned to the + // Studio application to access the Studio. + IdcUserAssignment types.IdcUserAssignment + // The authentication endpoint of your identity provider (IdP). Specify this value // when you use IAM authentication and want to let federated users log in to a // Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio @@ -101,6 +113,10 @@ type CreateStudioInput struct { // characters, and an optional value string with a maximum of 256 characters. Tags []types.Tag + // A Boolean indicating whether to enable Trusted identity propagation for the + // Studio. The default value is false . + TrustedIdentityPropagationEnabled *bool + // The IAM user role that users and groups assume when logged in to an Amazon EMR // Studio. Only specify a UserRole when you use IAM Identity Center // authentication. The permissions attached to the UserRole can be scoped down for diff --git a/service/emr/api_op_GetBlockPublicAccessConfiguration.go b/service/emr/api_op_GetBlockPublicAccessConfiguration.go index 998a0b05d2a..660f4282305 100644 --- a/service/emr/api_op_GetBlockPublicAccessConfiguration.go +++ b/service/emr/api_op_GetBlockPublicAccessConfiguration.go @@ -44,12 +44,12 @@ type GetBlockPublicAccessConfigurationOutput struct { // that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is // specified as an exception using PermittedPublicSecurityGroupRuleRanges in the // BlockPublicAccessConfiguration . By default, Port 22 (SSH) is an exception, and - // public access is allowed on this port. To change this, update the block public - // access configuration to remove the exception. For accounts that created clusters - // in a Region before November 25, 2019, block public access is disabled by default - // in that Region. To use this feature, you must manually enable and configure it. - // For accounts that did not create an Amazon EMR cluster in a Region before this - // date, block public access is enabled by default in that Region. + // public access is allowed on this port. You can change this by updating the block + // public access configuration to remove the exception. For accounts that created + // clusters in a Region before November 25, 2019, block public access is disabled + // by default in that Region. To use this feature, you must manually enable and + // configure it. For accounts that did not create an Amazon EMR cluster in a Region + // before this date, block public access is enabled by default in that Region. // // This member is required. BlockPublicAccessConfiguration *types.BlockPublicAccessConfiguration diff --git a/service/emr/api_op_ListInstanceFleets.go b/service/emr/api_op_ListInstanceFleets.go index 48acad6bd08..3112db6133d 100644 --- a/service/emr/api_op_ListInstanceFleets.go +++ b/service/emr/api_op_ListInstanceFleets.go @@ -14,7 +14,7 @@ import ( // Lists all available details about the instance fleets in a cluster. The // instance fleet configuration is available only in Amazon EMR releases 4.8.0 and -// higher, excluding 5.0.x versions. +// later, excluding 5.0.x versions. func (c *Client) ListInstanceFleets(ctx context.Context, params *ListInstanceFleetsInput, optFns ...func(*Options)) (*ListInstanceFleetsOutput, error) { if params == nil { params = &ListInstanceFleetsInput{} diff --git a/service/emr/api_op_ModifyInstanceFleet.go b/service/emr/api_op_ModifyInstanceFleet.go index e20cfab7300..21df127cf24 100644 --- a/service/emr/api_op_ModifyInstanceFleet.go +++ b/service/emr/api_op_ModifyInstanceFleet.go @@ -15,7 +15,7 @@ import ( // Modifies the target On-Demand and target Spot capacities for the instance fleet // with the specified InstanceFleetID within the cluster specified using ClusterID. // The call either succeeds or fails atomically. The instance fleet configuration -// is available only in Amazon EMR releases 4.8.0 and higher, excluding 5.0.x +// is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x // versions. func (c *Client) ModifyInstanceFleet(ctx context.Context, params *ModifyInstanceFleetInput, optFns ...func(*Options)) (*ModifyInstanceFleetOutput, error) { if params == nil { diff --git a/service/emr/api_op_PutAutoTerminationPolicy.go b/service/emr/api_op_PutAutoTerminationPolicy.go index f10ab2708ad..080e5b193ef 100644 --- a/service/emr/api_op_PutAutoTerminationPolicy.go +++ b/service/emr/api_op_PutAutoTerminationPolicy.go @@ -13,7 +13,7 @@ import ( ) // Auto-termination is supported in Amazon EMR releases 5.30.0 and 6.1.0 and -// higher. For more information, see Using an auto-termination policy (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-auto-termination-policy.html) +// later. For more information, see Using an auto-termination policy (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-auto-termination-policy.html) // . Creates or updates an auto-termination policy for an Amazon EMR cluster. An // auto-termination policy defines the amount of idle time in seconds after which a // cluster automatically terminates. For alternative cluster termination options, diff --git a/service/emr/api_op_RunJobFlow.go b/service/emr/api_op_RunJobFlow.go index e8052058705..67229d5eac3 100644 --- a/service/emr/api_op_RunJobFlow.go +++ b/service/emr/api_op_RunJobFlow.go @@ -28,7 +28,7 @@ import ( // submitting queries directly to the software running on the master node, such as // Hive and Hadoop. For long-running clusters, we recommend that you periodically // store your results. The instance fleets configuration is available only in -// Amazon EMR releases 4.8.0 and higher, excluding 5.0.x versions. The RunJobFlow +// Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow // request can contain InstanceFleets parameters or InstanceGroups parameters, but // not both. func (c *Client) RunJobFlow(ctx context.Context, params *RunJobFlowInput, optFns ...func(*Options)) (*RunJobFlowOutput, error) { @@ -63,10 +63,10 @@ type RunJobFlowInput struct { AdditionalInfo *string // Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases - // 4.0 and higher, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID . + // 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID . AmiVersion *string - // Applies to Amazon EMR releases 4.0 and higher. A case-insensitive list of + // Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of // applications for Amazon EMR to install and configure when launching the cluster. // For a list of applications available for each Amazon EMR release version, see // the Amazon EMRRelease Guide (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/) @@ -89,11 +89,11 @@ type RunJobFlowInput struct { // A list of bootstrap actions to run before Hadoop starts on the cluster nodes. BootstrapActions []types.BootstrapActionConfig - // For Amazon EMR releases 4.0 and higher. The list of configurations supplied for + // For Amazon EMR releases 4.0 and later. The list of configurations supplied for // the Amazon EMR cluster that you are creating. Configurations []types.Configuration - // Available only in Amazon EMR releases 5.7.0 and higher. The ID of a custom + // Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom // Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when it // launches cluster Amazon EC2 instances. For more information about custom AMIs in // Amazon EMR, see Using a Custom AMI (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami.html) @@ -106,17 +106,18 @@ type RunJobFlowInput struct { // . CustomAmiId *string - // The IOPS for the Amazon EBS root device volume for the Linux AMI that each - // Amazon EC2 instance uses. Available in Amazon EMR releases 6.15.0 and higher. + // The IOPS, of the Amazon EBS root device volume of the Linux AMI that is used + // for each Amazon EC2 instance. Available in Amazon EMR releases 6.15.0 and later. EbsRootVolumeIops *int32 - // The size, in GiB, of the Amazon EBS root device volume for the Linux AMI that - // each Amazon EC2 instance uses. Available in Amazon EMR releases 4.x and higher. + // The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is + // used for each Amazon EC2 instance. Available in Amazon EMR releases 4.x and + // later. EbsRootVolumeSize *int32 - // The throughput, in MiB/s, of the Amazon EBS root device volume for the Linux - // AMI that each Amazon EC2 instance uses. Available in Amazon EMR releases 6.15.0 - // and higher. + // The throughput, in MiB/s, of the Amazon EBS root device volume of the Linux AMI + // that is used for each Amazon EC2 instance. Available in Amazon EMR releases + // 6.15.0 and later. EbsRootVolumeThroughput *int32 // Also called instance profile and Amazon EC2 role. An IAM role for an Amazon EMR @@ -133,7 +134,7 @@ type RunJobFlowInput struct { // The KMS key used for encrypting log files. If a value is not provided, the logs // remain encrypted by AES-256. This attribute is only available with Amazon EMR - // releases 5.30.0 and higher, excluding Amazon EMR 6.0.0. + // releases 5.30.0 and later, excluding Amazon EMR 6.0.0. LogEncryptionKmsKeyId *string // The location in Amazon S3 to write the log files of the job flow. If a value is @@ -143,12 +144,12 @@ type RunJobFlowInput struct { // The specified managed scaling policy for an Amazon EMR cluster. ManagedScalingPolicy *types.ManagedScalingPolicy - // For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and higher, - // use Applications. A list of strings that indicates third-party software to use - // with the job flow that accepts a user argument list. Amazon EMR accepts and - // forwards the argument list to the corresponding installation script as bootstrap - // action arguments. For more information, see "Launch a Job Flow on the MapR - // Distribution for Hadoop" in the Amazon EMR Developer Guide (https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf) + // For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use + // Applications. A list of strings that indicates third-party software to use with + // the job flow that accepts a user argument list. Amazon EMR accepts and forwards + // the argument list to the corresponding installation script as bootstrap action + // arguments. For more information, see "Launch a Job Flow on the MapR Distribution + // for Hadoop" in the Amazon EMR Developer Guide (https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf) // . Supported values are: // - "mapr-m3" - launch the cluster using MapR M3 Edition. // - "mapr-m5" - launch the cluster using MapR M5 Edition. @@ -175,7 +176,7 @@ type RunJobFlowInput struct { // emr-x.x.x , where x.x.x is an Amazon EMR release version such as emr-5.14.0 . // For more information about Amazon EMR release versions and included application // versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/) - // . The release label applies only to Amazon EMR releases version 4.0 and higher. + // . The release label applies only to Amazon EMR releases version 4.0 and later. // Earlier versions use AmiVersion . ReleaseLabel *string @@ -190,14 +191,14 @@ type RunJobFlowInput struct { // automatic scale-in activity occurs or an instance group is resized. // TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the // instance-hour boundary, regardless of when the request to terminate the instance - // was submitted. This option is only available with Amazon EMR 5.1.0 and higher - // and is the default for clusters created using that version. + // was submitted. This option is only available with Amazon EMR 5.1.0 and later and + // is the default for clusters created using that version. // TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list // and drains tasks from nodes before terminating the Amazon EC2 instances, // regardless of the instance-hour boundary. With either behavior, Amazon EMR // removes the least active nodes first and blocks instance termination if it could // lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon - // EMR releases 4.1.0 and higher, and is the default for releases of Amazon EMR + // EMR releases 4.1.0 and later, and is the default for releases of Amazon EMR // earlier than 5.1.0. ScaleDownBehavior types.ScaleDownBehavior @@ -216,9 +217,9 @@ type RunJobFlowInput struct { // A list of steps to run. Steps []types.StepConfig - // For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and higher, - // use Applications. A list of strings that indicates third-party software to use. - // For more information, see the Amazon EMR Developer Guide (https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf) + // For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use + // Applications. A list of strings that indicates third-party software to use. For + // more information, see the Amazon EMR Developer Guide (https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf) // . Currently supported values are: // - "mapr-m3" - launch the job flow using MapR M3 Edition. // - "mapr-m5" - launch the job flow using MapR M5 Edition. diff --git a/service/emr/api_op_UpdateStudio.go b/service/emr/api_op_UpdateStudio.go index 89d35bff9c1..efd646762d0 100644 --- a/service/emr/api_op_UpdateStudio.go +++ b/service/emr/api_op_UpdateStudio.go @@ -42,6 +42,10 @@ type UpdateStudioInput struct { // A detailed description to assign to the Amazon EMR Studio. Description *string + // The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and + // notebook files when backed up to Amazon S3. + EncryptionKeyArn *string + // A descriptive name for the Amazon EMR Studio. Name *string diff --git a/service/emr/deserializers.go b/service/emr/deserializers.go index ca072a21125..7211ddb03c2 100644 --- a/service/emr/deserializers.go +++ b/service/emr/deserializers.go @@ -13378,6 +13378,15 @@ func awsAwsjson11_deserializeDocumentStudio(v **types.Studio, value interface{}) sv.Description = ptr.String(jtv) } + case "EncryptionKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XmlString to be of type string, got %T instead", value) + } + sv.EncryptionKeyArn = ptr.String(jtv) + } + case "EngineSecurityGroupId": if value != nil { jtv, ok := value.(string) @@ -13387,6 +13396,24 @@ func awsAwsjson11_deserializeDocumentStudio(v **types.Studio, value interface{}) sv.EngineSecurityGroupId = ptr.String(jtv) } + case "IdcInstanceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArnType to be of type string, got %T instead", value) + } + sv.IdcInstanceArn = ptr.String(jtv) + } + + case "IdcUserAssignment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdcUserAssignment to be of type string, got %T instead", value) + } + sv.IdcUserAssignment = types.IdcUserAssignment(jtv) + } + case "IdpAuthUrl": if value != nil { jtv, ok := value.(string) @@ -13451,6 +13478,15 @@ func awsAwsjson11_deserializeDocumentStudio(v **types.Studio, value interface{}) return err } + case "TrustedIdentityPropagationEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) + } + sv.TrustedIdentityPropagationEnabled = ptr.Bool(jtv) + } + case "Url": if value != nil { jtv, ok := value.(string) diff --git a/service/emr/serializers.go b/service/emr/serializers.go index 82a741414cf..643d9e32a76 100644 --- a/service/emr/serializers.go +++ b/service/emr/serializers.go @@ -4771,11 +4771,26 @@ func awsAwsjson11_serializeOpDocumentCreateStudioInput(v *CreateStudioInput, val ok.String(*v.Description) } + if v.EncryptionKeyArn != nil { + ok := object.Key("EncryptionKeyArn") + ok.String(*v.EncryptionKeyArn) + } + if v.EngineSecurityGroupId != nil { ok := object.Key("EngineSecurityGroupId") ok.String(*v.EngineSecurityGroupId) } + if v.IdcInstanceArn != nil { + ok := object.Key("IdcInstanceArn") + ok.String(*v.IdcInstanceArn) + } + + if len(v.IdcUserAssignment) > 0 { + ok := object.Key("IdcUserAssignment") + ok.String(string(v.IdcUserAssignment)) + } + if v.IdpAuthUrl != nil { ok := object.Key("IdpAuthUrl") ok.String(*v.IdpAuthUrl) @@ -4810,6 +4825,11 @@ func awsAwsjson11_serializeOpDocumentCreateStudioInput(v *CreateStudioInput, val } } + if v.TrustedIdentityPropagationEnabled != nil { + ok := object.Key("TrustedIdentityPropagationEnabled") + ok.Boolean(*v.TrustedIdentityPropagationEnabled) + } + if v.UserRole != nil { ok := object.Key("UserRole") ok.String(*v.UserRole) @@ -5917,6 +5937,11 @@ func awsAwsjson11_serializeOpDocumentUpdateStudioInput(v *UpdateStudioInput, val ok.String(*v.Description) } + if v.EncryptionKeyArn != nil { + ok := object.Key("EncryptionKeyArn") + ok.String(*v.EncryptionKeyArn) + } + if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) diff --git a/service/emr/types/enums.go b/service/emr/types/enums.go index 1957a836f50..25299f8c76f 100644 --- a/service/emr/types/enums.go +++ b/service/emr/types/enums.go @@ -244,6 +244,24 @@ func (ExecutionEngineType) Values() []ExecutionEngineType { } } +type IdcUserAssignment string + +// Enum values for IdcUserAssignment +const ( + IdcUserAssignmentRequired IdcUserAssignment = "REQUIRED" + IdcUserAssignmentOptional IdcUserAssignment = "OPTIONAL" +) + +// Values returns all known values for IdcUserAssignment. 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 (IdcUserAssignment) Values() []IdcUserAssignment { + return []IdcUserAssignment{ + "REQUIRED", + "OPTIONAL", + } +} + type IdentityType string // Enum values for IdentityType diff --git a/service/emr/types/types.go b/service/emr/types/types.go index f1e3258505d..71f1faa11f0 100644 --- a/service/emr/types/types.go +++ b/service/emr/types/types.go @@ -7,7 +7,7 @@ import ( "time" ) -// With Amazon EMR release version 4.0 and higher, the only accepted parameter is +// With Amazon EMR release version 4.0 and later, the only accepted parameter is // the application name. To pass arguments to applications, you use configuration // classifications specified using configuration JSON objects. For more // information, see Configuring Applications (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html) @@ -201,7 +201,7 @@ type BootstrapActionDetail struct { } // Specification of the status of a CancelSteps request. Available only in Amazon -// EMR version 4.8.0 and higher, excluding version 5.0.0. +// EMR version 4.8.0 and later, excluding version 5.0.0. type CancelStepsInfo struct { // The reason for the failure if the CancelSteps request fails. @@ -286,25 +286,26 @@ type Cluster struct { // The Amazon Resource Name of the cluster. ClusterArn *string - // Applies only to Amazon EMR releases 4.x and higher. The list of configurations + // Applies only to Amazon EMR releases 4.x and later. The list of configurations // that are supplied to the Amazon EMR cluster. Configurations []Configuration - // Available only in Amazon EMR releases 5.7.0 and higher. The ID of a custom + // Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom // Amazon EBS-backed Linux AMI if the cluster uses a custom AMI. CustomAmiId *string - // The IOPS, of the Amazon EBS root device volume for the Linux AMI that each - // Amazon EC2 instance uses. Available in Amazon EMR releases 6.15.0 and higher. + // The IOPS, of the Amazon EBS root device volume of the Linux AMI that is used + // for each Amazon EC2 instance. Available in Amazon EMR releases 6.15.0 and later. EbsRootVolumeIops *int32 - // The size, in GiB, of the Amazon EBS root device volume for the Linux AMI that - // each Amazon EC2 instance uses. Available in Amazon EMR releases 4.x and higher. + // The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is + // used for each Amazon EC2 instance. Available in Amazon EMR releases 4.x and + // later. EbsRootVolumeSize *int32 - // The throughput, in MiB/s, of the Amazon EBS root device volume for the Linux - // AMI that each Amazon EC2 instance uses. Available in Amazon EMR releases 6.15.0 - // and higher. + // The throughput, in MiB/s, of the Amazon EBS root device volume of the Linux AMI + // that is used for each Amazon EC2 instance. Available in Amazon EMR releases + // 6.15.0 and later. EbsRootVolumeThroughput *int32 // Provides information about the Amazon EC2 instances in a cluster grouped by @@ -315,7 +316,7 @@ type Cluster struct { Id *string // The instance fleet configuration is available only in Amazon EMR releases 4.8.0 - // and higher, excluding 5.0.x versions. The instance group configuration of the + // and later, excluding 5.0.x versions. The instance group configuration of the // cluster. A value of INSTANCE_GROUP indicates a uniform instance group // configuration. A value of INSTANCE_FLEET indicates an instance fleets // configuration. @@ -328,7 +329,7 @@ type Cluster struct { KerberosAttributes *KerberosAttributes // The KMS key used for encrypting log files. This attribute is only available - // with Amazon EMR 5.30.0 and higher, excluding Amazon EMR 6.0.0. + // with Amazon EMR 5.30.0 and later, excluding Amazon EMR 6.0.0. LogEncryptionKmsKeyId *string // The path to the Amazon S3 location where logs for this cluster are stored. @@ -365,7 +366,7 @@ type Cluster struct { // emr-x.x.x , where x.x.x is an Amazon EMR release version such as emr-5.14.0 . // For more information about Amazon EMR release versions and included application // versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/) - // . The release label applies only to Amazon EMR releases version 4.0 and higher. + // . The release label applies only to Amazon EMR releases version 4.0 and later. // Earlier versions use AmiVersion . ReleaseLabel *string @@ -384,14 +385,14 @@ type Cluster struct { // scale-in activity occurs or an instance group is resized. // TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the // instance-hour boundary, regardless of when the request to terminate the instance - // was submitted. This option is only available with Amazon EMR 5.1.0 and higher - // and is the default for clusters created using that version. + // was submitted. This option is only available with Amazon EMR 5.1.0 and later and + // is the default for clusters created using that version. // TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list // and drains tasks from nodes before terminating the Amazon EC2 instances, // regardless of the instance-hour boundary. With either behavior, Amazon EMR // removes the least active nodes first and blocks instance termination if it could // lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION is available only in - // Amazon EMR releases 4.1.0 and higher, and is the default for versions of Amazon + // Amazon EMR releases 4.1.0 and later, and is the default for versions of Amazon // EMR earlier than 5.1.0. ScaleDownBehavior ScaleDownBehavior @@ -568,13 +569,13 @@ type ComputeLimits struct { noSmithyDocumentSerde } -// Amazon EMR releases 4.x or higher. An optional configuration specification to -// be used when provisioning cluster instances, which can include configurations -// for applications and software bundled with Amazon EMR. A configuration consists -// of a classification, properties, and optional nested configurations. A -// classification refers to an application-specific configuration file. Properties -// are the settings you want to change in that file. For more information, see -// Configuring Applications (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html) +// Amazon EMR releases 4.x or later. An optional configuration specification to be +// used when provisioning cluster instances, which can include configurations for +// applications and software bundled with Amazon EMR. A configuration consists of a +// classification, properties, and optional nested configurations. A classification +// refers to an application-specific configuration file. Properties are the +// settings you want to change in that file. For more information, see Configuring +// Applications (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html) // . type Configuration struct { @@ -885,7 +886,7 @@ type Instance struct { // a particular node type (master, core, or task) in an Amazon EMR cluster. // Instance fleets can consist of a mix of instance types and On-Demand and Spot // Instances, which are provisioned to meet a defined target capacity. The instance -// fleet configuration is available only in Amazon EMR releases 4.8.0 and higher, +// fleet configuration is available only in Amazon EMR releases 4.8.0 and later, // excluding 5.0.x versions. type InstanceFleet struct { @@ -963,7 +964,7 @@ type InstanceFleet struct { } // The configuration that defines an instance fleet. The instance fleet -// configuration is available only in Amazon EMR releases 4.8.0 and higher, +// configuration is available only in Amazon EMR releases 4.8.0 and later, // excluding 5.0.x versions. type InstanceFleetConfig struct { @@ -1024,7 +1025,7 @@ type InstanceFleetConfig struct { // Configuration parameters for an instance fleet modification request. The // instance fleet configuration is available only in Amazon EMR releases 4.8.0 and -// higher, excluding 5.0.x versions. +// later, excluding 5.0.x versions. type InstanceFleetModifyConfig struct { // A unique identifier for the instance fleet. @@ -1049,15 +1050,15 @@ type InstanceFleetModifyConfig struct { // The launch specification for Spot Instances in the fleet, which determines the // defined duration, provisioning timeout behavior, and allocation strategy. The // instance fleet configuration is available only in Amazon EMR releases 4.8.0 and -// higher, excluding 5.0.x versions. On-Demand and Spot instance allocation -// strategies are available in Amazon EMR releases 5.12.1 and higher. +// later, excluding 5.0.x versions. On-Demand and Spot instance allocation +// strategies are available in Amazon EMR releases 5.12.1 and later. type InstanceFleetProvisioningSpecifications struct { // The launch specification for On-Demand Instances in the instance fleet, which // determines the allocation strategy. The instance fleet configuration is - // available only in Amazon EMR releases 4.8.0 and higher, excluding 5.0.x - // versions. On-Demand Instances allocation strategy is available in Amazon EMR - // releases 5.12.1 and higher. + // available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. + // On-Demand Instances allocation strategy is available in Amazon EMR releases + // 5.12.1 and later. OnDemandSpecification *OnDemandProvisioningSpecification // The launch specification for Spot instances in the fleet, which determines the @@ -1082,7 +1083,7 @@ type InstanceFleetResizingSpecifications struct { } // Provides status change reason details for the instance fleet. The instance -// fleet configuration is available only in Amazon EMR releases 4.8.0 and higher, +// fleet configuration is available only in Amazon EMR releases 4.8.0 and later, // excluding 5.0.x versions. type InstanceFleetStateChangeReason struct { @@ -1096,7 +1097,7 @@ type InstanceFleetStateChangeReason struct { } // The status of the instance fleet. The instance fleet configuration is available -// only in Amazon EMR releases 4.8.0 and higher, excluding 5.0.x versions. +// only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. type InstanceFleetStatus struct { // A code representing the instance fleet status. @@ -1128,7 +1129,7 @@ type InstanceFleetStatus struct { // Provides historical timestamps for the instance fleet, including the time of // creation, the time it became ready to run jobs, and the time of termination. The // instance fleet configuration is available only in Amazon EMR releases 4.8.0 and -// higher, excluding 5.0.x versions. +// later, excluding 5.0.x versions. type InstanceFleetTimeline struct { // The time and date the instance fleet was created. @@ -1159,7 +1160,7 @@ type InstanceGroup struct { // amount in USD. BidPrice *string - // Amazon EMR releases 4.x or higher. The list of configurations supplied for an + // Amazon EMR releases 4.x or later. The list of configurations supplied for an // Amazon EMR cluster instance group. You can specify a separate configuration for // each instance group (master, core, and task). Configurations []Configuration @@ -1248,7 +1249,7 @@ type InstanceGroupConfig struct { // amount in USD. BidPrice *string - // Amazon EMR releases 4.x or higher. The list of configurations supplied for an + // Amazon EMR releases 4.x or later. The list of configurations supplied for an // Amazon EMR cluster instance group. You can specify a separate configuration for // each instance group (master, core, and task). Configurations []Configuration @@ -1474,7 +1475,7 @@ type InstanceTimeline struct { // Configure Instance Fleets (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) // . Without an allocation strategy, you may specify a maximum of five instance // type configurations for a fleet. The instance fleet configuration is available -// only in Amazon EMR releases 4.8.0 and higher, excluding 5.0.x versions. +// only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. type InstanceTypeConfig struct { // An Amazon EC2 instance type, such as m3.xlarge . @@ -1516,7 +1517,7 @@ type InstanceTypeConfig struct { // The configuration specification for each instance type in an instance fleet. // The instance fleet configuration is available only in Amazon EMR releases 4.8.0 -// and higher, excluding 5.0.x versions. +// and later, excluding 5.0.x versions. type InstanceTypeSpecification struct { // The bid price for each Amazon EC2 Spot Instance type as defined by InstanceType @@ -1579,7 +1580,7 @@ type JobFlowDetail struct { Name *string // Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases - // 4.0 and higher, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID . + // 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID . AmiVersion *string // An IAM role for automatic scaling policies. The default role is @@ -1596,7 +1597,7 @@ type JobFlowDetail struct { JobFlowRole *string // The KMS key used for encrypting log files. This attribute is only available - // with Amazon EMR 5.30.0 and higher, excluding 6.0.0. + // with Amazon EMR 5.30.0 and later, excluding 6.0.0. LogEncryptionKmsKeyId *string // The location in Amazon S3 where log files for the job are stored. @@ -1606,14 +1607,14 @@ type JobFlowDetail struct { // scale-in activity occurs or an instance group is resized. // TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the // instance-hour boundary, regardless of when the request to terminate the instance - // was submitted. This option is only available with Amazon EMR 5.1.0 and higher - // and is the default for clusters created using that version. + // was submitted. This option is only available with Amazon EMR 5.1.0 and later and + // is the default for clusters created using that version. // TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list // and drains tasks from nodes before terminating the Amazon EC2 instances, // regardless of the instance-hour boundary. With either behavior, Amazon EMR // removes the least active nodes first and blocks instance termination if it could // lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon - // EMR releases 4.1.0 and higher, and is the default for releases of Amazon EMR + // EMR releases 4.1.0 and later, and is the default for releases of Amazon EMR // earlier than 5.1.0. ScaleDownBehavior ScaleDownBehavior @@ -1699,7 +1700,7 @@ type JobFlowInstancesConfig struct { // Applies to clusters that use the instance fleet configuration. When multiple // Amazon EC2 subnet IDs are specified, Amazon EMR evaluates them and launches // instances in the optimal subnet. The instance fleet configuration is available - // only in Amazon EMR releases 4.8.0 and higher, excluding 5.0.x versions. + // only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. Ec2SubnetIds []string // The identifier of the Amazon EC2 security group for the master node. If you @@ -1724,7 +1725,7 @@ type JobFlowInstancesConfig struct { InstanceCount *int32 // The instance fleet configuration is available only in Amazon EMR releases 4.8.0 - // and higher, excluding 5.0.x versions. Describes the Amazon EC2 instances and + // and later, excluding 5.0.x versions. Describes the Amazon EC2 instances and // instance configurations for clusters that use the instance fleet configuration. InstanceFleets []InstanceFleetConfig @@ -2083,9 +2084,9 @@ type OnDemandCapacityReservationOptions struct { // The launch specification for On-Demand Instances in the instance fleet, which // determines the allocation strategy. The instance fleet configuration is -// available only in Amazon EMR releases 4.8.0 and higher, excluding 5.0.x -// versions. On-Demand Instances allocation strategy is available in Amazon EMR -// releases 5.12.1 and higher. +// available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. +// On-Demand Instances allocation strategy is available in Amazon EMR releases +// 5.12.1 and later. type OnDemandProvisioningSpecification struct { // Specifies the strategy to use in launching On-Demand instance fleets. @@ -2187,7 +2188,7 @@ type PlacementType struct { // launches instances in the optimal Availability Zone. AvailabilityZones is used // for instance fleets, while AvailabilityZone (singular) is used for uniform // instance groups. The instance fleet configuration is available only in Amazon - // EMR releases 4.8.0 and higher, excluding 5.0.x versions. + // EMR releases 4.8.0 and later, excluding 5.0.x versions. AvailabilityZones []string noSmithyDocumentSerde @@ -2455,8 +2456,8 @@ type SimplifiedApplication struct { // The launch specification for Spot Instances in the instance fleet, which // determines the defined duration, provisioning timeout behavior, and allocation // strategy. The instance fleet configuration is available only in Amazon EMR -// releases 4.8.0 and higher, excluding 5.0.x versions. Spot Instance allocation -// strategy is available in Amazon EMR releases 5.12.1 and higher. Spot Instances +// releases 4.8.0 and later, excluding 5.0.x versions. Spot Instance allocation +// strategy is available in Amazon EMR releases 5.12.1 and later. Spot Instances // with a defined duration (also known as Spot blocks) are no longer available to // new customers from July 1, 2021. For customers who have previously used the // feature, we will continue to support Spot Instances with a defined duration @@ -2726,11 +2727,23 @@ type Studio struct { // The detailed description of the Amazon EMR Studio. Description *string + // The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and + // notebook files when backed up to Amazon S3. + EncryptionKeyArn *string + // The ID of the Engine security group associated with the Amazon EMR Studio. The // Engine security group allows inbound network traffic from resources in the // Workspace security group. EngineSecurityGroupId *string + // The ARN of the IAM Identity Center instance the Studio application belongs to. + IdcInstanceArn *string + + // Indicates whether the Studio has REQUIRED or OPTIONAL IAM Identity Center user + // assignment. If the value is set to REQUIRED , users must be explicitly assigned + // to the Studio application to access the Studio. + IdcUserAssignment IdcUserAssignment + // Your identity provider's authentication endpoint. Amazon EMR Studio redirects // federated users to this endpoint for authentication when logging in to a Studio // with the Studio URL. @@ -2757,6 +2770,10 @@ type Studio struct { // A list of tags associated with the Amazon EMR Studio. Tags []Tag + // Indicates whether the Studio has Trusted identity propagation enabled. The + // default value is false . + TrustedIdentityPropagationEnabled *bool + // The unique access URL of the Amazon EMR Studio. Url *string @@ -2775,9 +2792,9 @@ type Studio struct { noSmithyDocumentSerde } -// Details for an Amazon EMR Studio, including ID, Name, VPC, and Description. The -// details do not include subnets, IAM roles, security groups, or tags associated -// with the Studio. +// Details for an Amazon EMR Studio, including ID, Name, VPC, and Description. To +// fetch additional details such as subnets, IAM roles, security groups, and tags +// for the Studio, use the DescribeStudio API. type StudioSummary struct { // Specifies whether the Studio authenticates users using IAM or IAM Identity diff --git a/service/eventbridge/api_op_CreateApiDestination.go b/service/eventbridge/api_op_CreateApiDestination.go index 0e71f23f2ad..db9afe847b7 100644 --- a/service/eventbridge/api_op_CreateApiDestination.go +++ b/service/eventbridge/api_op_CreateApiDestination.go @@ -14,7 +14,9 @@ import ( ) // Creates an API destination, which is an HTTP invocation endpoint configured as -// a target for events. +// a target for events. API destinations do not support private destinations, such +// as interface VPC endpoints. For more information, see API destinations (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html) +// in the EventBridge User Guide. func (c *Client) CreateApiDestination(ctx context.Context, params *CreateApiDestinationInput, optFns ...func(*Options)) (*CreateApiDestinationOutput, error) { if params == nil { params = &CreateApiDestinationInput{} diff --git a/service/eventbridge/api_op_CreatePartnerEventSource.go b/service/eventbridge/api_op_CreatePartnerEventSource.go index 4faaca78d2a..2eac6f2f1ed 100644 --- a/service/eventbridge/api_op_CreatePartnerEventSource.go +++ b/service/eventbridge/api_op_CreatePartnerEventSource.go @@ -21,11 +21,17 @@ import ( // partner event bus that matches the partner event source can use that event bus // to receive events from the partner, and then process them using Amazon Web // Services Events rules and targets. Partner event source names follow this -// format: partner_name/event_namespace/event_name partner_name is determined -// during partner registration and identifies the partner to Amazon Web Services -// customers. event_namespace is determined by the partner and is a way for the -// partner to categorize their events. event_name is determined by the partner, and -// should uniquely identify an event-generating resource within the partner system. +// format: partner_name/event_namespace/event_name +// - partner_name is determined during partner registration, and identifies the +// partner to Amazon Web Services customers. +// - event_namespace is determined by the partner, and is a way for the partner +// to categorize their events. +// - event_name is determined by the partner, and should uniquely identify an +// event-generating resource within the partner system. The event_name must be +// unique across all Amazon Web Services customers. This is because the event +// source is a shared resource between the partner and customer accounts, and each +// partner event source unique in the partner account. +// // The combination of event_namespace and event_name should help Amazon Web // Services customers decide whether to create an event bus to receive these // events. diff --git a/service/eventbridge/api_op_DescribeEndpoint.go b/service/eventbridge/api_op_DescribeEndpoint.go index 858aa78de44..2c33eb5d945 100644 --- a/service/eventbridge/api_op_DescribeEndpoint.go +++ b/service/eventbridge/api_op_DescribeEndpoint.go @@ -16,7 +16,7 @@ import ( // Get the information about an existing global endpoint. For more information // about global endpoints, see Making applications Regional-fault tolerant with // global endpoints and event replication (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) -// in the Amazon EventBridge User Guide.. +// in the Amazon EventBridge User Guide. func (c *Client) DescribeEndpoint(ctx context.Context, params *DescribeEndpointInput, optFns ...func(*Options)) (*DescribeEndpointOutput, error) { if params == nil { params = &DescribeEndpointInput{} diff --git a/service/eventbridge/api_op_ListEndpoints.go b/service/eventbridge/api_op_ListEndpoints.go index 4d5041c0182..d4588203a95 100644 --- a/service/eventbridge/api_op_ListEndpoints.go +++ b/service/eventbridge/api_op_ListEndpoints.go @@ -15,7 +15,7 @@ import ( // List the global endpoints associated with this account. For more information // about global endpoints, see Making applications Regional-fault tolerant with // global endpoints and event replication (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) -// in the Amazon EventBridge User Guide.. +// in the Amazon EventBridge User Guide. func (c *Client) ListEndpoints(ctx context.Context, params *ListEndpointsInput, optFns ...func(*Options)) (*ListEndpointsOutput, error) { if params == nil { params = &ListEndpointsInput{} diff --git a/service/eventbridge/api_op_ListRuleNamesByTarget.go b/service/eventbridge/api_op_ListRuleNamesByTarget.go index 9fd673e737d..db8ccbffb27 100644 --- a/service/eventbridge/api_op_ListRuleNamesByTarget.go +++ b/service/eventbridge/api_op_ListRuleNamesByTarget.go @@ -12,7 +12,8 @@ import ( ) // Lists the rules for the specified target. You can see which of the rules in -// Amazon EventBridge can invoke a specific target in your account. +// Amazon EventBridge can invoke a specific target in your account. The maximum +// number of results per page for requests is 100. func (c *Client) ListRuleNamesByTarget(ctx context.Context, params *ListRuleNamesByTargetInput, optFns ...func(*Options)) (*ListRuleNamesByTargetOutput, error) { if params == nil { params = &ListRuleNamesByTargetInput{} diff --git a/service/eventbridge/api_op_ListRules.go b/service/eventbridge/api_op_ListRules.go index 413165dd80e..cc199851c49 100644 --- a/service/eventbridge/api_op_ListRules.go +++ b/service/eventbridge/api_op_ListRules.go @@ -13,9 +13,9 @@ import ( ) // Lists your Amazon EventBridge rules. You can either list all the rules or you -// can provide a prefix to match to the rule names. ListRules does not list the -// targets of a rule. To see the targets associated with a rule, use -// ListTargetsByRule (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_ListTargetsByRule.html) +// can provide a prefix to match to the rule names. The maximum number of results +// per page for requests is 100. ListRules does not list the targets of a rule. To +// see the targets associated with a rule, use ListTargetsByRule (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_ListTargetsByRule.html) // . func (c *Client) ListRules(ctx context.Context, params *ListRulesInput, optFns ...func(*Options)) (*ListRulesOutput, error) { if params == nil { diff --git a/service/eventbridge/api_op_ListTargetsByRule.go b/service/eventbridge/api_op_ListTargetsByRule.go index cdc8ff29a0b..8bf4e067afd 100644 --- a/service/eventbridge/api_op_ListTargetsByRule.go +++ b/service/eventbridge/api_op_ListTargetsByRule.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the targets assigned to the specified rule. +// Lists the targets assigned to the specified rule. The maximum number of results +// per page for requests is 100. func (c *Client) ListTargetsByRule(ctx context.Context, params *ListTargetsByRuleInput, optFns ...func(*Options)) (*ListTargetsByRuleOutput, error) { if params == nil { params = &ListTargetsByRuleInput{} diff --git a/service/eventbridge/api_op_PutEvents.go b/service/eventbridge/api_op_PutEvents.go index 39cb846329a..e233cdce494 100644 --- a/service/eventbridge/api_op_PutEvents.go +++ b/service/eventbridge/api_op_PutEvents.go @@ -14,6 +14,13 @@ import ( ) // Sends custom events to Amazon EventBridge so that they can be matched to rules. +// The maximum size for a PutEvents event entry is 256 KB. Entry size is calculated +// including the event and any necessary characters and keys of the JSON +// representation of the event. To learn more, see Calculating PutEvents event +// entry size (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-putevent-size.html) +// in the Amazon EventBridge User Guide PutEvents accepts the data in JSON format. +// For the JSON number (integer) data type, the constraints are: a minimum value of +// -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807. // PutEvents will only process nested JSON up to 1100 levels deep. func (c *Client) PutEvents(ctx context.Context, params *PutEventsInput, optFns ...func(*Options)) (*PutEventsOutput, error) { if params == nil { diff --git a/service/eventbridge/api_op_PutPartnerEvents.go b/service/eventbridge/api_op_PutPartnerEvents.go index cb6567e6b2d..fba22b59072 100644 --- a/service/eventbridge/api_op_PutPartnerEvents.go +++ b/service/eventbridge/api_op_PutPartnerEvents.go @@ -13,7 +13,10 @@ import ( ) // This is used by SaaS partners to write events to a customer's partner event -// bus. Amazon Web Services customers do not use this operation. +// bus. Amazon Web Services customers do not use this operation. For information on +// calculating event batch size, see Calculating EventBridge PutEvents event entry +// size (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-putevent-size.html) +// in the EventBridge User Guide. func (c *Client) PutPartnerEvents(ctx context.Context, params *PutPartnerEventsInput, optFns ...func(*Options)) (*PutPartnerEventsOutput, error) { if params == nil { params = &PutPartnerEventsInput{} @@ -41,8 +44,11 @@ type PutPartnerEventsInput struct { type PutPartnerEventsOutput struct { - // The list of events from this operation that were successfully written to the - // partner event bus. + // The results for each event entry the partner submitted in this request. If the + // event was successfully submitted, the entry has the event ID in it. Otherwise, + // you can use the error code and error message to identify the problem with the + // entry. For each record, the index of the response element is the same as the + // index in the request array. Entries []types.PutPartnerEventsResultEntry // The number of events from this operation that could not be written to the diff --git a/service/eventbridge/api_op_PutRule.go b/service/eventbridge/api_op_PutRule.go index 9d52a00b085..95655c21a0a 100644 --- a/service/eventbridge/api_op_PutRule.go +++ b/service/eventbridge/api_op_PutRule.go @@ -99,7 +99,24 @@ type PutRuleInput struct { // minutes)". ScheduleExpression *string - // Indicates whether the rule is enabled or disabled. + // The state of the rule. Valid values include: + // - DISABLED : The rule is disabled. EventBridge does not match any events + // against the rule. + // - ENABLED : The rule is enabled. EventBridge matches events against the rule, + // except for Amazon Web Services management events delivered through CloudTrail. + // - ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS : The rule is enabled for all + // events, including Amazon Web Services management events delivered through + // CloudTrail. Management events provide visibility into management operations that + // are performed on resources in your Amazon Web Services account. These are also + // known as control plane operations. For more information, see Logging + // management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events) + // in the CloudTrail User Guide, and Filtering management events from Amazon Web + // Services services (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail) + // in the Amazon EventBridge User Guide. This value is only valid for rules on the + // default (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses) + // event bus or custom event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html) + // . It does not apply to partner event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html) + // . State types.RuleState // The list of key-value pairs to associate with the rule. diff --git a/service/eventbridge/api_op_PutTargets.go b/service/eventbridge/api_op_PutTargets.go index 56f086745b9..99ee51cbf41 100644 --- a/service/eventbridge/api_op_PutTargets.go +++ b/service/eventbridge/api_op_PutTargets.go @@ -14,53 +14,31 @@ import ( // Adds the specified targets to the specified rule, or updates the targets if // they are already associated with the rule. Targets are the resources that are -// invoked when a rule is triggered. Each rule can have up to five (5) targets -// associated with it at one time. You can configure the following as targets for -// Events: -// - API destination (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html) -// - API Gateway (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-gateway-target.html) -// - Batch job queue -// - CloudWatch group -// - CodeBuild project -// - CodePipeline -// - EC2 CreateSnapshot API call -// - EC2 Image Builder -// - EC2 RebootInstances API call -// - EC2 StopInstances API call -// - EC2 TerminateInstances API call -// - ECS task -// - Event bus in a different account or Region (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html) -// - Event bus in the same account and Region (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-bus-to-bus.html) -// - Firehose delivery stream -// - Glue workflow -// - Incident Manager response plan (https://docs.aws.amazon.com/incident-manager/latest/userguide/incident-creation.html#incident-tracking-auto-eventbridge) -// - Inspector assessment template -// - Kinesis stream -// - Lambda function -// - Redshift cluster -// - Redshift Serverless workgroup -// - SageMaker Pipeline -// - SNS topic -// - SQS queue -// - Step Functions state machine -// - Systems Manager Automation -// - Systems Manager OpsItem -// - Systems Manager Run Command +// invoked when a rule is triggered. The maximum number of entries per request is +// 10. Each rule can have up to five (5) targets associated with it at one time. +// For a list of services you can configure as targets for events, see EventBridge +// targets (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html) +// in the Amazon EventBridge User Guide. Creating rules with built-in targets is +// supported only in the Amazon Web Services Management Console. The built-in +// targets are: +// - Amazon EBS CreateSnapshot API call +// - Amazon EC2 RebootInstances API call +// - Amazon EC2 StopInstances API call +// - Amazon EC2 TerminateInstances API call // -// Creating rules with built-in targets is supported only in the Amazon Web -// Services Management Console. The built-in targets are EC2 CreateSnapshot API -// call , EC2 RebootInstances API call , EC2 StopInstances API call , and EC2 -// TerminateInstances API call . For some target types, PutTargets provides -// target-specific parameters. If the target is a Kinesis data stream, you can -// optionally specify which shard the event goes to by using the KinesisParameters -// argument. To invoke a command on multiple EC2 instances with one rule, you can -// use the RunCommandParameters field. To be able to make API calls against the -// resources that you own, Amazon EventBridge needs the appropriate permissions. -// For Lambda and Amazon SNS resources, EventBridge relies on resource-based -// policies. For EC2 instances, Kinesis Data Streams, Step Functions state machines -// and API Gateway APIs, EventBridge relies on IAM roles that you specify in the -// RoleARN argument in PutTargets . For more information, see Authentication and -// Access Control (https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html) +// For some target types, PutTargets provides target-specific parameters. If the +// target is a Kinesis data stream, you can optionally specify which shard the +// event goes to by using the KinesisParameters argument. To invoke a command on +// multiple EC2 instances with one rule, you can use the RunCommandParameters +// field. To be able to make API calls against the resources that you own, Amazon +// EventBridge needs the appropriate permissions: +// - For Lambda and Amazon SNS resources, EventBridge relies on resource-based +// policies. +// - For EC2 instances, Kinesis Data Streams, Step Functions state machines and +// API Gateway APIs, EventBridge relies on IAM roles that you specify in the +// RoleARN argument in PutTargets . +// +// For more information, see Authentication and Access Control (https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html) // in the Amazon EventBridge User Guide. If another Amazon Web Services account is // in the same region and has granted you permission (using PutPermission ), you // can send events to that account. Set that account's event bus as a target of the @@ -77,7 +55,9 @@ import ( // account ID, then you must specify a RoleArn with proper permissions in the // Target structure. For more information, see Sending and Receiving Events // Between Amazon Web Services Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) -// in the Amazon EventBridge User Guide. For more information about enabling +// in the Amazon EventBridge User Guide. If you have an IAM role on a cross-account +// event bus target, a PutTargets call without a role on the same target (same Id +// and Arn ) will not remove the role. For more information about enabling // cross-account events, see PutPermission (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutPermission.html) // . Input, InputPath, and InputTransformer are mutually exclusive and optional // parameters of a target. When a rule is triggered due to a matched event: diff --git a/service/eventbridge/api_op_RemoveTargets.go b/service/eventbridge/api_op_RemoveTargets.go index a88df89d663..955dbfa9cb4 100644 --- a/service/eventbridge/api_op_RemoveTargets.go +++ b/service/eventbridge/api_op_RemoveTargets.go @@ -20,7 +20,8 @@ import ( // Allow a short period of time for changes to take effect. This action can // partially fail if too many requests are made at the same time. If that happens, // FailedEntryCount is non-zero in the response and each entry in FailedEntries -// provides the ID of the failed target and the error code. +// provides the ID of the failed target and the error code. The maximum number of +// entries per request is 10. func (c *Client) RemoveTargets(ctx context.Context, params *RemoveTargetsInput, optFns ...func(*Options)) (*RemoveTargetsOutput, error) { if params == nil { params = &RemoveTargetsInput{} diff --git a/service/eventbridge/api_op_UpdateEndpoint.go b/service/eventbridge/api_op_UpdateEndpoint.go index 2ee50fa5bad..03c49871910 100644 --- a/service/eventbridge/api_op_UpdateEndpoint.go +++ b/service/eventbridge/api_op_UpdateEndpoint.go @@ -15,7 +15,7 @@ import ( // Update an existing endpoint. For more information about global endpoints, see // Making applications Regional-fault tolerant with global endpoints and event // replication (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) -// in the Amazon EventBridge User Guide.. +// in the Amazon EventBridge User Guide. func (c *Client) UpdateEndpoint(ctx context.Context, params *UpdateEndpointInput, optFns ...func(*Options)) (*UpdateEndpointOutput, error) { if params == nil { params = &UpdateEndpointInput{} diff --git a/service/eventbridge/endpoints.go b/service/eventbridge/endpoints.go index 3f67b7fd737..f79efc60d97 100644 --- a/service/eventbridge/endpoints.go +++ b/service/eventbridge/endpoints.go @@ -498,7 +498,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { if _Region == "us-gov-east-1" { uriString := "https://events.us-gov-east-1.amazonaws.com" diff --git a/service/eventbridge/types/enums.go b/service/eventbridge/types/enums.go index ca5724c5d3a..c523583a1bb 100644 --- a/service/eventbridge/types/enums.go +++ b/service/eventbridge/types/enums.go @@ -330,8 +330,9 @@ type RuleState string // Enum values for RuleState const ( - RuleStateEnabled RuleState = "ENABLED" - RuleStateDisabled RuleState = "DISABLED" + RuleStateEnabled RuleState = "ENABLED" + RuleStateDisabled RuleState = "DISABLED" + RuleStateEnabledWithAllCloudtrailManagementEvents RuleState = "ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS" ) // Values returns all known values for RuleState. Note that this can be expanded @@ -341,5 +342,6 @@ func (RuleState) Values() []RuleState { return []RuleState{ "ENABLED", "DISABLED", + "ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS", } } diff --git a/service/eventbridge/types/types.go b/service/eventbridge/types/types.go index 27b2a34e277..e2fdacd77e8 100644 --- a/service/eventbridge/types/types.go +++ b/service/eventbridge/types/types.go @@ -889,26 +889,39 @@ type Primary struct { type PutEventsRequestEntry struct { // A valid JSON object. There is no other schema imposed. The JSON object may - // contain fields and nested subobjects. + // contain fields and nested sub-objects. Detail , DetailType , and Source are + // required for EventBridge to successfully send an event to an event bus. If you + // include event entries in a request that do not include each of those properties, + // EventBridge fails that entry. If you submit a request in which none of the + // entries have each of these properties, EventBridge fails the entire request. Detail *string // Free-form string, with a maximum of 128 characters, used to decide what fields - // to expect in the event detail. + // to expect in the event detail. Detail , DetailType , and Source are required + // for EventBridge to successfully send an event to an event bus. If you include + // event entries in a request that do not include each of those properties, + // EventBridge fails that entry. If you submit a request in which none of the + // entries have each of these properties, EventBridge fails the entire request. DetailType *string // The name or ARN of the event bus to receive the event. Only the rules that are // associated with this event bus are used to match the event. If you omit this, // the default event bus is used. If you're using a global endpoint with a custom - // bus, you must enter the name, not the ARN, of the event bus in either the - // primary or secondary Region here and the corresponding event bus in the other - // Region will be determined based on the endpoint referenced by the EndpointId . + // bus, you can enter either the name or Amazon Resource Name (ARN) of the event + // bus in either the primary or secondary Region here. EventBridge then determines + // the corresponding event bus in the other Region based on the endpoint referenced + // by the EndpointId . Specifying the event bus ARN is preferred. EventBusName *string // Amazon Web Services resources, identified by Amazon Resource Name (ARN), which // the event primarily concerns. Any number, including zero, may be present. Resources []string - // The source of the event. + // The source of the event. Detail , DetailType , and Source are required for + // EventBridge to successfully send an event to an event bus. If you include event + // entries in a request that do not include each of those properties, EventBridge + // fails that entry. If you submit a request in which none of the entries have each + // of these properties, EventBridge fails the entire request. Source *string // The time stamp of the event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt) @@ -925,12 +938,31 @@ type PutEventsRequestEntry struct { noSmithyDocumentSerde } -// Represents an event that failed to be submitted. For information about the -// errors that are common to all actions, see Common Errors (https://docs.aws.amazon.com/eventbridge/latest/APIReference/CommonErrors.html) +// Represents the results of an event submitted to an event bus. If the submission +// was successful, the entry has the event ID in it. Otherwise, you can use the +// error code and error message to identify the problem with the entry. For +// information about the errors that are common to all actions, see Common Errors (https://docs.aws.amazon.com/eventbridge/latest/APIReference/CommonErrors.html) // . type PutEventsResultEntry struct { - // The error code that indicates why the event submission failed. + // The error code that indicates why the event submission failed. Retryable errors + // include: + // - InternalFailure (https://docs.aws.amazon.com/eventbridge/latest/APIReference/CommonErrors.html) + // The request processing has failed because of an unknown error, exception or + // failure. + // - ThrottlingException (https://docs.aws.amazon.com/eventbridge/latest/APIReference/CommonErrors.html) + // The request was denied due to request throttling. + // Non-retryable errors include: + // - AccessDeniedException (https://docs.aws.amazon.com/eventbridge/latest/APIReference/CommonErrors.html) + // You do not have sufficient access to perform this action. + // - InvalidAccountIdException The account ID provided is not valid. + // - InvalidArgument A specified parameter is not valid. + // - MalformedDetail The JSON provided is not valid. + // - RedactionFailure Redacting the CloudTrail event failed. + // - NotAuthorizedForSourceException You do not have permissions to publish + // events with this source onto this event bus. + // - NotAuthorizedForDetailTypeException You do not have permissions to publish + // events with this detail type onto this event bus. ErrorCode *string // The error message that explains why the event submission failed. @@ -946,18 +978,31 @@ type PutEventsResultEntry struct { type PutPartnerEventsRequestEntry struct { // A valid JSON string. There is no other schema imposed. The JSON string may - // contain fields and nested subobjects. + // contain fields and nested sub-objects. Detail , DetailType , and Source are + // required for EventBridge to successfully send an event to an event bus. If you + // include event entries in a request that do not include each of those properties, + // EventBridge fails that entry. If you submit a request in which none of the + // entries have each of these properties, EventBridge fails the entire request. Detail *string // A free-form string, with a maximum of 128 characters, used to decide what - // fields to expect in the event detail. + // fields to expect in the event detail. Detail , DetailType , and Source are + // required for EventBridge to successfully send an event to an event bus. If you + // include event entries in a request that do not include each of those properties, + // EventBridge fails that entry. If you submit a request in which none of the + // entries have each of these properties, EventBridge fails the entire request. DetailType *string // Amazon Web Services resources, identified by Amazon Resource Name (ARN), which // the event primarily concerns. Any number, including zero, may be present. Resources []string - // The event source that is generating the entry. + // The event source that is generating the entry. Detail , DetailType , and Source + // are required for EventBridge to successfully send an event to an event bus. If + // you include event entries in a request that do not include each of those + // properties, EventBridge fails that entry. If you submit a request in which none + // of the entries have each of these properties, EventBridge fails the entire + // request. Source *string // The date and time of the event. @@ -966,7 +1011,10 @@ type PutPartnerEventsRequestEntry struct { noSmithyDocumentSerde } -// Represents an event that a partner tried to generate, but failed. +// The result of an event entry the partner submitted in this request. If the +// event was successfully submitted, the entry has the event ID in it. Otherwise, +// you can use the error code and error message to identify the problem with the +// entry. type PutPartnerEventsResultEntry struct { // The error code that indicates why the event submission failed. @@ -998,8 +1046,8 @@ type PutTargetsResultEntry struct { } // These are custom parameters to be used when the target is a Amazon Redshift -// cluster or Redshift Serverless workgroup to invoke the Amazon Redshift Data API -// ExecuteStatement based on EventBridge events. +// cluster to invoke the Amazon Redshift Data API ExecuteStatement based on +// EventBridge events. type RedshiftDataParameters struct { // The name of the database. Required when authenticating using temporary @@ -1009,8 +1057,7 @@ type RedshiftDataParameters struct { Database *string // The database user name. Required when authenticating using temporary - // credentials. Do not provide this parameter when connecting to a Redshift - // Serverless workgroup. + // credentials. DbUser *string // The name or ARN of the secret that enables access to the database. Required @@ -1020,7 +1067,11 @@ type RedshiftDataParameters struct { // The SQL statement text to run. Sql *string - // A list of SQLs. + // One or more SQL statements to run. The SQL statements are run as a single + // transaction. They run serially in the order of the array. Subsequent SQL + // statements don't start until the previous statement in the array completes. If + // any SQL statement fails, then because they are run as one transaction, all work + // is rolled back. Sqls []string // The name of the SQL statement. You can name the SQL statement when you create @@ -1175,7 +1226,24 @@ type Rule struct { // . ScheduleExpression *string - // The state of the rule. + // The state of the rule. Valid values include: + // - DISABLED : The rule is disabled. EventBridge does not match any events + // against the rule. + // - ENABLED : The rule is enabled. EventBridge matches events against the rule, + // except for Amazon Web Services management events delivered through CloudTrail. + // - ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS : The rule is enabled for all + // events, including Amazon Web Services management events delivered through + // CloudTrail. Management events provide visibility into management operations that + // are performed on resources in your Amazon Web Services account. These are also + // known as control plane operations. For more information, see Logging + // management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events) + // in the CloudTrail User Guide, and Filtering management events from Amazon Web + // Services services (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail) + // in the Amazon EventBridge User Guide. This value is only valid for rules on the + // default (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses) + // event bus or custom event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html) + // . It does not apply to partner event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html) + // . State RuleState noSmithyDocumentSerde diff --git a/service/internetmonitor/api_op_CreateMonitor.go b/service/internetmonitor/api_op_CreateMonitor.go index e150a8f3e52..8a192312e1e 100644 --- a/service/internetmonitor/api_op_CreateMonitor.go +++ b/service/internetmonitor/api_op_CreateMonitor.go @@ -76,7 +76,7 @@ type CreateMonitorInput struct { // can help control billing costs. To learn more, see Choosing a city-network // maximum value (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html) // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide. - MaxCityNetworksToMonitor int32 + MaxCityNetworksToMonitor *int32 // The resources to include in a monitor, which you provide as a set of Amazon // Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront @@ -96,7 +96,7 @@ type CreateMonitorInput struct { // limit overrides the traffic percentage that you set. To learn more, see // Choosing an application traffic percentage to monitor (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html) // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide. - TrafficPercentageToMonitor int32 + TrafficPercentageToMonitor *int32 noSmithyDocumentSerde } diff --git a/service/internetmonitor/api_op_GetHealthEvent.go b/service/internetmonitor/api_op_GetHealthEvent.go index ae8432abbac..1ecfc0f519f 100644 --- a/service/internetmonitor/api_op_GetHealthEvent.go +++ b/service/internetmonitor/api_op_GetHealthEvent.go @@ -37,7 +37,7 @@ func (c *Client) GetHealthEvent(ctx context.Context, params *GetHealthEventInput type GetHealthEventInput struct { - // The internally generated identifier of a health event. Because EventID contains + // The internally-generated identifier of a health event. Because EventID contains // the forward slash (“/”) character, you must URL-encode the EventID field in the // request URL. // @@ -59,7 +59,7 @@ type GetHealthEventOutput struct { // This member is required. EventArn *string - // The internally generated identifier of a health event. + // The internally-generated identifier of a health event. // // This member is required. EventId *string diff --git a/service/internetmonitor/api_op_GetMonitor.go b/service/internetmonitor/api_op_GetMonitor.go index f757c64d73c..e25f950f3a9 100644 --- a/service/internetmonitor/api_op_GetMonitor.go +++ b/service/internetmonitor/api_op_GetMonitor.go @@ -94,7 +94,7 @@ type GetMonitorOutput struct { // provider (ISP), that clients access the resources through. This limit can help // control billing costs. To learn more, see Choosing a city-network maximum value (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html) // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide. - MaxCityNetworksToMonitor int32 + MaxCityNetworksToMonitor *int32 // The health of the data processing for the monitor. ProcessingStatus types.MonitorProcessingStatusCode @@ -110,7 +110,7 @@ type GetMonitorOutput struct { // traffic percentage that you set. To learn more, see Choosing an application // traffic percentage to monitor (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html) // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide. - TrafficPercentageToMonitor int32 + TrafficPercentageToMonitor *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/internetmonitor/api_op_GetQueryResults.go b/service/internetmonitor/api_op_GetQueryResults.go new file mode 100644 index 00000000000..b1659d78ee7 --- /dev/null +++ b/service/internetmonitor/api_op_GetQueryResults.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package internetmonitor + +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/internetmonitor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Return the data for a query with the Amazon CloudWatch Internet Monitor query +// interface. Specify the query that you want to return results for by providing a +// QueryId and a monitor name. For more information about using the query +// interface, including examples, see Using the Amazon CloudWatch Internet Monitor +// query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) +// in the Amazon CloudWatch Internet Monitor User Guide. +func (c *Client) GetQueryResults(ctx context.Context, params *GetQueryResultsInput, optFns ...func(*Options)) (*GetQueryResultsOutput, error) { + if params == nil { + params = &GetQueryResultsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetQueryResults", params, optFns, c.addOperationGetQueryResultsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetQueryResultsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetQueryResultsInput struct { + + // The name of the monitor to return data for. + // + // This member is required. + MonitorName *string + + // The ID of the query that you want to return data results for. A QueryId is an + // internally-generated identifier for a specific query. + // + // This member is required. + QueryId *string + + // The number of query results that you want to return with this call. + MaxResults *int32 + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string + + noSmithyDocumentSerde +} + +type GetQueryResultsOutput struct { + + // The data results that the query returns. Data is returned in arrays, aligned + // with the Fields for the query, which creates a repository of Amazon CloudWatch + // Internet Monitor information for your application. Then, you can filter the + // information in the repository by using FilterParameters that you define. + // + // This member is required. + Data [][]string + + // The fields that the query returns data for. Fields are name-data type pairs, + // such as availability_score - float . + // + // This member is required. + Fields []types.QueryField + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetQueryResultsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetQueryResults{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetQueryResults{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetQueryResults"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetQueryResultsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetQueryResults(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// GetQueryResultsAPIClient is a client that implements the GetQueryResults +// operation. +type GetQueryResultsAPIClient interface { + GetQueryResults(context.Context, *GetQueryResultsInput, ...func(*Options)) (*GetQueryResultsOutput, error) +} + +var _ GetQueryResultsAPIClient = (*Client)(nil) + +// GetQueryResultsPaginatorOptions is the paginator options for GetQueryResults +type GetQueryResultsPaginatorOptions struct { + // The number of query results that you want to return with this 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 +} + +// GetQueryResultsPaginator is a paginator for GetQueryResults +type GetQueryResultsPaginator struct { + options GetQueryResultsPaginatorOptions + client GetQueryResultsAPIClient + params *GetQueryResultsInput + nextToken *string + firstPage bool +} + +// NewGetQueryResultsPaginator returns a new GetQueryResultsPaginator +func NewGetQueryResultsPaginator(client GetQueryResultsAPIClient, params *GetQueryResultsInput, optFns ...func(*GetQueryResultsPaginatorOptions)) *GetQueryResultsPaginator { + if params == nil { + params = &GetQueryResultsInput{} + } + + options := GetQueryResultsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetQueryResultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetQueryResultsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetQueryResults page. +func (p *GetQueryResultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetQueryResultsOutput, 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.GetQueryResults(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_opGetQueryResults(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetQueryResults", + } +} diff --git a/service/internetmonitor/api_op_GetQueryStatus.go b/service/internetmonitor/api_op_GetQueryStatus.go new file mode 100644 index 00000000000..656b9fa8f12 --- /dev/null +++ b/service/internetmonitor/api_op_GetQueryStatus.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package internetmonitor + +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/internetmonitor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the current status of a query for the Amazon CloudWatch Internet +// Monitor query interface, for a specified query ID and monitor. When you run a +// query, check the status to make sure that the query has SUCCEEDED before you +// review the results. +// - QUEUED : The query is scheduled to run. +// - RUNNING : The query is in progress but not complete. +// - SUCCEEDED : The query completed sucessfully. +// - FAILED : The query failed due to an error. +// - CANCELED : The query was canceled. +func (c *Client) GetQueryStatus(ctx context.Context, params *GetQueryStatusInput, optFns ...func(*Options)) (*GetQueryStatusOutput, error) { + if params == nil { + params = &GetQueryStatusInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetQueryStatus", params, optFns, c.addOperationGetQueryStatusMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetQueryStatusOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetQueryStatusInput struct { + + // The name of the monitor. + // + // This member is required. + MonitorName *string + + // The ID of the query that you want to return the status for. A QueryId is an + // internally-generated dentifier for a specific query. + // + // This member is required. + QueryId *string + + noSmithyDocumentSerde +} + +type GetQueryStatusOutput struct { + + // The current status for a query. + // + // This member is required. + Status types.QueryStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetQueryStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetQueryStatus{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetQueryStatus{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetQueryStatus"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetQueryStatusValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetQueryStatus(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetQueryStatus(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetQueryStatus", + } +} diff --git a/service/internetmonitor/api_op_ListHealthEvents.go b/service/internetmonitor/api_op_ListHealthEvents.go index d232a0a98ba..f8c823157bd 100644 --- a/service/internetmonitor/api_op_ListHealthEvents.go +++ b/service/internetmonitor/api_op_ListHealthEvents.go @@ -47,7 +47,7 @@ type ListHealthEventsInput struct { EventStatus types.HealthEventStatus // The number of health event objects that you want to return with this call. - MaxResults int32 + MaxResults *int32 // The token for the next set of results. You receive this token from a previous // call. @@ -189,8 +189,8 @@ func NewListHealthEventsPaginator(client ListHealthEventsAPIClient, params *List } options := ListHealthEventsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -220,7 +220,11 @@ func (p *ListHealthEventsPaginator) NextPage(ctx context.Context, optFns ...func params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListHealthEvents(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/internetmonitor/api_op_ListMonitors.go b/service/internetmonitor/api_op_ListMonitors.go index 0ce7c119268..1d27919affc 100644 --- a/service/internetmonitor/api_op_ListMonitors.go +++ b/service/internetmonitor/api_op_ListMonitors.go @@ -32,7 +32,7 @@ func (c *Client) ListMonitors(ctx context.Context, params *ListMonitorsInput, op type ListMonitorsInput struct { // The number of monitor objects that you want to return with this call. - MaxResults int32 + MaxResults *int32 // The status of a monitor. This includes the status of the data processing for // the monitor and the status of the monitor itself. For information about the @@ -173,8 +173,8 @@ func NewListMonitorsPaginator(client ListMonitorsAPIClient, params *ListMonitors } options := ListMonitorsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -204,7 +204,11 @@ func (p *ListMonitorsPaginator) NextPage(ctx context.Context, optFns ...func(*Op params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListMonitors(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/internetmonitor/api_op_StartQuery.go b/service/internetmonitor/api_op_StartQuery.go new file mode 100644 index 00000000000..624f6f492ee --- /dev/null +++ b/service/internetmonitor/api_op_StartQuery.go @@ -0,0 +1,180 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package internetmonitor + +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/internetmonitor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Start a query to return data for a specific query type for the Amazon +// CloudWatch Internet Monitor query interface. Specify a time period for the data +// that you want returned by using StartTime and EndTime . You filter the query +// results to return by providing parameters that you specify with FilterParameters +// . For more information about using the query interface, including examples, see +// Using the Amazon CloudWatch Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) +// in the Amazon CloudWatch Internet Monitor User Guide. +func (c *Client) StartQuery(ctx context.Context, params *StartQueryInput, optFns ...func(*Options)) (*StartQueryOutput, error) { + if params == nil { + params = &StartQueryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartQuery", params, optFns, c.addOperationStartQueryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartQueryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartQueryInput struct { + + // The timestamp that is the end of the period that you want to retrieve data for + // with your query. + // + // This member is required. + EndTime *time.Time + + // The name of the monitor to query. + // + // This member is required. + MonitorName *string + + // The type of query to run. The following are the three types of queries that you + // can run using the Internet Monitor query interface: + // - MEASUREMENTS : TBD definition + // - TOP_LOCATIONS : TBD definition + // - TOP_LOCATION_DETAILS : TBD definition + // For lists of the fields returned with each query type and more information + // about how each type of query is performed, see Using the Amazon CloudWatch + // Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) + // in the Amazon CloudWatch Internet Monitor User Guide. + // + // This member is required. + QueryType types.QueryType + + // The timestamp that is the beginning of the period that you want to retrieve + // data for with your query. + // + // This member is required. + StartTime *time.Time + + // The FilterParameters field that you use with Amazon CloudWatch Internet Monitor + // queries is a string the defines how you want a query to be filtered. The filter + // parameters that you can specify depend on the query type, since each query type + // returns a different set of Internet Monitor data. For more information about + // specifying filter parameters, see Using the Amazon CloudWatch Internet Monitor + // query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) + // in the Amazon CloudWatch Internet Monitor User Guide. + FilterParameters []types.FilterParameter + + noSmithyDocumentSerde +} + +type StartQueryOutput struct { + + // The internally-generated identifier of a specific query. + // + // This member is required. + QueryId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartQuery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartQuery{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartQuery"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStartQueryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartQuery(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartQuery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartQuery", + } +} diff --git a/service/internetmonitor/api_op_StopQuery.go b/service/internetmonitor/api_op_StopQuery.go new file mode 100644 index 00000000000..3276315b2ba --- /dev/null +++ b/service/internetmonitor/api_op_StopQuery.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package internetmonitor + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stop a query that is progress for a specific monitor. +func (c *Client) StopQuery(ctx context.Context, params *StopQueryInput, optFns ...func(*Options)) (*StopQueryOutput, error) { + if params == nil { + params = &StopQueryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopQuery", params, optFns, c.addOperationStopQueryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopQueryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopQueryInput struct { + + // The name of the monitor. + // + // This member is required. + MonitorName *string + + // The ID of the query that you want to stop. A QueryId is an internally-generated + // identifier for a specific query. + // + // This member is required. + QueryId *string + + noSmithyDocumentSerde +} + +type StopQueryOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopQuery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopQuery{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopQuery"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStopQueryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopQuery(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopQuery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopQuery", + } +} diff --git a/service/internetmonitor/api_op_UpdateMonitor.go b/service/internetmonitor/api_op_UpdateMonitor.go index 89d00f1f47e..8790a51b439 100644 --- a/service/internetmonitor/api_op_UpdateMonitor.go +++ b/service/internetmonitor/api_op_UpdateMonitor.go @@ -63,7 +63,7 @@ type UpdateMonitorInput struct { // resources from and the ASN or network provider, such as an internet service // provider (ISP), that clients access the resources through. Setting this limit // can help control billing costs. - MaxCityNetworksToMonitor int32 + MaxCityNetworksToMonitor *int32 // The resources to include in a monitor, which you provide as a set of Amazon // Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront @@ -89,7 +89,7 @@ type UpdateMonitorInput struct { // limit overrides the traffic percentage that you set. To learn more, see // Choosing an application traffic percentage to monitor (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html) // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide. - TrafficPercentageToMonitor int32 + TrafficPercentageToMonitor *int32 noSmithyDocumentSerde } diff --git a/service/internetmonitor/deserializers.go b/service/internetmonitor/deserializers.go index 339b2aad15d..bcb362a5537 100644 --- a/service/internetmonitor/deserializers.go +++ b/service/internetmonitor/deserializers.go @@ -774,7 +774,7 @@ func awsRestjson1_deserializeOpDocumentGetMonitorOutput(v **GetMonitorOutput, va if err != nil { return err } - sv.MaxCityNetworksToMonitor = int32(i64) + sv.MaxCityNetworksToMonitor = ptr.Int32(int32(i64)) } case "ModifiedAt": @@ -855,7 +855,343 @@ func awsRestjson1_deserializeOpDocumentGetMonitorOutput(v **GetMonitorOutput, va if err != nil { return err } - sv.TrafficPercentageToMonitor = int32(i64) + sv.TrafficPercentageToMonitor = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetQueryResults struct { +} + +func (*awsRestjson1_deserializeOpGetQueryResults) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetQueryResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + 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_deserializeOpErrorGetQueryResults(response, &metadata) + } + output := &GetQueryResultsOutput{} + 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_deserializeOpDocumentGetQueryResultsOutput(&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_deserializeOpErrorGetQueryResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(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_deserializeOpDocumentGetQueryResultsOutput(v **GetQueryResultsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetQueryResultsOutput + if *v == nil { + sv = &GetQueryResultsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Data": + if err := awsRestjson1_deserializeDocumentQueryData(&sv.Data, value); err != nil { + return err + } + + case "Fields": + if err := awsRestjson1_deserializeDocumentQueryFields(&sv.Fields, 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 +} + +type awsRestjson1_deserializeOpGetQueryStatus struct { +} + +func (*awsRestjson1_deserializeOpGetQueryStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetQueryStatus) HandleDeserialize(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_deserializeOpErrorGetQueryStatus(response, &metadata) + } + output := &GetQueryStatusOutput{} + 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_deserializeOpDocumentGetQueryStatusOutput(&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_deserializeOpErrorGetQueryStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(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_deserializeOpDocumentGetQueryStatusOutput(v **GetQueryStatusOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetQueryStatusOutput + if *v == nil { + sv = &GetQueryStatusOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryStatus to be of type string, got %T instead", value) + } + sv.Status = types.QueryStatus(jtv) } default: @@ -870,11 +1206,176 @@ func awsRestjson1_deserializeOpDocumentGetMonitorOutput(v **GetMonitorOutput, va type awsRestjson1_deserializeOpListHealthEvents struct { } -func (*awsRestjson1_deserializeOpListHealthEvents) ID() string { +func (*awsRestjson1_deserializeOpListHealthEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListHealthEvents) HandleDeserialize(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_deserializeOpErrorListHealthEvents(response, &metadata) + } + output := &ListHealthEventsOutput{} + 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_deserializeOpDocumentListHealthEventsOutput(&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_deserializeOpErrorListHealthEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListHealthEventsOutput(v **ListHealthEventsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListHealthEventsOutput + if *v == nil { + sv = &ListHealthEventsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HealthEvents": + if err := awsRestjson1_deserializeDocumentHealthEventList(&sv.HealthEvents, 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 +} + +type awsRestjson1_deserializeOpListMonitors struct { +} + +func (*awsRestjson1_deserializeOpListMonitors) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListHealthEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMonitors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -888,9 +1389,9 @@ func (m *awsRestjson1_deserializeOpListHealthEvents) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListHealthEvents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMonitors(response, &metadata) } - output := &ListHealthEventsOutput{} + output := &ListMonitorsOutput{} out.Result = output var buff [1024]byte @@ -911,7 +1412,7 @@ func (m *awsRestjson1_deserializeOpListHealthEvents) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListHealthEventsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMonitorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -924,7 +1425,7 @@ func (m *awsRestjson1_deserializeOpListHealthEvents) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListHealthEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMonitors(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -987,7 +1488,175 @@ func awsRestjson1_deserializeOpErrorListHealthEvents(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListHealthEventsOutput(v **ListHealthEventsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListMonitorsOutput(v **ListMonitorsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListMonitorsOutput + if *v == nil { + sv = &ListMonitorsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Monitors": + if err := awsRestjson1_deserializeDocumentMonitorList(&sv.Monitors, 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 +} + +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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(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) } @@ -1000,29 +1669,20 @@ func awsRestjson1_deserializeOpDocumentListHealthEventsOutput(v **ListHealthEven return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListHealthEventsOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &ListHealthEventsOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "HealthEvents": - if err := awsRestjson1_deserializeDocumentHealthEventList(&sv.HealthEvents, value); err != nil { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, 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 @@ -1032,14 +1692,14 @@ func awsRestjson1_deserializeOpDocumentListHealthEventsOutput(v **ListHealthEven return nil } -type awsRestjson1_deserializeOpListMonitors struct { +type awsRestjson1_deserializeOpStartQuery struct { } -func (*awsRestjson1_deserializeOpListMonitors) ID() string { +func (*awsRestjson1_deserializeOpStartQuery) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMonitors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1053,9 +1713,9 @@ func (m *awsRestjson1_deserializeOpListMonitors) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMonitors(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartQuery(response, &metadata) } - output := &ListMonitorsOutput{} + output := &StartQueryOutput{} out.Result = output var buff [1024]byte @@ -1076,7 +1736,7 @@ func (m *awsRestjson1_deserializeOpListMonitors) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMonitorsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartQueryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1089,7 +1749,7 @@ func (m *awsRestjson1_deserializeOpListMonitors) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMonitors(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1136,6 +1796,9 @@ func awsRestjson1_deserializeOpErrorListMonitors(response *smithyhttp.Response, case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1152,7 +1815,7 @@ func awsRestjson1_deserializeOpErrorListMonitors(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListMonitorsOutput(v **ListMonitorsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartQueryOutput(v **StartQueryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1165,27 +1828,22 @@ func awsRestjson1_deserializeOpDocumentListMonitorsOutput(v **ListMonitorsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMonitorsOutput + var sv *StartQueryOutput if *v == nil { - sv = &ListMonitorsOutput{} + sv = &StartQueryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Monitors": - if err := awsRestjson1_deserializeDocumentMonitorList(&sv.Monitors, value); err != nil { - return err - } - - case "NextToken": + case "QueryId": 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) + sv.QueryId = ptr.String(jtv) } default: @@ -1197,14 +1855,14 @@ func awsRestjson1_deserializeOpDocumentListMonitorsOutput(v **ListMonitorsOutput return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpStopQuery struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpStopQuery) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStopQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1218,43 +1876,15 @@ 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_deserializeOpErrorStopQuery(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &StopQueryOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = 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 { +func awsRestjson1_deserializeOpErrorStopQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1298,17 +1928,17 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("InternalServerErrorException", errorCode): - return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(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{ @@ -1320,42 +1950,6 @@ 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_deserializeOpTagResource struct { } @@ -3663,6 +4257,157 @@ func awsRestjson1_deserializeDocumentPerformanceMeasurement(v **types.Performanc return nil } +func awsRestjson1_deserializeDocumentQueryData(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 err := awsRestjson1_deserializeDocumentQueryRow(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentQueryField(v **types.QueryField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.QueryField + if *v == nil { + sv = &types.QueryField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQueryFields(v *[]types.QueryField, 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.QueryField + if *v == nil { + cv = []types.QueryField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QueryField + destAddr := &col + if err := awsRestjson1_deserializeDocumentQueryField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentQueryRow(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_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/internetmonitor/endpoints.go b/service/internetmonitor/endpoints.go index 1c6f5dfbcdc..ce1031950a0 100644 --- a/service/internetmonitor/endpoints.go +++ b/service/internetmonitor/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://internetmonitor-fips.") diff --git a/service/internetmonitor/generated.json b/service/internetmonitor/generated.json index 3a3836788c1..5afc8017cb9 100644 --- a/service/internetmonitor/generated.json +++ b/service/internetmonitor/generated.json @@ -13,9 +13,13 @@ "api_op_DeleteMonitor.go", "api_op_GetHealthEvent.go", "api_op_GetMonitor.go", + "api_op_GetQueryResults.go", + "api_op_GetQueryStatus.go", "api_op_ListHealthEvents.go", "api_op_ListMonitors.go", "api_op_ListTagsForResource.go", + "api_op_StartQuery.go", + "api_op_StopQuery.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateMonitor.go", diff --git a/service/internetmonitor/serializers.go b/service/internetmonitor/serializers.go index 6e3d5c37fba..9be9022c29e 100644 --- a/service/internetmonitor/serializers.go +++ b/service/internetmonitor/serializers.go @@ -102,9 +102,9 @@ func awsRestjson1_serializeOpDocumentCreateMonitorInput(v *CreateMonitorInput, v } } - if v.MaxCityNetworksToMonitor != 0 { + if v.MaxCityNetworksToMonitor != nil { ok := object.Key("MaxCityNetworksToMonitor") - ok.Integer(v.MaxCityNetworksToMonitor) + ok.Integer(*v.MaxCityNetworksToMonitor) } if v.MonitorName != nil { @@ -126,9 +126,9 @@ func awsRestjson1_serializeOpDocumentCreateMonitorInput(v *CreateMonitorInput, v } } - if v.TrafficPercentageToMonitor != 0 { + if v.TrafficPercentageToMonitor != nil { ok := object.Key("TrafficPercentageToMonitor") - ok.Integer(v.TrafficPercentageToMonitor) + ok.Integer(*v.TrafficPercentageToMonitor) } return nil @@ -338,6 +338,162 @@ func awsRestjson1_serializeOpHttpBindingsGetMonitorInput(v *GetMonitorInput, enc return nil } +type awsRestjson1_serializeOpGetQueryResults struct { +} + +func (*awsRestjson1_serializeOpGetQueryResults) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetQueryResults) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetQueryResultsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetQueryResultsInput(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_serializeOpHttpBindingsGetQueryResultsInput(v *GetQueryResultsInput, 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.MonitorName == nil || len(*v.MonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MonitorName must not be empty")} + } + if v.MonitorName != nil { + if err := encoder.SetURI("MonitorName").String(*v.MonitorName); err != nil { + return err + } + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.QueryId == nil || len(*v.QueryId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QueryId must not be empty")} + } + if v.QueryId != nil { + if err := encoder.SetURI("QueryId").String(*v.QueryId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetQueryStatus struct { +} + +func (*awsRestjson1_serializeOpGetQueryStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetQueryStatus) 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.(*GetQueryStatusInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetQueryStatusInput(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_serializeOpHttpBindingsGetQueryStatusInput(v *GetQueryStatusInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MonitorName == nil || len(*v.MonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MonitorName must not be empty")} + } + if v.MonitorName != nil { + if err := encoder.SetURI("MonitorName").String(*v.MonitorName); err != nil { + return err + } + } + + if v.QueryId == nil || len(*v.QueryId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QueryId must not be empty")} + } + if v.QueryId != nil { + if err := encoder.SetURI("QueryId").String(*v.QueryId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListHealthEvents struct { } @@ -399,8 +555,8 @@ func awsRestjson1_serializeOpHttpBindingsListHealthEventsInput(v *ListHealthEven encoder.SetQuery("EventStatus").String(string(v.EventStatus)) } - if v.MaxResults != 0 { - encoder.SetQuery("MaxResults").Integer(v.MaxResults) + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) } if v.MonitorName == nil || len(*v.MonitorName) == 0 { @@ -476,8 +632,8 @@ func awsRestjson1_serializeOpHttpBindingsListMonitorsInput(v *ListMonitorsInput, return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MaxResults != 0 { - encoder.SetQuery("MaxResults").Integer(v.MaxResults) + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) } if v.MonitorStatus != nil { @@ -556,6 +712,185 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } +type awsRestjson1_serializeOpStartQuery struct { +} + +func (*awsRestjson1_serializeOpStartQuery) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartQuery) 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.(*StartQueryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20210603/Monitors/{MonitorName}/Queries") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartQueryInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartQueryInput(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_serializeOpHttpBindingsStartQueryInput(v *StartQueryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MonitorName == nil || len(*v.MonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MonitorName must not be empty")} + } + if v.MonitorName != nil { + if err := encoder.SetURI("MonitorName").String(*v.MonitorName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartQueryInput(v *StartQueryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("EndTime") + ok.String(smithytime.FormatDateTime(*v.EndTime)) + } + + if v.FilterParameters != nil { + ok := object.Key("FilterParameters") + if err := awsRestjson1_serializeDocumentFilterParameters(v.FilterParameters, ok); err != nil { + return err + } + } + + if len(v.QueryType) > 0 { + ok := object.Key("QueryType") + ok.String(string(v.QueryType)) + } + + if v.StartTime != nil { + ok := object.Key("StartTime") + ok.String(smithytime.FormatDateTime(*v.StartTime)) + } + + return nil +} + +type awsRestjson1_serializeOpStopQuery struct { +} + +func (*awsRestjson1_serializeOpStopQuery) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStopQuery) 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.(*StopQueryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStopQueryInput(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_serializeOpHttpBindingsStopQueryInput(v *StopQueryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MonitorName == nil || len(*v.MonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MonitorName must not be empty")} + } + if v.MonitorName != nil { + if err := encoder.SetURI("MonitorName").String(*v.MonitorName); err != nil { + return err + } + } + + if v.QueryId == nil || len(*v.QueryId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QueryId must not be empty")} + } + if v.QueryId != nil { + if err := encoder.SetURI("QueryId").String(*v.QueryId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } @@ -816,9 +1151,9 @@ func awsRestjson1_serializeOpDocumentUpdateMonitorInput(v *UpdateMonitorInput, v } } - if v.MaxCityNetworksToMonitor != 0 { + if v.MaxCityNetworksToMonitor != nil { ok := object.Key("MaxCityNetworksToMonitor") - ok.Integer(v.MaxCityNetworksToMonitor) + ok.Integer(*v.MaxCityNetworksToMonitor) } if v.ResourcesToAdd != nil { @@ -840,11 +1175,59 @@ func awsRestjson1_serializeOpDocumentUpdateMonitorInput(v *UpdateMonitorInput, v ok.String(string(v.Status)) } - if v.TrafficPercentageToMonitor != 0 { + if v.TrafficPercentageToMonitor != nil { ok := object.Key("TrafficPercentageToMonitor") - ok.Integer(v.TrafficPercentageToMonitor) + ok.Integer(*v.TrafficPercentageToMonitor) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterList(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_serializeDocumentFilterParameter(v *types.FilterParameter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + if v.Field != nil { + ok := object.Key("Field") + ok.String(*v.Field) + } + + if len(v.Operator) > 0 { + ok := object.Key("Operator") + ok.String(string(v.Operator)) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentFilterList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterParameters(v []types.FilterParameter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFilterParameter(&v[i], av); err != nil { + return err + } + } return nil } diff --git a/service/internetmonitor/types/enums.go b/service/internetmonitor/types/enums.go index d9648dd7b27..a8b4ac13598 100644 --- a/service/internetmonitor/types/enums.go +++ b/service/internetmonitor/types/enums.go @@ -127,6 +127,68 @@ func (MonitorProcessingStatusCode) Values() []MonitorProcessingStatusCode { } } +type Operator string + +// Enum values for Operator +const ( + OperatorEquals Operator = "EQUALS" + OperatorNotEquals Operator = "NOT_EQUALS" +) + +// Values returns all known values for Operator. 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 (Operator) Values() []Operator { + return []Operator{ + "EQUALS", + "NOT_EQUALS", + } +} + +type QueryStatus string + +// Enum values for QueryStatus +const ( + QueryStatusQueued QueryStatus = "QUEUED" + QueryStatusRunning QueryStatus = "RUNNING" + QueryStatusSucceeded QueryStatus = "SUCCEEDED" + QueryStatusFailed QueryStatus = "FAILED" + QueryStatusCanceled QueryStatus = "CANCELED" +) + +// Values returns all known values for QueryStatus. 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 (QueryStatus) Values() []QueryStatus { + return []QueryStatus{ + "QUEUED", + "RUNNING", + "SUCCEEDED", + "FAILED", + "CANCELED", + } +} + +type QueryType string + +// Enum values for QueryType +const ( + QueryTypeMeasurements QueryType = "MEASUREMENTS" + QueryTypeTopLocations QueryType = "TOP_LOCATIONS" + QueryTypeTopLocationDetails QueryType = "TOP_LOCATION_DETAILS" +) + +// Values returns all known values for QueryType. 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 (QueryType) Values() []QueryType { + return []QueryType{ + "MEASUREMENTS", + "TOP_LOCATIONS", + "TOP_LOCATION_DETAILS", + } +} + type TriangulationEventType string // Enum values for TriangulationEventType diff --git a/service/internetmonitor/types/types.go b/service/internetmonitor/types/types.go index fa7a61dd88f..7e2ae0a95fd 100644 --- a/service/internetmonitor/types/types.go +++ b/service/internetmonitor/types/types.go @@ -59,6 +59,37 @@ type AvailabilityMeasurement struct { noSmithyDocumentSerde } +// A filter that you use with the results of a Amazon CloudWatch Internet Monitor +// query that you created and ran. The query sets up a repository of data that is a +// subset of your application's Internet Monitor data. FilterParameter is a string +// that defines how you want to filter the repository of data to return a set of +// results, based on your criteria. The filter parameters that you can specify +// depend on the query type that you used to create the repository, since each +// query type returns a different set of Internet Monitor data. For each filter, +// you specify a field (such as city ), an operator (such as not_equals , and a +// value or array of values (such as ["Seattle", "Redmond"] ). Separate values in +// the array with commas. For more information about specifying filter parameters, +// see Using the Amazon CloudWatch Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) +// in the Amazon CloudWatch Internet Monitor User Guide. +type FilterParameter struct { + + // A data field that you want to filter, to further scope your application's + // Internet Monitor data in a repository that you created by running a query. A + // field might be city , for example. The field must be one of the fields that was + // returned by the specific query that you used to create the repository. + Field *string + + // The operator to use with the filter field and a value, such as not_equals . + Operator Operator + + // One or more values to be used, together with the specified operator, to filter + // data for a query. For example, you could specify an array of values such as + // ["Seattle", "Redmond"] . Values in the array are separated by commas. + Values []string + + noSmithyDocumentSerde +} + // Information about a health event created in a monitor in Amazon CloudWatch // Internet Monitor. type HealthEvent struct { @@ -68,7 +99,7 @@ type HealthEvent struct { // This member is required. EventArn *string - // The internally generated identifier of a specific network traffic impairment + // The internally-generated identifier of a specific network traffic impairment // health event. // // This member is required. @@ -278,7 +309,8 @@ type InternetMeasurementsLogDelivery struct { // Internet Monitor creates a health event. Also defines whether a local threshold // is enabled or disabled, and the minimum percentage of overall traffic that must // be impacted by an issue before Internet Monitor creates an event when a -// threshold is crossed for a local health score. For more information, see Change +// threshold is crossed for a local health score. If you don't set a local health +// event threshold, the default value is 60%. For more information, see Change // health event thresholds (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview) // in the Internet Monitor section of the CloudWatch User Guide. type LocalHealthEventsConfig struct { @@ -288,7 +320,8 @@ type LocalHealthEventsConfig struct { // The minimum percentage of overall traffic for an application that must be // impacted by an issue before Internet Monitor creates an event when a threshold - // is crossed for a local health score. + // is crossed for a local health score. If you don't set a minimum traffic impact + // threshold, the default value is 0.01%. MinTrafficImpact float64 // The status of whether Internet Monitor creates a health event based on a @@ -420,6 +453,24 @@ type PerformanceMeasurement struct { noSmithyDocumentSerde } +// Defines a field to query for your application's Amazon CloudWatch Internet +// Monitor data. You create a data repository by running a query of a specific +// type. Each QueryType includes a specific set of fields and datatypes to +// retrieve data for. +type QueryField struct { + + // The name of a field to query your application's Amazon CloudWatch Internet + // Monitor data for, such as availability_score . + Name *string + + // The data type for a query field, which must correspond to the field you're + // defining for QueryField . For example, if the query field name is + // availability_score , the data type is float . + Type *string + + noSmithyDocumentSerde +} + // Round-trip time (RTT) is how long it takes for a request from the user to // return a response to the user. Amazon CloudWatch Internet Monitor calculates RTT // at different percentiles: p50, p90, and p95. diff --git a/service/internetmonitor/validators.go b/service/internetmonitor/validators.go index 1b3b3945f62..4df1ea96548 100644 --- a/service/internetmonitor/validators.go +++ b/service/internetmonitor/validators.go @@ -89,6 +89,46 @@ func (m *validateOpGetMonitor) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpGetQueryResults struct { +} + +func (*validateOpGetQueryResults) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetQueryResults) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetQueryResultsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetQueryResultsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetQueryStatus struct { +} + +func (*validateOpGetQueryStatus) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetQueryStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetQueryStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetQueryStatusInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListHealthEvents struct { } @@ -129,6 +169,46 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpStartQuery struct { +} + +func (*validateOpStartQuery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartQuery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartQueryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartQueryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopQuery struct { +} + +func (*validateOpStopQuery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopQuery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopQueryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopQueryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -205,6 +285,14 @@ func addOpGetMonitorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMonitor{}, middleware.After) } +func addOpGetQueryResultsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetQueryResults{}, middleware.After) +} + +func addOpGetQueryStatusValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetQueryStatus{}, middleware.After) +} + func addOpListHealthEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListHealthEvents{}, middleware.After) } @@ -213,6 +301,14 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpStartQueryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartQuery{}, middleware.After) +} + +func addOpStopQueryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopQuery{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -288,6 +384,42 @@ func validateOpGetMonitorInput(v *GetMonitorInput) error { } } +func validateOpGetQueryResultsInput(v *GetQueryResultsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetQueryResultsInput"} + if v.MonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MonitorName")) + } + if v.QueryId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetQueryStatusInput(v *GetQueryStatusInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetQueryStatusInput"} + if v.MonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MonitorName")) + } + if v.QueryId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListHealthEventsInput(v *ListHealthEventsInput) error { if v == nil { return nil @@ -318,6 +450,48 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpStartQueryInput(v *StartQueryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartQueryInput"} + if v.MonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MonitorName")) + } + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } + if v.EndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTime")) + } + if len(v.QueryType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("QueryType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopQueryInput(v *StopQueryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopQueryInput"} + if v.MonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MonitorName")) + } + if v.QueryId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/ivs/api_op_ListChannels.go b/service/ivs/api_op_ListChannels.go index 4c9b16bcc68..00a47ce0f8d 100644 --- a/service/ivs/api_op_ListChannels.go +++ b/service/ivs/api_op_ListChannels.go @@ -41,7 +41,7 @@ type ListChannelsInput struct { FilterByRecordingConfigurationArn *string // Maximum number of channels to return. Default: 100. - MaxResults int32 + MaxResults *int32 // The first channel to retrieve. This is used for pagination; see the nextToken // response field. @@ -176,8 +176,8 @@ func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannels } options := ListChannelsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -207,7 +207,11 @@ func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Op params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListChannels(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivs/api_op_ListPlaybackKeyPairs.go b/service/ivs/api_op_ListPlaybackKeyPairs.go index a87744fa3bc..a2d6135481b 100644 --- a/service/ivs/api_op_ListPlaybackKeyPairs.go +++ b/service/ivs/api_op_ListPlaybackKeyPairs.go @@ -34,7 +34,7 @@ type ListPlaybackKeyPairsInput struct { // Maximum number of key pairs to return. Default: your service quota or 100, // whichever is smaller. - MaxResults int32 + MaxResults *int32 // The first key pair to retrieve. This is used for pagination; see the nextToken // response field. @@ -172,8 +172,8 @@ func NewListPlaybackKeyPairsPaginator(client ListPlaybackKeyPairsAPIClient, para } options := ListPlaybackKeyPairsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -203,7 +203,11 @@ func (p *ListPlaybackKeyPairsPaginator) NextPage(ctx context.Context, optFns ... params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListPlaybackKeyPairs(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivs/api_op_ListRecordingConfigurations.go b/service/ivs/api_op_ListRecordingConfigurations.go index 2523d24013b..bade8186ae8 100644 --- a/service/ivs/api_op_ListRecordingConfigurations.go +++ b/service/ivs/api_op_ListRecordingConfigurations.go @@ -33,7 +33,7 @@ type ListRecordingConfigurationsInput struct { // Maximum number of recording configurations to return. Default: your service // quota or 100, whichever is smaller. - MaxResults int32 + MaxResults *int32 // The first recording configuration to retrieve. This is used for pagination; see // the nextToken response field. @@ -173,8 +173,8 @@ func NewListRecordingConfigurationsPaginator(client ListRecordingConfigurationsA } options := ListRecordingConfigurationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -204,7 +204,11 @@ func (p *ListRecordingConfigurationsPaginator) NextPage(ctx context.Context, opt params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListRecordingConfigurations(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivs/api_op_ListStreamKeys.go b/service/ivs/api_op_ListStreamKeys.go index fbd36ed086a..ae688670d50 100644 --- a/service/ivs/api_op_ListStreamKeys.go +++ b/service/ivs/api_op_ListStreamKeys.go @@ -36,7 +36,7 @@ type ListStreamKeysInput struct { ChannelArn *string // Maximum number of streamKeys to return. Default: 1. - MaxResults int32 + MaxResults *int32 // The first stream key to retrieve. This is used for pagination; see the nextToken // response field. @@ -175,8 +175,8 @@ func NewListStreamKeysPaginator(client ListStreamKeysAPIClient, params *ListStre } options := ListStreamKeysPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -206,7 +206,11 @@ func (p *ListStreamKeysPaginator) NextPage(ctx context.Context, optFns ...func(* params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListStreamKeys(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivs/api_op_ListStreamSessions.go b/service/ivs/api_op_ListStreamSessions.go index c104ccfc8bf..ad4ca0a2243 100644 --- a/service/ivs/api_op_ListStreamSessions.go +++ b/service/ivs/api_op_ListStreamSessions.go @@ -37,7 +37,7 @@ type ListStreamSessionsInput struct { ChannelArn *string // Maximum number of streams to return. Default: 100. - MaxResults int32 + MaxResults *int32 // The first stream to retrieve. This is used for pagination; see the nextToken // response field. @@ -177,8 +177,8 @@ func NewListStreamSessionsPaginator(client ListStreamSessionsAPIClient, params * } options := ListStreamSessionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -208,7 +208,11 @@ func (p *ListStreamSessionsPaginator) NextPage(ctx context.Context, optFns ...fu params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListStreamSessions(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivs/api_op_ListStreams.go b/service/ivs/api_op_ListStreams.go index ae84b5fd68a..0191e1528b8 100644 --- a/service/ivs/api_op_ListStreams.go +++ b/service/ivs/api_op_ListStreams.go @@ -35,7 +35,7 @@ type ListStreamsInput struct { FilterBy *types.StreamFilters // Maximum number of streams to return. Default: 100. - MaxResults int32 + MaxResults *int32 // The first stream to retrieve. This is used for pagination; see the nextToken // response field. @@ -170,8 +170,8 @@ func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInp } options := ListStreamsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -201,7 +201,11 @@ func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Opt params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListStreams(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivs/deserializers.go b/service/ivs/deserializers.go index 5cc78e206d1..9ec7aee68b1 100644 --- a/service/ivs/deserializers.go +++ b/service/ivs/deserializers.go @@ -6816,7 +6816,7 @@ func awsRestjson1_deserializeDocumentThumbnailConfiguration(v **types.ThumbnailC if err != nil { return err } - sv.TargetIntervalSeconds = i64 + sv.TargetIntervalSeconds = ptr.Int64(i64) } default: diff --git a/service/ivs/endpoints.go b/service/ivs/endpoints.go index 98769a10d13..fa87921e9d2 100644 --- a/service/ivs/endpoints.go +++ b/service/ivs/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://ivs-fips.") diff --git a/service/ivs/serializers.go b/service/ivs/serializers.go index 66cb4fbe7db..104f5b726e2 100644 --- a/service/ivs/serializers.go +++ b/service/ivs/serializers.go @@ -1466,9 +1466,9 @@ func awsRestjson1_serializeOpDocumentListChannelsInput(v *ListChannelsInput, val ok.String(*v.FilterByRecordingConfigurationArn) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1546,9 +1546,9 @@ func awsRestjson1_serializeOpDocumentListPlaybackKeyPairsInput(v *ListPlaybackKe object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1626,9 +1626,9 @@ func awsRestjson1_serializeOpDocumentListRecordingConfigurationsInput(v *ListRec object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1711,9 +1711,9 @@ func awsRestjson1_serializeOpDocumentListStreamKeysInput(v *ListStreamKeysInput, ok.String(*v.ChannelArn) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1798,9 +1798,9 @@ func awsRestjson1_serializeOpDocumentListStreamsInput(v *ListStreamsInput, value } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1883,9 +1883,9 @@ func awsRestjson1_serializeOpDocumentListStreamSessionsInput(v *ListStreamSessio ok.String(*v.ChannelArn) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2629,9 +2629,9 @@ func awsRestjson1_serializeDocumentThumbnailConfiguration(v *types.ThumbnailConf } } - if v.TargetIntervalSeconds != 0 { + if v.TargetIntervalSeconds != nil { ok := object.Key("targetIntervalSeconds") - ok.Long(v.TargetIntervalSeconds) + ok.Long(*v.TargetIntervalSeconds) } return nil diff --git a/service/ivs/types/types.go b/service/ivs/types/types.go index 1c5e32a0039..a6d6817867f 100644 --- a/service/ivs/types/types.go +++ b/service/ivs/types/types.go @@ -581,7 +581,7 @@ type ThumbnailConfiguration struct { // targetIntervalSeconds value. See Amazon IVS Streaming Configuration (https://docs.aws.amazon.com/ivs/latest/userguide/streaming-config.html) // for information on setting IDR/Keyframe to the recommended value in // video-encoder settings. - TargetIntervalSeconds int64 + TargetIntervalSeconds *int64 noSmithyDocumentSerde } diff --git a/service/ivschat/api_op_CreateChatToken.go b/service/ivschat/api_op_CreateChatToken.go index b7eff2a497a..57831b9c630 100644 --- a/service/ivschat/api_op_CreateChatToken.go +++ b/service/ivschat/api_op_CreateChatToken.go @@ -64,7 +64,7 @@ type CreateChatTokenInput struct { // Session duration (in minutes), after which the session expires. Default: 60 (1 // hour). - SessionDurationInMinutes int32 + SessionDurationInMinutes *int32 noSmithyDocumentSerde } diff --git a/service/ivschat/api_op_CreateRoom.go b/service/ivschat/api_op_CreateRoom.go index b34c2045fd9..7726872ce78 100644 --- a/service/ivschat/api_op_CreateRoom.go +++ b/service/ivschat/api_op_CreateRoom.go @@ -37,11 +37,11 @@ type CreateRoomInput struct { // Maximum number of characters in a single message. Messages are expected to be // UTF-8 encoded and this limit applies specifically to rune/code-point count, not // number of bytes. Default: 500. - MaximumMessageLength int32 + MaximumMessageLength *int32 // Maximum number of messages per second that can be sent to the room (by all // clients). Default: 10. - MaximumMessageRatePerSecond int32 + MaximumMessageRatePerSecond *int32 // Configuration information for optional review of messages. MessageReviewHandler *types.MessageReviewHandler @@ -78,11 +78,11 @@ type CreateRoomOutput struct { // Maximum number of characters in a single message, from the request (if // specified). - MaximumMessageLength int32 + MaximumMessageLength *int32 // Maximum number of messages per second that can be sent to the room (by all // clients), from the request (if specified). - MaximumMessageRatePerSecond int32 + MaximumMessageRatePerSecond *int32 // Configuration information for optional review of messages. MessageReviewHandler *types.MessageReviewHandler diff --git a/service/ivschat/api_op_GetRoom.go b/service/ivschat/api_op_GetRoom.go index a48b6777cce..12e844f0f9a 100644 --- a/service/ivschat/api_op_GetRoom.go +++ b/service/ivschat/api_op_GetRoom.go @@ -59,11 +59,11 @@ type GetRoomOutput struct { // Maximum number of characters in a single message. Messages are expected to be // UTF-8 encoded and this limit applies specifically to rune/code-point count, not // number of bytes. Default: 500. - MaximumMessageLength int32 + MaximumMessageLength *int32 // Maximum number of messages per second that can be sent to the room (by all // clients). Default: 10. - MaximumMessageRatePerSecond int32 + MaximumMessageRatePerSecond *int32 // Configuration information for optional review of messages. MessageReviewHandler *types.MessageReviewHandler diff --git a/service/ivschat/api_op_ListLoggingConfigurations.go b/service/ivschat/api_op_ListLoggingConfigurations.go index 2f1e61f6a35..bb33322ea06 100644 --- a/service/ivschat/api_op_ListLoggingConfigurations.go +++ b/service/ivschat/api_op_ListLoggingConfigurations.go @@ -32,7 +32,7 @@ func (c *Client) ListLoggingConfigurations(ctx context.Context, params *ListLogg type ListLoggingConfigurationsInput struct { // Maximum number of logging configurations to return. Default: 50. - MaxResults int32 + MaxResults *int32 // The first logging configurations to retrieve. This is used for pagination; see // the nextToken response field. @@ -172,8 +172,8 @@ func NewListLoggingConfigurationsPaginator(client ListLoggingConfigurationsAPICl } options := ListLoggingConfigurationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -203,7 +203,11 @@ func (p *ListLoggingConfigurationsPaginator) NextPage(ctx context.Context, optFn params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListLoggingConfigurations(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivschat/api_op_ListRooms.go b/service/ivschat/api_op_ListRooms.go index 1760cf4875a..6dae3604d0b 100644 --- a/service/ivschat/api_op_ListRooms.go +++ b/service/ivschat/api_op_ListRooms.go @@ -35,7 +35,7 @@ type ListRoomsInput struct { LoggingConfigurationIdentifier *string // Maximum number of rooms to return. Default: 50. - MaxResults int32 + MaxResults *int32 // Filters the list to match the specified message review handler URI. MessageReviewHandlerUri *string @@ -176,8 +176,8 @@ func NewListRoomsPaginator(client ListRoomsAPIClient, params *ListRoomsInput, op } options := ListRoomsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -207,7 +207,11 @@ func (p *ListRoomsPaginator) NextPage(ctx context.Context, optFns ...func(*Optio params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListRooms(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/ivschat/api_op_UpdateRoom.go b/service/ivschat/api_op_UpdateRoom.go index 2f26eb5a856..7d9af3e25e2 100644 --- a/service/ivschat/api_op_UpdateRoom.go +++ b/service/ivschat/api_op_UpdateRoom.go @@ -42,11 +42,11 @@ type UpdateRoomInput struct { // The maximum number of characters in a single message. Messages are expected to // be UTF-8 encoded and this limit applies specifically to rune/code-point count, // not number of bytes. Default: 500. - MaximumMessageLength int32 + MaximumMessageLength *int32 // Maximum number of messages per second that can be sent to the room (by all // clients). Default: 10. - MaximumMessageRatePerSecond int32 + MaximumMessageRatePerSecond *int32 // Configuration information for optional review of messages. Specify an empty uri // string to disassociate a message review handler from the specified room. @@ -77,11 +77,11 @@ type UpdateRoomOutput struct { // Maximum number of characters in a single message, from the request (if // specified). - MaximumMessageLength int32 + MaximumMessageLength *int32 // Maximum number of messages per second that can be sent to the room (by all // clients), from the request (if specified). - MaximumMessageRatePerSecond int32 + MaximumMessageRatePerSecond *int32 // Configuration information for optional review of messages. MessageReviewHandler *types.MessageReviewHandler diff --git a/service/ivschat/deserializers.go b/service/ivschat/deserializers.go index b64467fd6bc..bbd4a231527 100644 --- a/service/ivschat/deserializers.go +++ b/service/ivschat/deserializers.go @@ -629,7 +629,7 @@ func awsRestjson1_deserializeOpDocumentCreateRoomOutput(v **CreateRoomOutput, va if err != nil { return err } - sv.MaximumMessageLength = int32(i64) + sv.MaximumMessageLength = ptr.Int32(int32(i64)) } case "maximumMessageRatePerSecond": @@ -642,7 +642,7 @@ func awsRestjson1_deserializeOpDocumentCreateRoomOutput(v **CreateRoomOutput, va if err != nil { return err } - sv.MaximumMessageRatePerSecond = int32(i64) + sv.MaximumMessageRatePerSecond = ptr.Int32(int32(i64)) } case "messageReviewHandler": @@ -1548,7 +1548,7 @@ func awsRestjson1_deserializeOpDocumentGetRoomOutput(v **GetRoomOutput, value in if err != nil { return err } - sv.MaximumMessageLength = int32(i64) + sv.MaximumMessageLength = ptr.Int32(int32(i64)) } case "maximumMessageRatePerSecond": @@ -1561,7 +1561,7 @@ func awsRestjson1_deserializeOpDocumentGetRoomOutput(v **GetRoomOutput, value in if err != nil { return err } - sv.MaximumMessageRatePerSecond = int32(i64) + sv.MaximumMessageRatePerSecond = ptr.Int32(int32(i64)) } case "messageReviewHandler": @@ -2834,7 +2834,7 @@ func awsRestjson1_deserializeOpDocumentUpdateRoomOutput(v **UpdateRoomOutput, va if err != nil { return err } - sv.MaximumMessageLength = int32(i64) + sv.MaximumMessageLength = ptr.Int32(int32(i64)) } case "maximumMessageRatePerSecond": @@ -2847,7 +2847,7 @@ func awsRestjson1_deserializeOpDocumentUpdateRoomOutput(v **UpdateRoomOutput, va if err != nil { return err } - sv.MaximumMessageRatePerSecond = int32(i64) + sv.MaximumMessageRatePerSecond = ptr.Int32(int32(i64)) } case "messageReviewHandler": diff --git a/service/ivschat/endpoints.go b/service/ivschat/endpoints.go index 72082112385..c35c7072cca 100644 --- a/service/ivschat/endpoints.go +++ b/service/ivschat/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://ivschat-fips.") diff --git a/service/ivschat/serializers.go b/service/ivschat/serializers.go index 821e11b159d..e87f26b556d 100644 --- a/service/ivschat/serializers.go +++ b/service/ivschat/serializers.go @@ -100,9 +100,9 @@ func awsRestjson1_serializeOpDocumentCreateChatTokenInput(v *CreateChatTokenInpu ok.String(*v.RoomIdentifier) } - if v.SessionDurationInMinutes != 0 { + if v.SessionDurationInMinutes != nil { ok := object.Key("sessionDurationInMinutes") - ok.Integer(v.SessionDurationInMinutes) + ok.Integer(*v.SessionDurationInMinutes) } if v.UserId != nil { @@ -276,14 +276,14 @@ func awsRestjson1_serializeOpDocumentCreateRoomInput(v *CreateRoomInput, value s } } - if v.MaximumMessageLength != 0 { + if v.MaximumMessageLength != nil { ok := object.Key("maximumMessageLength") - ok.Integer(v.MaximumMessageLength) + ok.Integer(*v.MaximumMessageLength) } - if v.MaximumMessageRatePerSecond != 0 { + if v.MaximumMessageRatePerSecond != nil { ok := object.Key("maximumMessageRatePerSecond") - ok.Integer(v.MaximumMessageRatePerSecond) + ok.Integer(*v.MaximumMessageRatePerSecond) } if v.MessageReviewHandler != nil { @@ -845,9 +845,9 @@ func awsRestjson1_serializeOpDocumentListLoggingConfigurationsInput(v *ListLoggi object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -930,9 +930,9 @@ func awsRestjson1_serializeOpDocumentListRoomsInput(v *ListRoomsInput, value smi ok.String(*v.LoggingConfigurationIdentifier) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.MessageReviewHandlerUri != nil { @@ -1432,14 +1432,14 @@ func awsRestjson1_serializeOpDocumentUpdateRoomInput(v *UpdateRoomInput, value s } } - if v.MaximumMessageLength != 0 { + if v.MaximumMessageLength != nil { ok := object.Key("maximumMessageLength") - ok.Integer(v.MaximumMessageLength) + ok.Integer(*v.MaximumMessageLength) } - if v.MaximumMessageRatePerSecond != 0 { + if v.MaximumMessageRatePerSecond != nil { ok := object.Key("maximumMessageRatePerSecond") - ok.Integer(v.MaximumMessageRatePerSecond) + ok.Integer(*v.MaximumMessageRatePerSecond) } if v.MessageReviewHandler != nil { diff --git a/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go b/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go index e73d4ba70b8..003c40cf3ab 100644 --- a/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go +++ b/service/kinesisvideo/api_op_DescribeMediaStorageConfiguration.go @@ -12,10 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API is related to WebRTC Ingestion (https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/webrtc-ingestion.html) -// and is only available in the us-west-2 region. Returns the most current -// information about the channel. Specify the ChannelName or ChannelARN in the -// input. +// Returns the most current information about the channel. Specify the ChannelName +// or ChannelARN in the input. func (c *Client) DescribeMediaStorageConfiguration(ctx context.Context, params *DescribeMediaStorageConfigurationInput, optFns ...func(*Options)) (*DescribeMediaStorageConfigurationOutput, error) { if params == nil { params = &DescribeMediaStorageConfigurationInput{} diff --git a/service/kinesisvideo/api_op_UpdateDataRetention.go b/service/kinesisvideo/api_op_UpdateDataRetention.go index 7820a0d9c59..e5fd4307d64 100644 --- a/service/kinesisvideo/api_op_UpdateDataRetention.go +++ b/service/kinesisvideo/api_op_UpdateDataRetention.go @@ -15,10 +15,9 @@ import ( // Increases or decreases the stream's data retention period by the value that you // specify. To indicate whether you want to increase or decrease the data retention // period, specify the Operation parameter in the request body. In the request, -// you must specify either the StreamName or the StreamARN . The retention period -// that you specify replaces the current value. This operation requires permission -// for the KinesisVideo:UpdateDataRetention action. Changing the data retention -// period affects the data in the stream as follows: +// you must specify either the StreamName or the StreamARN . This operation +// requires permission for the KinesisVideo:UpdateDataRetention action. Changing +// the data retention period affects the data in the stream as follows: // - If the data retention period is increased, existing data is retained for // the new retention period. For example, if the data retention period is increased // from one hour to seven hours, all existing data is retained for seven hours. @@ -49,8 +48,10 @@ type UpdateDataRetentionInput struct { // This member is required. CurrentVersion *string - // The retention period, in hours. The value you specify replaces the current - // value. The maximum value for this parameter is 87600 (ten years). + // The number of hours to adjust the current retention by. The value you specify + // is added to or subtracted from the current value, depending on the operation . + // The minimum value for data retention is 0 and the maximum value is 87600 (ten + // years). // // This member is required. DataRetentionChangeInHours *int32 diff --git a/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go b/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go index 892d6f5119e..d417088e976 100644 --- a/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go +++ b/service/kinesisvideo/api_op_UpdateMediaStorageConfiguration.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This API is related to WebRTC Ingestion (https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/webrtc-ingestion.html) -// and is only available in the us-west-2 region. Associates a SignalingChannel to -// a stream to store the media. There are two signaling modes that can specified : -// - If the StorageStatus is disabled, no data will be stored, and the StreamARN +// Associates a SignalingChannel to a stream to store the media. There are two +// signaling modes that you can specify : +// - If StorageStatus is enabled, the data will be stored in the StreamARN +// provided. In order for WebRTC Ingestion to work, the stream must have data +// retention enabled. +// - If StorageStatus is disabled, no data will be stored, and the StreamARN // parameter will not be needed. -// - If the StorageStatus is enabled, the data will be stored in the StreamARN -// provided. // // If StorageStatus is enabled, direct peer-to-peer (master-viewer) connections no // longer occur. Peers connect directly to the storage session. You must call the diff --git a/service/kinesisvideo/endpoints.go b/service/kinesisvideo/endpoints.go index 8e203cc0915..04994a1ef9c 100644 --- a/service/kinesisvideo/endpoints.go +++ b/service/kinesisvideo/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://kinesisvideo-fips.") diff --git a/service/kinesisvideo/types/types.go b/service/kinesisvideo/types/types.go index 7a9475a5786..4686c2bcd0f 100644 --- a/service/kinesisvideo/types/types.go +++ b/service/kinesisvideo/types/types.go @@ -318,6 +318,11 @@ type MediaSourceConfig struct { // A structure that encapsulates, or contains, the media storage configuration // properties. +// - If StorageStatus is enabled, the data will be stored in the StreamARN +// provided. In order for WebRTC Ingestion to work, the stream must have data +// retention enabled. +// - If StorageStatus is disabled, no data will be stored, and the StreamARN +// parameter will not be needed. type MediaStorageConfiguration struct { // The status of the media storage configuration. @@ -325,7 +330,7 @@ type MediaStorageConfiguration struct { // This member is required. Status MediaStorageConfigurationStatus - // The Amazon Resource Name (ARN) of the stream + // The Amazon Resource Name (ARN) of the stream. StreamARN *string noSmithyDocumentSerde diff --git a/service/location/api_op_SearchPlaceIndexForPosition.go b/service/location/api_op_SearchPlaceIndexForPosition.go index f7fb1bc8fb5..0bc922532d1 100644 --- a/service/location/api_op_SearchPlaceIndexForPosition.go +++ b/service/location/api_op_SearchPlaceIndexForPosition.go @@ -64,7 +64,7 @@ type SearchPlaceIndexForPositionInput struct { // An optional parameter. The maximum number of results returned per request. // Default value: 50 - MaxResults int32 + MaxResults *int32 noSmithyDocumentSerde } diff --git a/service/location/api_op_SearchPlaceIndexForText.go b/service/location/api_op_SearchPlaceIndexForText.go index 9b125ebdd86..988d9cbaa9d 100644 --- a/service/location/api_op_SearchPlaceIndexForText.go +++ b/service/location/api_op_SearchPlaceIndexForText.go @@ -101,7 +101,7 @@ type SearchPlaceIndexForTextInput struct { // An optional parameter. The maximum number of results returned per request. The // default: 50 - MaxResults int32 + MaxResults *int32 noSmithyDocumentSerde } diff --git a/service/location/deserializers.go b/service/location/deserializers.go index 4ffcc10ed03..a4b8dde6664 100644 --- a/service/location/deserializers.go +++ b/service/location/deserializers.go @@ -13878,7 +13878,7 @@ func awsRestjson1_deserializeDocumentSearchPlaceIndexForPositionSummary(v **type if err != nil { return err } - sv.MaxResults = int32(i64) + sv.MaxResults = ptr.Int32(int32(i64)) } case "Position": @@ -14056,7 +14056,7 @@ func awsRestjson1_deserializeDocumentSearchPlaceIndexForTextSummary(v **types.Se if err != nil { return err } - sv.MaxResults = int32(i64) + sv.MaxResults = ptr.Int32(int32(i64)) } case "ResultBBox": diff --git a/service/location/endpoints.go b/service/location/endpoints.go index a4ece0f63df..84c111e236b 100644 --- a/service/location/endpoints.go +++ b/service/location/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://geo-fips.") diff --git a/service/location/serializers.go b/service/location/serializers.go index 4f61581c97b..08969223ff8 100644 --- a/service/location/serializers.go +++ b/service/location/serializers.go @@ -4108,9 +4108,9 @@ func awsRestjson1_serializeOpDocumentSearchPlaceIndexForPositionInput(v *SearchP ok.String(*v.Language) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.Position != nil { @@ -4370,9 +4370,9 @@ func awsRestjson1_serializeOpDocumentSearchPlaceIndexForTextInput(v *SearchPlace ok.String(*v.Language) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.Text != nil { diff --git a/service/location/types/types.go b/service/location/types/types.go index d4409e1b518..e3873ab1f88 100644 --- a/service/location/types/types.go +++ b/service/location/types/types.go @@ -1266,7 +1266,7 @@ type SearchPlaceIndexForPositionSummary struct { // Contains the optional result count limit that is specified in the request. // Default value: 50 - MaxResults int32 + MaxResults *int32 noSmithyDocumentSerde } @@ -1360,7 +1360,7 @@ type SearchPlaceIndexForTextSummary struct { Language *string // Contains the optional result count limit specified in the request. - MaxResults int32 + MaxResults *int32 // The bounding box that fully contains all search results. If you specified the // optional FilterBBox parameter in the request, ResultBBox is contained within diff --git a/service/medialive/api_op_DescribeAccountConfiguration.go b/service/medialive/api_op_DescribeAccountConfiguration.go index 01cce5da330..761b9ca3fe6 100644 --- a/service/medialive/api_op_DescribeAccountConfiguration.go +++ b/service/medialive/api_op_DescribeAccountConfiguration.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Get account configuration +// Describe account configuration func (c *Client) DescribeAccountConfiguration(ctx context.Context, params *DescribeAccountConfigurationInput, optFns ...func(*Options)) (*DescribeAccountConfigurationOutput, error) { if params == nil { params = &DescribeAccountConfigurationInput{} diff --git a/service/medialive/api_op_StartInputDevice.go b/service/medialive/api_op_StartInputDevice.go index c62410ebd7c..d7e589ba459 100644 --- a/service/medialive/api_op_StartInputDevice.go +++ b/service/medialive/api_op_StartInputDevice.go @@ -32,7 +32,7 @@ func (c *Client) StartInputDevice(ctx context.Context, params *StartInputDeviceI // Placeholder documentation for StartInputDeviceRequest type StartInputDeviceInput struct { - // The unique ID of the input device to reboot. For example, hd-123456789abcdef. + // The unique ID of the input device to start. For example, hd-123456789abcdef. // // This member is required. InputDeviceId *string diff --git a/service/medialive/api_op_StopInputDevice.go b/service/medialive/api_op_StopInputDevice.go index b5656d1b7b6..a32924a5004 100644 --- a/service/medialive/api_op_StopInputDevice.go +++ b/service/medialive/api_op_StopInputDevice.go @@ -32,7 +32,7 @@ func (c *Client) StopInputDevice(ctx context.Context, params *StopInputDeviceInp // Placeholder documentation for StopInputDeviceRequest type StopInputDeviceInput struct { - // The unique ID of the input device to reboot. For example, hd-123456789abcdef. + // The unique ID of the input device to stop. For example, hd-123456789abcdef. // // This member is required. InputDeviceId *string diff --git a/service/medialive/deserializers.go b/service/medialive/deserializers.go index 43b4161e751..2d4b2492175 100644 --- a/service/medialive/deserializers.go +++ b/service/medialive/deserializers.go @@ -18320,6 +18320,15 @@ func awsRestjson1_deserializeDocumentFeatureActivations(v **types.FeatureActivat sv.InputPrepareScheduleActions = types.FeatureActivationsInputPrepareScheduleActions(jtv) } + case "outputStaticImageOverlayScheduleActions": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeatureActivationsOutputStaticImageOverlayScheduleActions to be of type string, got %T instead", value) + } + sv.OutputStaticImageOverlayScheduleActions = types.FeatureActivationsOutputStaticImageOverlayScheduleActions(jtv) + } + default: _, _ = key, value @@ -28095,6 +28104,16 @@ func awsRestjson1_deserializeDocumentScheduleActionSettings(v **types.ScheduleAc return err } + case "staticImageOutputActivateSettings": + if err := awsRestjson1_deserializeDocumentStaticImageOutputActivateScheduleActionSettings(&sv.StaticImageOutputActivateSettings, value); err != nil { + return err + } + + case "staticImageOutputDeactivateSettings": + if err := awsRestjson1_deserializeDocumentStaticImageOutputDeactivateScheduleActionSettings(&sv.StaticImageOutputDeactivateSettings, value); err != nil { + return err + } + default: _, _ = key, value @@ -29251,6 +29270,226 @@ func awsRestjson1_deserializeDocumentStaticImageDeactivateScheduleActionSettings return nil } +func awsRestjson1_deserializeDocumentStaticImageOutputActivateScheduleActionSettings(v **types.StaticImageOutputActivateScheduleActionSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.StaticImageOutputActivateScheduleActionSettings + if *v == nil { + sv = &types.StaticImageOutputActivateScheduleActionSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = ptr.Int32(int32(i64)) + } + + case "fadeIn": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FadeIn = ptr.Int32(int32(i64)) + } + + case "fadeOut": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FadeOut = ptr.Int32(int32(i64)) + } + + case "height": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin1 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Height = ptr.Int32(int32(i64)) + } + + case "image": + if err := awsRestjson1_deserializeDocumentInputLocation(&sv.Image, value); err != nil { + return err + } + + case "imageX": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ImageX = ptr.Int32(int32(i64)) + } + + case "imageY": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ImageY = ptr.Int32(int32(i64)) + } + + case "layer": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0Max7 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Layer = ptr.Int32(int32(i64)) + } + + case "opacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0Max100 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Opacity = ptr.Int32(int32(i64)) + } + + case "outputNames": + if err := awsRestjson1_deserializeDocument__listOf__string(&sv.OutputNames, value); err != nil { + return err + } + + case "width": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin1 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Width = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStaticImageOutputDeactivateScheduleActionSettings(v **types.StaticImageOutputDeactivateScheduleActionSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.StaticImageOutputDeactivateScheduleActionSettings + if *v == nil { + sv = &types.StaticImageOutputDeactivateScheduleActionSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fadeOut": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FadeOut = ptr.Int32(int32(i64)) + } + + case "layer": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin0Max7 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Layer = ptr.Int32(int32(i64)) + } + + case "outputNames": + if err := awsRestjson1_deserializeDocument__listOf__string(&sv.OutputNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentStaticKeySettings(v **types.StaticKeySettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/medialive/serializers.go b/service/medialive/serializers.go index 70cb0ec9bba..600d1613349 100644 --- a/service/medialive/serializers.go +++ b/service/medialive/serializers.go @@ -7466,6 +7466,11 @@ func awsRestjson1_serializeDocumentFeatureActivations(v *types.FeatureActivation ok.String(string(v.InputPrepareScheduleActions)) } + if len(v.OutputStaticImageOverlayScheduleActions) > 0 { + ok := object.Key("outputStaticImageOverlayScheduleActions") + ok.String(string(v.OutputStaticImageOverlayScheduleActions)) + } + return nil } @@ -10929,6 +10934,20 @@ func awsRestjson1_serializeDocumentScheduleActionSettings(v *types.ScheduleActio } } + if v.StaticImageOutputActivateSettings != nil { + ok := object.Key("staticImageOutputActivateSettings") + if err := awsRestjson1_serializeDocumentStaticImageOutputActivateScheduleActionSettings(v.StaticImageOutputActivateSettings, ok); err != nil { + return err + } + } + + if v.StaticImageOutputDeactivateSettings != nil { + ok := object.Key("staticImageOutputDeactivateSettings") + if err := awsRestjson1_serializeDocumentStaticImageOutputDeactivateScheduleActionSettings(v.StaticImageOutputDeactivateSettings, ok); err != nil { + return err + } + } + return nil } @@ -11345,6 +11364,96 @@ func awsRestjson1_serializeDocumentStaticImageDeactivateScheduleActionSettings(v return nil } +func awsRestjson1_serializeDocumentStaticImageOutputActivateScheduleActionSettings(v *types.StaticImageOutputActivateScheduleActionSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Duration != nil { + ok := object.Key("duration") + ok.Integer(*v.Duration) + } + + if v.FadeIn != nil { + ok := object.Key("fadeIn") + ok.Integer(*v.FadeIn) + } + + if v.FadeOut != nil { + ok := object.Key("fadeOut") + ok.Integer(*v.FadeOut) + } + + if v.Height != nil { + ok := object.Key("height") + ok.Integer(*v.Height) + } + + if v.Image != nil { + ok := object.Key("image") + if err := awsRestjson1_serializeDocumentInputLocation(v.Image, ok); err != nil { + return err + } + } + + if v.ImageX != nil { + ok := object.Key("imageX") + ok.Integer(*v.ImageX) + } + + if v.ImageY != nil { + ok := object.Key("imageY") + ok.Integer(*v.ImageY) + } + + if v.Layer != nil { + ok := object.Key("layer") + ok.Integer(*v.Layer) + } + + if v.Opacity != nil { + ok := object.Key("opacity") + ok.Integer(*v.Opacity) + } + + if v.OutputNames != nil { + ok := object.Key("outputNames") + if err := awsRestjson1_serializeDocument__listOf__string(v.OutputNames, ok); err != nil { + return err + } + } + + if v.Width != nil { + ok := object.Key("width") + ok.Integer(*v.Width) + } + + return nil +} + +func awsRestjson1_serializeDocumentStaticImageOutputDeactivateScheduleActionSettings(v *types.StaticImageOutputDeactivateScheduleActionSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FadeOut != nil { + ok := object.Key("fadeOut") + ok.Integer(*v.FadeOut) + } + + if v.Layer != nil { + ok := object.Key("layer") + ok.Integer(*v.Layer) + } + + if v.OutputNames != nil { + ok := object.Key("outputNames") + if err := awsRestjson1_serializeDocument__listOf__string(v.OutputNames, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentStaticKeySettings(v *types.StaticKeySettings, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/medialive/types/enums.go b/service/medialive/types/enums.go index 0f740bd127f..825c196728f 100644 --- a/service/medialive/types/enums.go +++ b/service/medialive/types/enums.go @@ -1467,6 +1467,25 @@ func (FeatureActivationsInputPrepareScheduleActions) Values() []FeatureActivatio } } +type FeatureActivationsOutputStaticImageOverlayScheduleActions string + +// Enum values for FeatureActivationsOutputStaticImageOverlayScheduleActions +const ( + FeatureActivationsOutputStaticImageOverlayScheduleActionsDisabled FeatureActivationsOutputStaticImageOverlayScheduleActions = "DISABLED" + FeatureActivationsOutputStaticImageOverlayScheduleActionsEnabled FeatureActivationsOutputStaticImageOverlayScheduleActions = "ENABLED" +) + +// Values returns all known values for +// FeatureActivationsOutputStaticImageOverlayScheduleActions. 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 (FeatureActivationsOutputStaticImageOverlayScheduleActions) Values() []FeatureActivationsOutputStaticImageOverlayScheduleActions { + return []FeatureActivationsOutputStaticImageOverlayScheduleActions{ + "DISABLED", + "ENABLED", + } +} + type FecOutputIncludeFec string // Enum values for FecOutputIncludeFec diff --git a/service/medialive/types/types.go b/service/medialive/types/types.go index 9e320f6d822..7f21e670583 100644 --- a/service/medialive/types/types.go +++ b/service/medialive/types/types.go @@ -1626,6 +1626,11 @@ type FeatureActivations struct { // from the schedule. InputPrepareScheduleActions FeatureActivationsInputPrepareScheduleActions + // Enables the output static image overlay feature. Enabling this feature allows + // you to send channel schedule updates to display/clear/modify image overlays on + // an output-by-output bases. + OutputStaticImageOverlayScheduleActions FeatureActivationsOutputStaticImageOverlayScheduleActions + noSmithyDocumentSerde } @@ -5072,6 +5077,12 @@ type ScheduleActionSettings struct { // Action to deactivate a static image overlay StaticImageDeactivateSettings *StaticImageDeactivateScheduleActionSettings + // Action to activate a static image overlay in one or more specified outputs + StaticImageOutputActivateSettings *StaticImageOutputActivateScheduleActionSettings + + // Action to deactivate a static image overlay in one or more specified outputs + StaticImageOutputDeactivateSettings *StaticImageOutputDeactivateScheduleActionSettings + noSmithyDocumentSerde } @@ -5446,6 +5457,86 @@ type StaticImageDeactivateScheduleActionSettings struct { noSmithyDocumentSerde } +// Settings for the action to activate a static image. +type StaticImageOutputActivateScheduleActionSettings struct { + + // The location and filename of the image file to overlay on the video. The file + // must be a 32-bit BMP, PNG, or TGA file, and must not be larger (in pixels) than + // the input video. + // + // This member is required. + Image *InputLocation + + // The name(s) of the output(s) the activation should apply to. + // + // This member is required. + OutputNames []string + + // The duration in milliseconds for the image to remain on the video. If omitted + // or set to 0 the duration is unlimited and the image will remain until it is + // explicitly deactivated. + Duration *int32 + + // The time in milliseconds for the image to fade in. The fade-in starts at the + // start time of the overlay. Default is 0 (no fade-in). + FadeIn *int32 + + // Applies only if a duration is specified. The time in milliseconds for the image + // to fade out. The fade-out starts when the duration time is hit, so it + // effectively extends the duration. Default is 0 (no fade-out). + FadeOut *int32 + + // The height of the image when inserted into the video, in pixels. The overlay + // will be scaled up or down to the specified height. Leave blank to use the native + // height of the overlay. + Height *int32 + + // Placement of the left edge of the overlay relative to the left edge of the + // video frame, in pixels. 0 (the default) is the left edge of the frame. If the + // placement causes the overlay to extend beyond the right edge of the underlying + // video, then the overlay is cropped on the right. + ImageX *int32 + + // Placement of the top edge of the overlay relative to the top edge of the video + // frame, in pixels. 0 (the default) is the top edge of the frame. If the placement + // causes the overlay to extend beyond the bottom edge of the underlying video, + // then the overlay is cropped on the bottom. + ImageY *int32 + + // The number of the layer, 0 to 7. There are 8 layers that can be overlaid on the + // video, each layer with a different image. The layers are in Z order, which means + // that overlays with higher values of layer are inserted on top of overlays with + // lower values of layer. Default is 0. + Layer *int32 + + // Opacity of image where 0 is transparent and 100 is fully opaque. Default is 100. + Opacity *int32 + + // The width of the image when inserted into the video, in pixels. The overlay + // will be scaled up or down to the specified width. Leave blank to use the native + // width of the overlay. + Width *int32 + + noSmithyDocumentSerde +} + +// Settings for the action to deactivate the image in a specific layer. +type StaticImageOutputDeactivateScheduleActionSettings struct { + + // The name(s) of the output(s) the deactivation should apply to. + // + // This member is required. + OutputNames []string + + // The time in milliseconds for the image to fade out. Default is 0 (no fade-out). + FadeOut *int32 + + // The image overlay layer to deactivate, 0 to 7. Default is 0. + Layer *int32 + + noSmithyDocumentSerde +} + // Static Key Settings type StaticKeySettings struct { @@ -5533,7 +5624,9 @@ type Thumbnail struct { // Thumbnail Configuration type ThumbnailConfiguration struct { - // Whether Thumbnail is enabled. + // Enables the thumbnail feature. The feature generates thumbnails of the incoming + // video in each pipeline in the channel. AUTO turns the feature on, DISABLE turns + // the feature off. // // This member is required. State ThumbnailState diff --git a/service/medialive/validators.go b/service/medialive/validators.go index 719359fdf15..f88269b8b4c 100644 --- a/service/medialive/validators.go +++ b/service/medialive/validators.go @@ -3081,6 +3081,16 @@ func validateScheduleActionSettings(v *types.ScheduleActionSettings) error { invalidParams.AddNested("StaticImageActivateSettings", err.(smithy.InvalidParamsError)) } } + if v.StaticImageOutputActivateSettings != nil { + if err := validateStaticImageOutputActivateScheduleActionSettings(v.StaticImageOutputActivateSettings); err != nil { + invalidParams.AddNested("StaticImageOutputActivateSettings", err.(smithy.InvalidParamsError)) + } + } + if v.StaticImageOutputDeactivateSettings != nil { + if err := validateStaticImageOutputDeactivateScheduleActionSettings(v.StaticImageOutputDeactivateSettings); err != nil { + invalidParams.AddNested("StaticImageOutputDeactivateSettings", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3293,6 +3303,43 @@ func validateStaticImageActivateScheduleActionSettings(v *types.StaticImageActiv } } +func validateStaticImageOutputActivateScheduleActionSettings(v *types.StaticImageOutputActivateScheduleActionSettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StaticImageOutputActivateScheduleActionSettings"} + if v.Image == nil { + invalidParams.Add(smithy.NewErrParamRequired("Image")) + } else if v.Image != nil { + if err := validateInputLocation(v.Image); err != nil { + invalidParams.AddNested("Image", err.(smithy.InvalidParamsError)) + } + } + if v.OutputNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutputNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStaticImageOutputDeactivateScheduleActionSettings(v *types.StaticImageOutputDeactivateScheduleActionSettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StaticImageOutputDeactivateScheduleActionSettings"} + if v.OutputNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutputNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStaticKeySettings(v *types.StaticKeySettings) error { if v == nil { return nil diff --git a/service/mgn/api_op_DescribeJobLogItems.go b/service/mgn/api_op_DescribeJobLogItems.go index f0337c3e361..724220ba9c0 100644 --- a/service/mgn/api_op_DescribeJobLogItems.go +++ b/service/mgn/api_op_DescribeJobLogItems.go @@ -39,7 +39,7 @@ type DescribeJobLogItemsInput struct { AccountID *string // Request to describe Job log item maximum results. - MaxResults int32 + MaxResults *int32 // Request to describe Job log next token. NextToken *string @@ -175,8 +175,8 @@ func NewDescribeJobLogItemsPaginator(client DescribeJobLogItemsAPIClient, params } options := DescribeJobLogItemsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -206,7 +206,11 @@ func (p *DescribeJobLogItemsPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeJobLogItems(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_DescribeJobs.go b/service/mgn/api_op_DescribeJobs.go index 42edd96b44e..408484bf417 100644 --- a/service/mgn/api_op_DescribeJobs.go +++ b/service/mgn/api_op_DescribeJobs.go @@ -42,7 +42,7 @@ type DescribeJobsInput struct { Filters *types.DescribeJobsRequestFilters // Request to describe job log items by max results. - MaxResults int32 + MaxResults *int32 // Request to describe job log items by next token. NextToken *string @@ -173,8 +173,8 @@ func NewDescribeJobsPaginator(client DescribeJobsAPIClient, params *DescribeJobs } options := DescribeJobsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -204,7 +204,11 @@ func (p *DescribeJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Op params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeJobs(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_DescribeLaunchConfigurationTemplates.go b/service/mgn/api_op_DescribeLaunchConfigurationTemplates.go index 61529c546b8..b149081e077 100644 --- a/service/mgn/api_op_DescribeLaunchConfigurationTemplates.go +++ b/service/mgn/api_op_DescribeLaunchConfigurationTemplates.go @@ -36,7 +36,7 @@ type DescribeLaunchConfigurationTemplatesInput struct { LaunchConfigurationTemplateIDs []string // Maximum results to be returned in DescribeLaunchConfigurationTemplates. - MaxResults int32 + MaxResults *int32 // Next pagination token returned from DescribeLaunchConfigurationTemplates. NextToken *string @@ -171,8 +171,8 @@ func NewDescribeLaunchConfigurationTemplatesPaginator(client DescribeLaunchConfi } options := DescribeLaunchConfigurationTemplatesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -202,7 +202,11 @@ func (p *DescribeLaunchConfigurationTemplatesPaginator) NextPage(ctx context.Con params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeLaunchConfigurationTemplates(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_DescribeReplicationConfigurationTemplates.go b/service/mgn/api_op_DescribeReplicationConfigurationTemplates.go index 887e9797b06..b34b843c2bd 100644 --- a/service/mgn/api_op_DescribeReplicationConfigurationTemplates.go +++ b/service/mgn/api_op_DescribeReplicationConfigurationTemplates.go @@ -31,7 +31,7 @@ func (c *Client) DescribeReplicationConfigurationTemplates(ctx context.Context, type DescribeReplicationConfigurationTemplatesInput struct { // Request to describe Replication Configuration template by max results. - MaxResults int32 + MaxResults *int32 // Request to describe Replication Configuration template by next token. NextToken *string @@ -169,8 +169,8 @@ func NewDescribeReplicationConfigurationTemplatesPaginator(client DescribeReplic } options := DescribeReplicationConfigurationTemplatesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -200,7 +200,11 @@ func (p *DescribeReplicationConfigurationTemplatesPaginator) NextPage(ctx contex params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeReplicationConfigurationTemplates(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_DescribeSourceServers.go b/service/mgn/api_op_DescribeSourceServers.go index d656719e06b..27656165cab 100644 --- a/service/mgn/api_op_DescribeSourceServers.go +++ b/service/mgn/api_op_DescribeSourceServers.go @@ -37,7 +37,7 @@ type DescribeSourceServersInput struct { Filters *types.DescribeSourceServersRequestFilters // Request to filter Source Servers list by maximum results. - MaxResults int32 + MaxResults *int32 // Request to filter Source Servers list by next token. NextToken *string @@ -170,8 +170,8 @@ func NewDescribeSourceServersPaginator(client DescribeSourceServersAPIClient, pa } options := DescribeSourceServersPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -201,7 +201,11 @@ func (p *DescribeSourceServersPaginator) NextPage(ctx context.Context, optFns .. params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeSourceServers(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_DescribeVcenterClients.go b/service/mgn/api_op_DescribeVcenterClients.go index a4bbd8d898f..570844d699a 100644 --- a/service/mgn/api_op_DescribeVcenterClients.go +++ b/service/mgn/api_op_DescribeVcenterClients.go @@ -31,7 +31,7 @@ func (c *Client) DescribeVcenterClients(ctx context.Context, params *DescribeVce type DescribeVcenterClientsInput struct { // Maximum results to be returned in DescribeVcenterClients. - MaxResults int32 + MaxResults *int32 // Next pagination token to be provided for DescribeVcenterClients. NextToken *string @@ -164,8 +164,8 @@ func NewDescribeVcenterClientsPaginator(client DescribeVcenterClientsAPIClient, } options := DescribeVcenterClientsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -195,7 +195,11 @@ func (p *DescribeVcenterClientsPaginator) NextPage(ctx context.Context, optFns . params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeVcenterClients(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListApplications.go b/service/mgn/api_op_ListApplications.go index a1359c4ded2..d140fee559b 100644 --- a/service/mgn/api_op_ListApplications.go +++ b/service/mgn/api_op_ListApplications.go @@ -37,7 +37,7 @@ type ListApplicationsInput struct { Filters *types.ListApplicationsRequestFilters // Maximum results to return when listing applications. - MaxResults int32 + MaxResults *int32 // Request next token. NextToken *string @@ -169,8 +169,8 @@ func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *List } options := ListApplicationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -200,7 +200,11 @@ func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListApplications(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListConnectors.go b/service/mgn/api_op_ListConnectors.go index eedb6caab32..0fee43ebee1 100644 --- a/service/mgn/api_op_ListConnectors.go +++ b/service/mgn/api_op_ListConnectors.go @@ -34,7 +34,7 @@ type ListConnectorsInput struct { Filters *types.ListConnectorsRequestFilters // List Connectors Request max results. - MaxResults int32 + MaxResults *int32 // List Connectors Request next token. NextToken *string @@ -166,8 +166,8 @@ func NewListConnectorsPaginator(client ListConnectorsAPIClient, params *ListConn } options := ListConnectorsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -197,7 +197,11 @@ func (p *ListConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(* params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListConnectors(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListExportErrors.go b/service/mgn/api_op_ListExportErrors.go index 26ea02f2200..c70f0025397 100644 --- a/service/mgn/api_op_ListExportErrors.go +++ b/service/mgn/api_op_ListExportErrors.go @@ -37,7 +37,7 @@ type ListExportErrorsInput struct { ExportID *string // List export errors request max results. - MaxResults int32 + MaxResults *int32 // List export errors request next token. NextToken *string @@ -173,8 +173,8 @@ func NewListExportErrorsPaginator(client ListExportErrorsAPIClient, params *List } options := ListExportErrorsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -204,7 +204,11 @@ func (p *ListExportErrorsPaginator) NextPage(ctx context.Context, optFns ...func params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListExportErrors(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListExports.go b/service/mgn/api_op_ListExports.go index 8ab16e7033d..5c82d76a23e 100644 --- a/service/mgn/api_op_ListExports.go +++ b/service/mgn/api_op_ListExports.go @@ -35,7 +35,7 @@ type ListExportsInput struct { Filters *types.ListExportsRequestFilters // List export request max results. - MaxResults int32 + MaxResults *int32 // List export request next token. NextToken *string @@ -167,8 +167,8 @@ func NewListExportsPaginator(client ListExportsAPIClient, params *ListExportsInp } options := ListExportsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -198,7 +198,11 @@ func (p *ListExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Opt params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListExports(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListImportErrors.go b/service/mgn/api_op_ListImportErrors.go index 6c710115da1..1001dcb6b90 100644 --- a/service/mgn/api_op_ListImportErrors.go +++ b/service/mgn/api_op_ListImportErrors.go @@ -37,7 +37,7 @@ type ListImportErrorsInput struct { ImportID *string // List import errors request max results. - MaxResults int32 + MaxResults *int32 // List import errors request next token. NextToken *string @@ -173,8 +173,8 @@ func NewListImportErrorsPaginator(client ListImportErrorsAPIClient, params *List } options := ListImportErrorsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -204,7 +204,11 @@ func (p *ListImportErrorsPaginator) NextPage(ctx context.Context, optFns ...func params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListImportErrors(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListImports.go b/service/mgn/api_op_ListImports.go index 48620a8865e..e2aaa043ad5 100644 --- a/service/mgn/api_op_ListImports.go +++ b/service/mgn/api_op_ListImports.go @@ -35,7 +35,7 @@ type ListImportsInput struct { Filters *types.ListImportsRequestFilters // List imports request max results. - MaxResults int32 + MaxResults *int32 // List imports request next token. NextToken *string @@ -167,8 +167,8 @@ func NewListImportsPaginator(client ListImportsAPIClient, params *ListImportsInp } options := ListImportsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -198,7 +198,11 @@ func (p *ListImportsPaginator) NextPage(ctx context.Context, optFns ...func(*Opt params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListImports(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListManagedAccounts.go b/service/mgn/api_op_ListManagedAccounts.go index 2fe1bcd1776..ae284e94eb4 100644 --- a/service/mgn/api_op_ListManagedAccounts.go +++ b/service/mgn/api_op_ListManagedAccounts.go @@ -32,7 +32,7 @@ func (c *Client) ListManagedAccounts(ctx context.Context, params *ListManagedAcc type ListManagedAccountsInput struct { // List managed accounts request max results. - MaxResults int32 + MaxResults *int32 // List managed accounts request next token. NextToken *string @@ -168,8 +168,8 @@ func NewListManagedAccountsPaginator(client ListManagedAccountsAPIClient, params } options := ListManagedAccountsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -199,7 +199,11 @@ func (p *ListManagedAccountsPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListManagedAccounts(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListSourceServerActions.go b/service/mgn/api_op_ListSourceServerActions.go index 834ede884d2..42ddb3ad461 100644 --- a/service/mgn/api_op_ListSourceServerActions.go +++ b/service/mgn/api_op_ListSourceServerActions.go @@ -43,7 +43,7 @@ type ListSourceServerActionsInput struct { // Maximum amount of items to return when listing source server post migration // custom actions. - MaxResults int32 + MaxResults *int32 // Next token to use when listing source server post migration custom actions. NextToken *string @@ -181,8 +181,8 @@ func NewListSourceServerActionsPaginator(client ListSourceServerActionsAPIClient } options := ListSourceServerActionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -212,7 +212,11 @@ func (p *ListSourceServerActionsPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListSourceServerActions(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListTemplateActions.go b/service/mgn/api_op_ListTemplateActions.go index 15f5e730dd4..b728f8bfd35 100644 --- a/service/mgn/api_op_ListTemplateActions.go +++ b/service/mgn/api_op_ListTemplateActions.go @@ -40,7 +40,7 @@ type ListTemplateActionsInput struct { // Maximum amount of items to return when listing template post migration custom // actions. - MaxResults int32 + MaxResults *int32 // Next token to use when listing template post migration custom actions. NextToken *string @@ -177,8 +177,8 @@ func NewListTemplateActionsPaginator(client ListTemplateActionsAPIClient, params } options := ListTemplateActionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -208,7 +208,11 @@ func (p *ListTemplateActionsPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListTemplateActions(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_ListWaves.go b/service/mgn/api_op_ListWaves.go index 894d5b95c36..bd2f780b8c9 100644 --- a/service/mgn/api_op_ListWaves.go +++ b/service/mgn/api_op_ListWaves.go @@ -37,7 +37,7 @@ type ListWavesInput struct { Filters *types.ListWavesRequestFilters // Maximum results to return when listing waves. - MaxResults int32 + MaxResults *int32 // Request next token. NextToken *string @@ -168,8 +168,8 @@ func NewListWavesPaginator(client ListWavesAPIClient, params *ListWavesInput, op } options := ListWavesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -199,7 +199,11 @@ func (p *ListWavesPaginator) NextPage(ctx context.Context, optFns ...func(*Optio params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListWaves(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/mgn/api_op_PutSourceServerAction.go b/service/mgn/api_op_PutSourceServerAction.go index 0819d0504aa..c9152da47a8 100644 --- a/service/mgn/api_op_PutSourceServerAction.go +++ b/service/mgn/api_op_PutSourceServerAction.go @@ -48,7 +48,7 @@ type PutSourceServerActionInput struct { // Source server post migration custom action order. // // This member is required. - Order int32 + Order *int32 // Source server ID. // @@ -80,7 +80,7 @@ type PutSourceServerActionInput struct { Parameters map[string][]types.SsmParameterStoreParameter // Source server post migration custom action timeout in seconds. - TimeoutSeconds int32 + TimeoutSeconds *int32 noSmithyDocumentSerde } @@ -115,13 +115,13 @@ type PutSourceServerActionOutput struct { MustSucceedForCutover *bool // Source server post migration custom action order. - Order int32 + Order *int32 // Source server post migration custom action parameters. Parameters map[string][]types.SsmParameterStoreParameter // Source server post migration custom action timeout in seconds. - TimeoutSeconds int32 + TimeoutSeconds *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/mgn/api_op_PutTemplateAction.go b/service/mgn/api_op_PutTemplateAction.go index 53240fab046..cfe38e1eee4 100644 --- a/service/mgn/api_op_PutTemplateAction.go +++ b/service/mgn/api_op_PutTemplateAction.go @@ -53,7 +53,7 @@ type PutTemplateActionInput struct { // Template post migration custom action order. // // This member is required. - Order int32 + Order *int32 // Template post migration custom action active status. Active *bool @@ -80,7 +80,7 @@ type PutTemplateActionInput struct { Parameters map[string][]types.SsmParameterStoreParameter // Template post migration custom action timeout in seconds. - TimeoutSeconds int32 + TimeoutSeconds *int32 noSmithyDocumentSerde } @@ -118,13 +118,13 @@ type PutTemplateActionOutput struct { OperatingSystem *string // Template post migration custom action order. - Order int32 + Order *int32 // Template post migration custom action parameters. Parameters map[string][]types.SsmParameterStoreParameter // Template post migration custom action timeout in seconds. - TimeoutSeconds int32 + TimeoutSeconds *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/mgn/deserializers.go b/service/mgn/deserializers.go index f0808b32e50..d4a8f0e0c04 100644 --- a/service/mgn/deserializers.go +++ b/service/mgn/deserializers.go @@ -7581,7 +7581,7 @@ func awsRestjson1_deserializeOpDocumentPutSourceServerActionOutput(v **PutSource if err != nil { return err } - sv.Order = int32(i64) + sv.Order = ptr.Int32(int32(i64)) } case "parameters": @@ -7599,7 +7599,7 @@ func awsRestjson1_deserializeOpDocumentPutSourceServerActionOutput(v **PutSource if err != nil { return err } - sv.TimeoutSeconds = int32(i64) + sv.TimeoutSeconds = ptr.Int32(int32(i64)) } default: @@ -7849,7 +7849,7 @@ func awsRestjson1_deserializeOpDocumentPutTemplateActionOutput(v **PutTemplateAc if err != nil { return err } - sv.Order = int32(i64) + sv.Order = ptr.Int32(int32(i64)) } case "parameters": @@ -7867,7 +7867,7 @@ func awsRestjson1_deserializeOpDocumentPutTemplateActionOutput(v **PutTemplateAc if err != nil { return err } - sv.TimeoutSeconds = int32(i64) + sv.TimeoutSeconds = ptr.Int32(int32(i64)) } default: @@ -15999,7 +15999,7 @@ func awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(v **types.LaunchTemp if err != nil { return err } - sv.Iops = i64 + sv.Iops = ptr.Int64(i64) } case "throughput": @@ -16012,7 +16012,7 @@ func awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(v **types.LaunchTemp if err != nil { return err } - sv.Throughput = i64 + sv.Throughput = ptr.Int64(i64) } case "volumeType": @@ -17498,7 +17498,7 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser if err != nil { return err } - sv.QuotaValue = int32(i64) + sv.QuotaValue = ptr.Int32(int32(i64)) } case "resourceId": @@ -17866,7 +17866,7 @@ func awsRestjson1_deserializeDocumentSourceServerActionDocument(v **types.Source if err != nil { return err } - sv.Order = int32(i64) + sv.Order = ptr.Int32(int32(i64)) } case "parameters": @@ -17884,7 +17884,7 @@ func awsRestjson1_deserializeDocumentSourceServerActionDocument(v **types.Source if err != nil { return err } - sv.TimeoutSeconds = int32(i64) + sv.TimeoutSeconds = ptr.Int32(int32(i64)) } default: @@ -18082,7 +18082,7 @@ func awsRestjson1_deserializeDocumentSsmDocument(v **types.SsmDocument, value in if err != nil { return err } - sv.TimeoutSeconds = int32(i64) + sv.TimeoutSeconds = ptr.Int32(int32(i64)) } default: @@ -18475,7 +18475,7 @@ func awsRestjson1_deserializeDocumentTemplateActionDocument(v **types.TemplateAc if err != nil { return err } - sv.Order = int32(i64) + sv.Order = ptr.Int32(int32(i64)) } case "parameters": @@ -18493,7 +18493,7 @@ func awsRestjson1_deserializeDocumentTemplateActionDocument(v **types.TemplateAc if err != nil { return err } - sv.TimeoutSeconds = int32(i64) + sv.TimeoutSeconds = ptr.Int32(int32(i64)) } default: diff --git a/service/mgn/endpoints.go b/service/mgn/endpoints.go index 01dfd2d1e96..d2e114d35c5 100644 --- a/service/mgn/endpoints.go +++ b/service/mgn/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://mgn-fips.") diff --git a/service/mgn/serializers.go b/service/mgn/serializers.go index 20a484396fb..de36a512308 100644 --- a/service/mgn/serializers.go +++ b/service/mgn/serializers.go @@ -1706,9 +1706,9 @@ func awsRestjson1_serializeOpDocumentDescribeJobLogItemsInput(v *DescribeJobLogI ok.String(*v.JobID) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1798,9 +1798,9 @@ func awsRestjson1_serializeOpDocumentDescribeJobsInput(v *DescribeJobsInput, val } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1885,9 +1885,9 @@ func awsRestjson1_serializeOpDocumentDescribeLaunchConfigurationTemplatesInput(v } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1965,9 +1965,9 @@ func awsRestjson1_serializeOpDocumentDescribeReplicationConfigurationTemplatesIn object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2064,9 +2064,9 @@ func awsRestjson1_serializeOpDocumentDescribeSourceServersInput(v *DescribeSourc } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2130,8 +2130,8 @@ func awsRestjson1_serializeOpHttpBindingsDescribeVcenterClientsInput(v *Describe return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MaxResults != 0 { - encoder.SetQuery("maxResults").Integer(v.MaxResults) + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2766,9 +2766,9 @@ func awsRestjson1_serializeOpDocumentListApplicationsInput(v *ListApplicationsIn } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2853,9 +2853,9 @@ func awsRestjson1_serializeOpDocumentListConnectorsInput(v *ListConnectorsInput, } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -2938,9 +2938,9 @@ func awsRestjson1_serializeOpDocumentListExportErrorsInput(v *ListExportErrorsIn ok.String(*v.ExportID) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3025,9 +3025,9 @@ func awsRestjson1_serializeOpDocumentListExportsInput(v *ListExportsInput, value } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3110,9 +3110,9 @@ func awsRestjson1_serializeOpDocumentListImportErrorsInput(v *ListImportErrorsIn ok.String(*v.ImportID) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3197,9 +3197,9 @@ func awsRestjson1_serializeOpDocumentListImportsInput(v *ListImportsInput, value } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3277,9 +3277,9 @@ func awsRestjson1_serializeOpDocumentListManagedAccountsInput(v *ListManagedAcco object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3369,9 +3369,9 @@ func awsRestjson1_serializeOpDocumentListSourceServerActionsInput(v *ListSourceS } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3531,9 +3531,9 @@ func awsRestjson1_serializeOpDocumentListTemplateActionsInput(v *ListTemplateAct ok.String(*v.LaunchConfigurationTemplateID) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3623,9 +3623,9 @@ func awsRestjson1_serializeOpDocumentListWavesInput(v *ListWavesInput, value smi } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("maxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -3915,9 +3915,9 @@ func awsRestjson1_serializeOpDocumentPutSourceServerActionInput(v *PutSourceServ ok.Boolean(*v.MustSucceedForCutover) } - { + if v.Order != nil { ok := object.Key("order") - ok.Integer(v.Order) + ok.Integer(*v.Order) } if v.Parameters != nil { @@ -3932,9 +3932,9 @@ func awsRestjson1_serializeOpDocumentPutSourceServerActionInput(v *PutSourceServ ok.String(*v.SourceServerID) } - if v.TimeoutSeconds != 0 { + if v.TimeoutSeconds != nil { ok := object.Key("timeoutSeconds") - ok.Integer(v.TimeoutSeconds) + ok.Integer(*v.TimeoutSeconds) } return nil @@ -4064,9 +4064,9 @@ func awsRestjson1_serializeOpDocumentPutTemplateActionInput(v *PutTemplateAction ok.String(*v.OperatingSystem) } - { + if v.Order != nil { ok := object.Key("order") - ok.Integer(v.Order) + ok.Integer(*v.Order) } if v.Parameters != nil { @@ -4076,9 +4076,9 @@ func awsRestjson1_serializeOpDocumentPutTemplateActionInput(v *PutTemplateAction } } - if v.TimeoutSeconds != 0 { + if v.TimeoutSeconds != nil { ok := object.Key("timeoutSeconds") - ok.Integer(v.TimeoutSeconds) + ok.Integer(*v.TimeoutSeconds) } return nil @@ -6583,14 +6583,14 @@ func awsRestjson1_serializeDocumentLaunchTemplateDiskConf(v *types.LaunchTemplat object := value.Object() defer object.Close() - if v.Iops != 0 { + if v.Iops != nil { ok := object.Key("iops") - ok.Long(v.Iops) + ok.Long(*v.Iops) } - if v.Throughput != 0 { + if v.Throughput != nil { ok := object.Key("throughput") - ok.Long(v.Throughput) + ok.Long(*v.Throughput) } if len(v.VolumeType) > 0 { @@ -6920,9 +6920,9 @@ func awsRestjson1_serializeDocumentSsmDocument(v *types.SsmDocument, value smith ok.String(*v.SsmDocumentName) } - if v.TimeoutSeconds != 0 { + if v.TimeoutSeconds != nil { ok := object.Key("timeoutSeconds") - ok.Integer(v.TimeoutSeconds) + ok.Integer(*v.TimeoutSeconds) } return nil diff --git a/service/mgn/types/errors.go b/service/mgn/types/errors.go index 3341550b838..c9480e670d2 100644 --- a/service/mgn/types/errors.go +++ b/service/mgn/types/errors.go @@ -137,7 +137,7 @@ type ServiceQuotaExceededException struct { ResourceType *string ServiceCode *string QuotaCode *string - QuotaValue int32 + QuotaValue *int32 noSmithyDocumentSerde } diff --git a/service/mgn/types/types.go b/service/mgn/types/types.go index 4a2e8eba9dd..44f6bb7032a 100644 --- a/service/mgn/types/types.go +++ b/service/mgn/types/types.go @@ -657,10 +657,10 @@ type LaunchedInstance struct { type LaunchTemplateDiskConf struct { // Launch template disk iops configuration. - Iops int64 + Iops *int64 // Launch template disk throughput configuration. - Throughput int64 + Throughput *int64 // Launch template disk volume type configuration. VolumeType VolumeType @@ -1138,13 +1138,13 @@ type SourceServerActionDocument struct { MustSucceedForCutover *bool // Source server post migration custom action order. - Order int32 + Order *int32 // Source server post migration custom action parameters. Parameters map[string][]SsmParameterStoreParameter // Source server post migration custom action timeout in seconds. - TimeoutSeconds int32 + TimeoutSeconds *int32 noSmithyDocumentSerde } @@ -1193,7 +1193,7 @@ type SsmDocument struct { Parameters map[string][]SsmParameterStoreParameter // AWS Systems Manager Document timeout seconds. - TimeoutSeconds int32 + TimeoutSeconds *int32 noSmithyDocumentSerde } @@ -1265,13 +1265,13 @@ type TemplateActionDocument struct { OperatingSystem *string // Template post migration custom action order. - Order int32 + Order *int32 // Template post migration custom action parameters. Parameters map[string][]SsmParameterStoreParameter // Template post migration custom action timeout in seconds. - TimeoutSeconds int32 + TimeoutSeconds *int32 noSmithyDocumentSerde } diff --git a/service/mgn/validators.go b/service/mgn/validators.go index 3cdd5cbaca3..ab6971c2a75 100644 --- a/service/mgn/validators.go +++ b/service/mgn/validators.go @@ -2112,6 +2112,9 @@ func validateOpPutSourceServerActionInput(v *PutSourceServerActionInput) error { if v.DocumentIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentIdentifier")) } + if v.Order == nil { + invalidParams.Add(smithy.NewErrParamRequired("Order")) + } if v.ActionID == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionID")) } @@ -2141,6 +2144,9 @@ func validateOpPutTemplateActionInput(v *PutTemplateActionInput) error { if v.DocumentIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentIdentifier")) } + if v.Order == nil { + invalidParams.Add(smithy.NewErrParamRequired("Order")) + } if v.ActionID == nil { invalidParams.Add(smithy.NewErrParamRequired("ActionID")) } diff --git a/service/osis/api_op_CreatePipeline.go b/service/osis/api_op_CreatePipeline.go index 052f17a52a4..c0b91f0b536 100644 --- a/service/osis/api_op_CreatePipeline.go +++ b/service/osis/api_op_CreatePipeline.go @@ -56,6 +56,13 @@ type CreatePipelineInput struct { // This member is required. PipelineName *string + // Key-value pairs to configure persistent buffering for the pipeline. + BufferOptions *types.BufferOptions + + // Key-value pairs to configure encryption for data that is written to a + // persistent buffer. + EncryptionAtRestOptions *types.EncryptionAtRestOptions + // Key-value pairs to configure log publishing. LogPublishingOptions *types.LogPublishingOptions diff --git a/service/osis/api_op_UpdatePipeline.go b/service/osis/api_op_UpdatePipeline.go index 7bf72e4757e..a737513d769 100644 --- a/service/osis/api_op_UpdatePipeline.go +++ b/service/osis/api_op_UpdatePipeline.go @@ -37,6 +37,13 @@ type UpdatePipelineInput struct { // This member is required. PipelineName *string + // Key-value pairs to configure persistent buffering for the pipeline. + BufferOptions *types.BufferOptions + + // Key-value pairs to configure encryption for data that is written to a + // persistent buffer. + EncryptionAtRestOptions *types.EncryptionAtRestOptions + // Key-value pairs to configure log publishing. LogPublishingOptions *types.LogPublishingOptions diff --git a/service/osis/deserializers.go b/service/osis/deserializers.go index 72a03e70875..311242e4f19 100644 --- a/service/osis/deserializers.go +++ b/service/osis/deserializers.go @@ -129,6 +129,9 @@ func awsRestjson1_deserializeOpErrorCreatePipeline(response *smithyhttp.Response case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2372,6 +2375,46 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } +func awsRestjson1_deserializeDocumentBufferOptions(v **types.BufferOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BufferOptions + if *v == nil { + sv = &types.BufferOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PersistentBufferEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.PersistentBufferEnabled = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentChangeProgressStage(v **types.ChangeProgressStage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2668,6 +2711,46 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsRestjson1_deserializeDocumentEncryptionAtRestOptions(v **types.EncryptionAtRestOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EncryptionAtRestOptions + if *v == nil { + sv = &types.EncryptionAtRestOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentIngestEndpointUrlsList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2891,6 +2974,11 @@ func awsRestjson1_deserializeDocumentPipeline(v **types.Pipeline, value interfac for key, value := range shape { switch key { + case "BufferOptions": + if err := awsRestjson1_deserializeDocumentBufferOptions(&sv.BufferOptions, value); err != nil { + return err + } + case "CreatedAt": if value != nil { switch jtv := value.(type) { @@ -2907,6 +2995,11 @@ func awsRestjson1_deserializeDocumentPipeline(v **types.Pipeline, value interfac } } + case "EncryptionAtRestOptions": + if err := awsRestjson1_deserializeDocumentEncryptionAtRestOptions(&sv.EncryptionAtRestOptions, value); err != nil { + return err + } + case "IngestEndpointUrls": if err := awsRestjson1_deserializeDocumentIngestEndpointUrlsList(&sv.IngestEndpointUrls, value); err != nil { return err @@ -2986,6 +3079,11 @@ func awsRestjson1_deserializeDocumentPipeline(v **types.Pipeline, value interfac sv.PipelineName = ptr.String(jtv) } + case "ServiceVpcEndpoints": + if err := awsRestjson1_deserializeDocumentServiceVpcEndpointsList(&sv.ServiceVpcEndpoints, value); err != nil { + return err + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -3000,6 +3098,11 @@ func awsRestjson1_deserializeDocumentPipeline(v **types.Pipeline, value interfac return err } + case "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + case "VpcEndpoints": if err := awsRestjson1_deserializeDocumentVpcEndpointsList(&sv.VpcEndpoints, value); err != nil { return err @@ -3289,6 +3392,11 @@ func awsRestjson1_deserializeDocumentPipelineSummary(v **types.PipelineSummary, return err } + case "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + default: _, _ = key, value @@ -3448,6 +3556,89 @@ func awsRestjson1_deserializeDocumentSecurityGroupIds(v *[]string, value interfa return nil } +func awsRestjson1_deserializeDocumentServiceVpcEndpoint(v **types.ServiceVpcEndpoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServiceVpcEndpoint + if *v == nil { + sv = &types.ServiceVpcEndpoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ServiceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointServiceName to be of type string, got %T instead", value) + } + sv.ServiceName = types.VpcEndpointServiceName(jtv) + } + + case "VpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceVpcEndpointsList(v *[]types.ServiceVpcEndpoint, 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.ServiceVpcEndpoint + if *v == nil { + cv = []types.ServiceVpcEndpoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceVpcEndpoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentServiceVpcEndpoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentSubnetIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/osis/endpoints.go b/service/osis/endpoints.go index 623375710f2..9f21c59c17f 100644 --- a/service/osis/endpoints.go +++ b/service/osis/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://osis-fips.") diff --git a/service/osis/serializers.go b/service/osis/serializers.go index 1af4c42cb0e..1669ecc1b15 100644 --- a/service/osis/serializers.go +++ b/service/osis/serializers.go @@ -81,6 +81,20 @@ func awsRestjson1_serializeOpDocumentCreatePipelineInput(v *CreatePipelineInput, object := value.Object() defer object.Close() + if v.BufferOptions != nil { + ok := object.Key("BufferOptions") + if err := awsRestjson1_serializeDocumentBufferOptions(v.BufferOptions, ok); err != nil { + return err + } + } + + if v.EncryptionAtRestOptions != nil { + ok := object.Key("EncryptionAtRestOptions") + if err := awsRestjson1_serializeDocumentEncryptionAtRestOptions(v.EncryptionAtRestOptions, ok); err != nil { + return err + } + } + if v.LogPublishingOptions != nil { ok := object.Key("LogPublishingOptions") if err := awsRestjson1_serializeDocumentLogPublishingOptions(v.LogPublishingOptions, ok); err != nil { @@ -941,6 +955,20 @@ func awsRestjson1_serializeOpDocumentUpdatePipelineInput(v *UpdatePipelineInput, object := value.Object() defer object.Close() + if v.BufferOptions != nil { + ok := object.Key("BufferOptions") + if err := awsRestjson1_serializeDocumentBufferOptions(v.BufferOptions, ok); err != nil { + return err + } + } + + if v.EncryptionAtRestOptions != nil { + ok := object.Key("EncryptionAtRestOptions") + if err := awsRestjson1_serializeDocumentEncryptionAtRestOptions(v.EncryptionAtRestOptions, ok); err != nil { + return err + } + } + if v.LogPublishingOptions != nil { ok := object.Key("LogPublishingOptions") if err := awsRestjson1_serializeDocumentLogPublishingOptions(v.LogPublishingOptions, ok); err != nil { @@ -1041,6 +1069,18 @@ func awsRestjson1_serializeOpDocumentValidatePipelineInput(v *ValidatePipelineIn return nil } +func awsRestjson1_serializeDocumentBufferOptions(v *types.BufferOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PersistentBufferEnabled != nil { + ok := object.Key("PersistentBufferEnabled") + ok.Boolean(*v.PersistentBufferEnabled) + } + + return nil +} + func awsRestjson1_serializeDocumentCloudWatchLogDestination(v *types.CloudWatchLogDestination, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1053,6 +1093,18 @@ func awsRestjson1_serializeDocumentCloudWatchLogDestination(v *types.CloudWatchL return nil } +func awsRestjson1_serializeDocumentEncryptionAtRestOptions(v *types.EncryptionAtRestOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyArn != nil { + ok := object.Key("KmsKeyArn") + ok.String(*v.KmsKeyArn) + } + + return nil +} + func awsRestjson1_serializeDocumentLogPublishingOptions(v *types.LogPublishingOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/osis/types/enums.go b/service/osis/types/enums.go index 97c459ab88f..8acd62fbbd8 100644 --- a/service/osis/types/enums.go +++ b/service/osis/types/enums.go @@ -79,3 +79,19 @@ func (PipelineStatus) Values() []PipelineStatus { "STOPPED", } } + +type VpcEndpointServiceName string + +// Enum values for VpcEndpointServiceName +const ( + VpcEndpointServiceNameOpensearchServerless VpcEndpointServiceName = "OPENSEARCH_SERVERLESS" +) + +// Values returns all known values for VpcEndpointServiceName. 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 (VpcEndpointServiceName) Values() []VpcEndpointServiceName { + return []VpcEndpointServiceName{ + "OPENSEARCH_SERVERLESS", + } +} diff --git a/service/osis/types/types.go b/service/osis/types/types.go index 97787ac2856..b01e31c5cd7 100644 --- a/service/osis/types/types.go +++ b/service/osis/types/types.go @@ -7,6 +7,18 @@ import ( "time" ) +// Options that specify the configuration of a persistent buffer. To configure how +// OpenSearch Ingestion encrypts this data, set the EncryptionAtRestOptions. +type BufferOptions struct { + + // Whether persistent buffering should be enabled. + // + // This member is required. + PersistentBufferEnabled *bool + + noSmithyDocumentSerde +} + // Progress details for a specific stage of a pipeline configuration change. type ChangeProgressStage struct { @@ -57,6 +69,18 @@ type CloudWatchLogDestination struct { noSmithyDocumentSerde } +// Options to control how OpenSearch encrypts all data-at-rest. +type EncryptionAtRestOptions struct { + + // The ARN of the KMS key used to encrypt data-at-rest in OpenSearch Ingestion. By + // default, data is encrypted using an AWS owned key. + // + // This member is required. + KmsKeyArn *string + + noSmithyDocumentSerde +} + // Container for the values required to configure logging for the pipeline. If you // don't specify these values, OpenSearch Ingestion will not publish logs from your // application to CloudWatch Logs. @@ -75,9 +99,16 @@ type LogPublishingOptions struct { // Information about an existing OpenSearch Ingestion pipeline. type Pipeline struct { + // Options that specify the configuration of a persistent buffer. To configure how + // OpenSearch Ingestion encrypts this data, set the EncryptionAtRestOptions. + BufferOptions *BufferOptions + // The date and time when the pipeline was created. CreatedAt *time.Time + // Options to control how OpenSearch encrypts all data-at-rest. + EncryptionAtRestOptions *EncryptionAtRestOptions + // The ingestion endpoints for the pipeline, which you can send data to. IngestEndpointUrls []string @@ -102,12 +133,19 @@ type Pipeline struct { // The name of the pipeline. PipelineName *string + // A list of VPC endpoints that OpenSearch Ingestion has created to other AWS + // services. + ServiceVpcEndpoints []ServiceVpcEndpoint + // The current status of the pipeline. Status PipelineStatus // The reason for the current status of the pipeline. StatusReason *PipelineStatusReason + // A list of tags associated with the given pipeline. + Tags []Tag + // The VPC interface endpoints that have access to the pipeline. VpcEndpoints []VpcEndpoint @@ -171,6 +209,22 @@ type PipelineSummary struct { // Information about a pipeline's current status. StatusReason *PipelineStatusReason + // A list of tags associated with the given pipeline. + Tags []Tag + + noSmithyDocumentSerde +} + +// A container for information about VPC endpoints that were created to other +// services +type ServiceVpcEndpoint struct { + + // The name of the service for which a VPC endpoint was created. + ServiceName VpcEndpointServiceName + + // The ID of the VPC endpoint that was created. + VpcEndpointId *string + noSmithyDocumentSerde } diff --git a/service/osis/validators.go b/service/osis/validators.go index 908ab9bafa0..ae289984a1d 100644 --- a/service/osis/validators.go +++ b/service/osis/validators.go @@ -298,6 +298,21 @@ func addOpValidatePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpValidatePipeline{}, middleware.After) } +func validateBufferOptions(v *types.BufferOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BufferOptions"} + if v.PersistentBufferEnabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("PersistentBufferEnabled")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCloudWatchLogDestination(v *types.CloudWatchLogDestination) error { if v == nil { return nil @@ -313,6 +328,21 @@ func validateCloudWatchLogDestination(v *types.CloudWatchLogDestination) error { } } +func validateEncryptionAtRestOptions(v *types.EncryptionAtRestOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EncryptionAtRestOptions"} + if v.KmsKeyArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("KmsKeyArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLogPublishingOptions(v *types.LogPublishingOptions) error { if v == nil { return nil @@ -407,6 +437,16 @@ func validateOpCreatePipelineInput(v *CreatePipelineInput) error { invalidParams.AddNested("VpcOptions", err.(smithy.InvalidParamsError)) } } + if v.BufferOptions != nil { + if err := validateBufferOptions(v.BufferOptions); err != nil { + invalidParams.AddNested("BufferOptions", err.(smithy.InvalidParamsError)) + } + } + if v.EncryptionAtRestOptions != nil { + if err := validateEncryptionAtRestOptions(v.EncryptionAtRestOptions); err != nil { + invalidParams.AddNested("EncryptionAtRestOptions", err.(smithy.InvalidParamsError)) + } + } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) @@ -577,6 +617,16 @@ func validateOpUpdatePipelineInput(v *UpdatePipelineInput) error { invalidParams.AddNested("LogPublishingOptions", err.(smithy.InvalidParamsError)) } } + if v.BufferOptions != nil { + if err := validateBufferOptions(v.BufferOptions); err != nil { + invalidParams.AddNested("BufferOptions", err.(smithy.InvalidParamsError)) + } + } + if v.EncryptionAtRestOptions != nil { + if err := validateEncryptionAtRestOptions(v.EncryptionAtRestOptions); err != nil { + invalidParams.AddNested("EncryptionAtRestOptions", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/pipes/deserializers.go b/service/pipes/deserializers.go index aca0975982e..ea8c433efca 100644 --- a/service/pipes/deserializers.go +++ b/service/pipes/deserializers.go @@ -2262,7 +2262,7 @@ func awsRestjson1_deserializeDocumentBatchArrayProperties(v **types.BatchArrayPr if err != nil { return err } - sv.Size = int32(i64) + sv.Size = ptr.Int32(int32(i64)) } default: @@ -2646,7 +2646,7 @@ func awsRestjson1_deserializeDocumentBatchRetryStrategy(v **types.BatchRetryStra if err != nil { return err } - sv.Attempts = int32(i64) + sv.Attempts = ptr.Int32(int32(i64)) } default: @@ -3227,7 +3227,7 @@ func awsRestjson1_deserializeDocumentEcsEphemeralStorage(v **types.EcsEphemeralS if err != nil { return err } - sv.SizeInGiB = int32(i64) + sv.SizeInGiB = ptr.Int32(int32(i64)) } default: diff --git a/service/pipes/serializers.go b/service/pipes/serializers.go index 6f5724dea1b..ef8b47ef3c6 100644 --- a/service/pipes/serializers.go +++ b/service/pipes/serializers.go @@ -899,9 +899,9 @@ func awsRestjson1_serializeDocumentBatchArrayProperties(v *types.BatchArrayPrope object := value.Object() defer object.Close() - if v.Size != 0 { + if v.Size != nil { ok := object.Key("Size") - ok.Integer(v.Size) + ok.Integer(*v.Size) } return nil @@ -1045,9 +1045,9 @@ func awsRestjson1_serializeDocumentBatchRetryStrategy(v *types.BatchRetryStrateg object := value.Object() defer object.Close() - if v.Attempts != 0 { + if v.Attempts != nil { ok := object.Key("Attempts") - ok.Integer(v.Attempts) + ok.Integer(*v.Attempts) } return nil @@ -1244,9 +1244,9 @@ func awsRestjson1_serializeDocumentEcsEphemeralStorage(v *types.EcsEphemeralStor object := value.Object() defer object.Close() - { + if v.SizeInGiB != nil { ok := object.Key("sizeInGiB") - ok.Integer(v.SizeInGiB) + ok.Integer(*v.SizeInGiB) } return nil diff --git a/service/pipes/types/types.go b/service/pipes/types/types.go index ea5a7674fca..b3cc88e5755 100644 --- a/service/pipes/types/types.go +++ b/service/pipes/types/types.go @@ -39,7 +39,7 @@ type AwsVpcConfiguration struct { type BatchArrayProperties struct { // The size of the array, if this is an array batch job. - Size int32 + Size *int32 noSmithyDocumentSerde } @@ -180,7 +180,7 @@ type BatchRetryStrategy struct { // The number of times to move a job to the RUNNABLE status. If the value of // attempts is greater than one, the job is retried on failure the same number of // attempts as the value. - Attempts int32 + Attempts *int32 noSmithyDocumentSerde } @@ -350,7 +350,7 @@ type EcsEphemeralStorage struct { // supported value is 21 GiB and the maximum supported value is 200 GiB. // // This member is required. - SizeInGiB int32 + SizeInGiB *int32 noSmithyDocumentSerde } diff --git a/service/pipes/validators.go b/service/pipes/validators.go index ac226019354..212ce40a1a7 100644 --- a/service/pipes/validators.go +++ b/service/pipes/validators.go @@ -419,6 +419,9 @@ func validateEcsEphemeralStorage(v *types.EcsEphemeralStorage) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "EcsEphemeralStorage"} + if v.SizeInGiB == nil { + invalidParams.Add(smithy.NewErrParamRequired("SizeInGiB")) + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/rds/api_op_CopyDBClusterParameterGroup.go b/service/rds/api_op_CopyDBClusterParameterGroup.go index 8b8422ec9db..9b663cbb539 100644 --- a/service/rds/api_op_CopyDBClusterParameterGroup.go +++ b/service/rds/api_op_CopyDBClusterParameterGroup.go @@ -12,7 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Copies the specified DB cluster parameter group. +// Copies the specified DB cluster parameter group. You can't copy a default DB +// cluster parameter group. Instead, create a new custom DB cluster parameter +// group, which copies the default parameters and values for the specified DB +// cluster parameter group family. func (c *Client) CopyDBClusterParameterGroup(ctx context.Context, params *CopyDBClusterParameterGroupInput, optFns ...func(*Options)) (*CopyDBClusterParameterGroupOutput, error) { if params == nil { params = &CopyDBClusterParameterGroupInput{} diff --git a/service/rds/api_op_CopyDBParameterGroup.go b/service/rds/api_op_CopyDBParameterGroup.go index 0122d479c03..48f8fd7fd32 100644 --- a/service/rds/api_op_CopyDBParameterGroup.go +++ b/service/rds/api_op_CopyDBParameterGroup.go @@ -12,7 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Copies the specified DB parameter group. +// Copies the specified DB parameter group. You can't copy a default DB parameter +// group. Instead, create a new custom DB parameter group, which copies the default +// parameters and values for the specified DB parameter group family. func (c *Client) CopyDBParameterGroup(ctx context.Context, params *CopyDBParameterGroupInput, optFns ...func(*Options)) (*CopyDBParameterGroupOutput, error) { if params == nil { params = &CopyDBParameterGroupInput{} diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index ea3348e8b74..2e226352350 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -1825,6 +1825,9 @@ func awsAwsquery_deserializeOpErrorCreateDBCluster(response *smithyhttp.Response case strings.EqualFold("InvalidDBInstanceState", errorCode): return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + case strings.EqualFold("InvalidDBSubnetGroupFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetGroupFault(response, errorBody) + case strings.EqualFold("InvalidDBSubnetGroupStateFault", errorCode): return awsAwsquery_deserializeErrorInvalidDBSubnetGroupStateFault(response, errorBody) @@ -1840,6 +1843,9 @@ func awsAwsquery_deserializeOpErrorCreateDBCluster(response *smithyhttp.Response case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + case strings.EqualFold("StorageQuotaExceeded", errorCode): return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) @@ -11733,6 +11739,9 @@ func awsAwsquery_deserializeOpErrorModifyDBCluster(response *smithyhttp.Response case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + case strings.EqualFold("StorageQuotaExceeded", errorCode): return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) @@ -26840,6 +26849,12 @@ func awsAwsquery_deserializeDocumentDBCluster(v **types.DBCluster, decoder smith sv.Status = ptr.String(xtv) } + case strings.EqualFold("StatusInfos", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterStatusInfoList(&sv.StatusInfos, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("StorageEncrypted", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -29751,6 +29766,165 @@ func awsAwsquery_deserializeDocumentDBClusterSnapshotNotFoundFault(v **types.DBC return nil } +func awsAwsquery_deserializeDocumentDBClusterStatusInfo(v **types.DBClusterStatusInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterStatusInfo + if *v == nil { + sv = &types.DBClusterStatusInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Normal", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Normal = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StatusType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusType = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterStatusInfoList(v *[]types.DBClusterStatusInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterStatusInfo + if *v == nil { + sv = make([]types.DBClusterStatusInfo, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterStatusInfo", t.Name.Local): + var col types.DBClusterStatusInfo + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterStatusInfo(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterStatusInfoListUnwrapped(v *[]types.DBClusterStatusInfo, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterStatusInfo + if *v == nil { + sv = make([]types.DBClusterStatusInfo, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterStatusInfo + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterStatusInfo(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsAwsquery_deserializeDocumentDBEngineVersion(v **types.DBEngineVersion, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -46060,6 +46234,19 @@ func awsAwsquery_deserializeDocumentRdsCustomClusterConfiguration(v **types.RdsC sv.InterconnectSubnetId = ptr.String(xtv) } + case strings.EqualFold("ReplicaMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReplicaMode = types.ReplicaMode(xtv) + } + case strings.EqualFold("TransitGatewayMulticastDomainId", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/rds/serializers.go b/service/rds/serializers.go index c1f8e3a9390..ad8f3f4393d 100644 --- a/service/rds/serializers.go +++ b/service/rds/serializers.go @@ -10169,6 +10169,11 @@ func awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v *types.RdsCust objectKey.String(*v.InterconnectSubnetId) } + if len(v.ReplicaMode) > 0 { + objectKey := object.Key("ReplicaMode") + objectKey.String(string(v.ReplicaMode)) + } + if v.TransitGatewayMulticastDomainId != nil { objectKey := object.Key("TransitGatewayMulticastDomainId") objectKey.String(*v.TransitGatewayMulticastDomainId) diff --git a/service/rds/types/types.go b/service/rds/types/types.go index cbd369e4030..17471f4ce77 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -750,6 +750,9 @@ type DBCluster struct { // The current state of this DB cluster. Status *string + // Reserved for future use. + StatusInfos []DBClusterStatusInfo + // Indicates whether the DB cluster is encrypted. StorageEncrypted *bool @@ -1165,6 +1168,24 @@ type DBClusterSnapshotAttributesResult struct { noSmithyDocumentSerde } +// Reserved for future use. +type DBClusterStatusInfo struct { + + // Reserved for future use. + Message *string + + // Reserved for future use. + Normal *bool + + // Reserved for future use. + Status *string + + // Reserved for future use. + StatusType *string + + noSmithyDocumentSerde +} + // This data type is used as a response element in the action // DescribeDBEngineVersions . type DBEngineVersion struct { @@ -3606,6 +3627,9 @@ type RdsCustomClusterConfiguration struct { // Reserved for future use. InterconnectSubnetId *string + // Reserved for future use. + ReplicaMode ReplicaMode + // Reserved for future use. TransitGatewayMulticastDomainId *string diff --git a/service/redshift/api_op_CreateCluster.go b/service/redshift/api_op_CreateCluster.go index e4496a4370d..bc8324af2a6 100644 --- a/service/redshift/api_op_CreateCluster.go +++ b/service/redshift/api_op_CreateCluster.go @@ -261,6 +261,10 @@ type CreateClusterInput struct { // If true , the cluster can be accessed from a public network. PubliclyAccessible *bool + // The Amazon resource name (ARN) of the Amazon Redshift IAM Identity Center + // application. + RedshiftIdcApplicationArn *string + // A unique identifier for the snapshot schedule. SnapshotScheduleIdentifier *string diff --git a/service/redshift/api_op_CreateRedshiftIdcApplication.go b/service/redshift/api_op_CreateRedshiftIdcApplication.go new file mode 100644 index 00000000000..29489b0419a --- /dev/null +++ b/service/redshift/api_op_CreateRedshiftIdcApplication.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshift + +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/redshift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon Redshift application for use with IAM Identity Center. +func (c *Client) CreateRedshiftIdcApplication(ctx context.Context, params *CreateRedshiftIdcApplicationInput, optFns ...func(*Options)) (*CreateRedshiftIdcApplicationOutput, error) { + if params == nil { + params = &CreateRedshiftIdcApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRedshiftIdcApplication", params, optFns, c.addOperationCreateRedshiftIdcApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRedshiftIdcApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRedshiftIdcApplicationInput struct { + + // The IAM role ARN for the Amazon Redshift IAM Identity Center application + // instance. It has the required permissions to be assumed and invoke the IDC + // Identity Center API. + // + // This member is required. + IamRoleArn *string + + // The display name for the Amazon Redshift IAM Identity Center application + // instance. It appears in the console. + // + // This member is required. + IdcDisplayName *string + + // The Amazon resource name (ARN) of the IAM Identity Center instance where Amazon + // Redshift creates a new managed application. + // + // This member is required. + IdcInstanceArn *string + + // The name of the Redshift application in IAM Identity Center. + // + // This member is required. + RedshiftIdcApplicationName *string + + // The token issuer list for the Amazon Redshift IAM Identity Center application + // instance. + AuthorizedTokenIssuerList []types.AuthorizedTokenIssuer + + // The namespace for the Amazon Redshift IAM Identity Center application instance. + // It determines which managed application verifies the connection token. + IdentityNamespace *string + + // A collection of service integrations for the Redshift IAM Identity Center + // application. + ServiceIntegrations []types.ServiceIntegrationsUnion + + noSmithyDocumentSerde +} + +type CreateRedshiftIdcApplicationOutput struct { + + // Contains properties for the Redshift IDC application. + RedshiftIdcApplication *types.RedshiftIdcApplication + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRedshiftIdcApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateRedshiftIdcApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateRedshiftIdcApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateRedshiftIdcApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateRedshiftIdcApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRedshiftIdcApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateRedshiftIdcApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateRedshiftIdcApplication", + } +} diff --git a/service/redshift/api_op_DeleteRedshiftIdcApplication.go b/service/redshift/api_op_DeleteRedshiftIdcApplication.go new file mode 100644 index 00000000000..8138c9eabe3 --- /dev/null +++ b/service/redshift/api_op_DeleteRedshiftIdcApplication.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshift + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Amazon Redshift IAM Identity Center application. +func (c *Client) DeleteRedshiftIdcApplication(ctx context.Context, params *DeleteRedshiftIdcApplicationInput, optFns ...func(*Options)) (*DeleteRedshiftIdcApplicationOutput, error) { + if params == nil { + params = &DeleteRedshiftIdcApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRedshiftIdcApplication", params, optFns, c.addOperationDeleteRedshiftIdcApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRedshiftIdcApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRedshiftIdcApplicationInput struct { + + // The ARN for a deleted Amazon Redshift IAM Identity Center application. + // + // This member is required. + RedshiftIdcApplicationArn *string + + noSmithyDocumentSerde +} + +type DeleteRedshiftIdcApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRedshiftIdcApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteRedshiftIdcApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteRedshiftIdcApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteRedshiftIdcApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteRedshiftIdcApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRedshiftIdcApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRedshiftIdcApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteRedshiftIdcApplication", + } +} diff --git a/service/redshift/api_op_DescribeRedshiftIdcApplications.go b/service/redshift/api_op_DescribeRedshiftIdcApplications.go new file mode 100644 index 00000000000..c86c1f5aa78 --- /dev/null +++ b/service/redshift/api_op_DescribeRedshiftIdcApplications.go @@ -0,0 +1,248 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshift + +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/redshift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the Amazon Redshift IAM Identity Center applications. +func (c *Client) DescribeRedshiftIdcApplications(ctx context.Context, params *DescribeRedshiftIdcApplicationsInput, optFns ...func(*Options)) (*DescribeRedshiftIdcApplicationsOutput, error) { + if params == nil { + params = &DescribeRedshiftIdcApplicationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeRedshiftIdcApplications", params, optFns, c.addOperationDescribeRedshiftIdcApplicationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeRedshiftIdcApplicationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeRedshiftIdcApplicationsInput struct { + + // A value that indicates the starting point for the next set of response records + // in a subsequent request. If a value is returned in a response, you can retrieve + // the next set of records by providing this returned marker value in the Marker + // parameter and retrying the command. If the Marker field is empty, all response + // records have been retrieved for the request. + Marker *string + + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. + MaxRecords *int32 + + // The ARN for the Redshift application that integrates with IAM Identity Center. + RedshiftIdcApplicationArn *string + + noSmithyDocumentSerde +} + +type DescribeRedshiftIdcApplicationsOutput struct { + + // A value that indicates the starting point for the next set of response records + // in a subsequent request. If a value is returned in a response, you can retrieve + // the next set of records by providing this returned marker value in the Marker + // parameter and retrying the command. If the Marker field is empty, all response + // records have been retrieved for the request. + Marker *string + + // The list of Amazon Redshift IAM Identity Center applications. + RedshiftIdcApplications []types.RedshiftIdcApplication + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeRedshiftIdcApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeRedshiftIdcApplications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeRedshiftIdcApplications{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeRedshiftIdcApplications"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRedshiftIdcApplications(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// DescribeRedshiftIdcApplicationsAPIClient is a client that implements the +// DescribeRedshiftIdcApplications operation. +type DescribeRedshiftIdcApplicationsAPIClient interface { + DescribeRedshiftIdcApplications(context.Context, *DescribeRedshiftIdcApplicationsInput, ...func(*Options)) (*DescribeRedshiftIdcApplicationsOutput, error) +} + +var _ DescribeRedshiftIdcApplicationsAPIClient = (*Client)(nil) + +// DescribeRedshiftIdcApplicationsPaginatorOptions is the paginator options for +// DescribeRedshiftIdcApplications +type DescribeRedshiftIdcApplicationsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. + 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 +} + +// DescribeRedshiftIdcApplicationsPaginator is a paginator for +// DescribeRedshiftIdcApplications +type DescribeRedshiftIdcApplicationsPaginator struct { + options DescribeRedshiftIdcApplicationsPaginatorOptions + client DescribeRedshiftIdcApplicationsAPIClient + params *DescribeRedshiftIdcApplicationsInput + nextToken *string + firstPage bool +} + +// NewDescribeRedshiftIdcApplicationsPaginator returns a new +// DescribeRedshiftIdcApplicationsPaginator +func NewDescribeRedshiftIdcApplicationsPaginator(client DescribeRedshiftIdcApplicationsAPIClient, params *DescribeRedshiftIdcApplicationsInput, optFns ...func(*DescribeRedshiftIdcApplicationsPaginatorOptions)) *DescribeRedshiftIdcApplicationsPaginator { + if params == nil { + params = &DescribeRedshiftIdcApplicationsInput{} + } + + options := DescribeRedshiftIdcApplicationsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeRedshiftIdcApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRedshiftIdcApplicationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeRedshiftIdcApplications page. +func (p *DescribeRedshiftIdcApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRedshiftIdcApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + result, err := p.client.DescribeRedshiftIdcApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opDescribeRedshiftIdcApplications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeRedshiftIdcApplications", + } +} diff --git a/service/redshift/api_op_ModifyRedshiftIdcApplication.go b/service/redshift/api_op_ModifyRedshiftIdcApplication.go new file mode 100644 index 00000000000..b772c25c883 --- /dev/null +++ b/service/redshift/api_op_ModifyRedshiftIdcApplication.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshift + +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/redshift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Changes an existing Amazon Redshift IAM Identity Center application. +func (c *Client) ModifyRedshiftIdcApplication(ctx context.Context, params *ModifyRedshiftIdcApplicationInput, optFns ...func(*Options)) (*ModifyRedshiftIdcApplicationOutput, error) { + if params == nil { + params = &ModifyRedshiftIdcApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyRedshiftIdcApplication", params, optFns, c.addOperationModifyRedshiftIdcApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyRedshiftIdcApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyRedshiftIdcApplicationInput struct { + + // The ARN for the Redshift application that integrates with IAM Identity Center. + // + // This member is required. + RedshiftIdcApplicationArn *string + + // The authorized token issuer list for the Amazon Redshift IAM Identity Center + // application to change. + AuthorizedTokenIssuerList []types.AuthorizedTokenIssuer + + // The IAM role ARN associated with the Amazon Redshift IAM Identity Center + // application to change. It has the required permissions to be assumed and invoke + // the IDC Identity Center API. + IamRoleArn *string + + // The display name for the Amazon Redshift IAM Identity Center application to + // change. It appears on the console. + IdcDisplayName *string + + // The namespace for the Amazon Redshift IAM Identity Center application to + // change. It determines which managed application verifies the connection token. + IdentityNamespace *string + + // A collection of service integrations associated with the application. + ServiceIntegrations []types.ServiceIntegrationsUnion + + noSmithyDocumentSerde +} + +type ModifyRedshiftIdcApplicationOutput struct { + + // Contains properties for the Redshift IDC application. + RedshiftIdcApplication *types.RedshiftIdcApplication + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyRedshiftIdcApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyRedshiftIdcApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyRedshiftIdcApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyRedshiftIdcApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpModifyRedshiftIdcApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyRedshiftIdcApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyRedshiftIdcApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyRedshiftIdcApplication", + } +} diff --git a/service/redshift/deserializers.go b/service/redshift/deserializers.go index b858b523836..7ebfff83836 100644 --- a/service/redshift/deserializers.go +++ b/service/redshift/deserializers.go @@ -1580,6 +1580,9 @@ func awsAwsquery_deserializeOpErrorCreateCluster(response *smithyhttp.Response, case strings.EqualFold("NumberOfNodesQuotaExceeded", errorCode): return awsAwsquery_deserializeErrorNumberOfNodesQuotaExceededFault(response, errorBody) + case strings.EqualFold("RedshiftIdcApplicationNotExists", errorCode): + return awsAwsquery_deserializeErrorRedshiftIdcApplicationNotExistsFault(response, errorBody) + case strings.EqualFold("SnapshotScheduleNotFound", errorCode): return awsAwsquery_deserializeErrorSnapshotScheduleNotFoundFault(response, errorBody) @@ -2712,6 +2715,126 @@ func awsAwsquery_deserializeOpErrorCreateHsmConfiguration(response *smithyhttp.R } } +type awsAwsquery_deserializeOpCreateRedshiftIdcApplication struct { +} + +func (*awsAwsquery_deserializeOpCreateRedshiftIdcApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateRedshiftIdcApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateRedshiftIdcApplication(response, &metadata) + } + output := &CreateRedshiftIdcApplicationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateRedshiftIdcApplicationResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateRedshiftIdcApplicationOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateRedshiftIdcApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DependentServiceAccessDenied", errorCode): + return awsAwsquery_deserializeErrorDependentServiceAccessDeniedFault(response, errorBody) + + case strings.EqualFold("DependentServiceUnavailableFault", errorCode): + return awsAwsquery_deserializeErrorDependentServiceUnavailableFault(response, errorBody) + + case strings.EqualFold("RedshiftIdcApplicationAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorRedshiftIdcApplicationAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("RedshiftIdcApplicationQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorRedshiftIdcApplicationQuotaExceededFault(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpCreateScheduledAction struct { } @@ -4523,6 +4646,88 @@ func awsAwsquery_deserializeOpErrorDeletePartner(response *smithyhttp.Response, } } +type awsAwsquery_deserializeOpDeleteRedshiftIdcApplication struct { +} + +func (*awsAwsquery_deserializeOpDeleteRedshiftIdcApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteRedshiftIdcApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteRedshiftIdcApplication(response, &metadata) + } + output := &DeleteRedshiftIdcApplicationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteRedshiftIdcApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DependentServiceAccessDenied", errorCode): + return awsAwsquery_deserializeErrorDependentServiceAccessDeniedFault(response, errorBody) + + case strings.EqualFold("DependentServiceUnavailableFault", errorCode): + return awsAwsquery_deserializeErrorDependentServiceUnavailableFault(response, errorBody) + + case strings.EqualFold("RedshiftIdcApplicationNotExists", errorCode): + return awsAwsquery_deserializeErrorRedshiftIdcApplicationNotExistsFault(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpDeleteResourcePolicy struct { } @@ -8063,14 +8268,14 @@ func awsAwsquery_deserializeOpErrorDescribePartners(response *smithyhttp.Respons } } -type awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus struct { +type awsAwsquery_deserializeOpDescribeRedshiftIdcApplications struct { } -func (*awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) ID() string { +func (*awsAwsquery_deserializeOpDescribeRedshiftIdcApplications) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDescribeRedshiftIdcApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8084,9 +8289,9 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDescribeReservedNodeExchangeStatus(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeRedshiftIdcApplications(response, &metadata) } - output := &DescribeReservedNodeExchangeStatusOutput{} + output := &DescribeRedshiftIdcApplicationsOutput{} out.Result = output var buff [1024]byte @@ -8107,7 +8312,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) HandleDese } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DescribeReservedNodeExchangeStatusResult") + t, err = decoder.GetElement("DescribeRedshiftIdcApplicationsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8119,7 +8324,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) HandleDese } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDescribeReservedNodeExchangeStatusOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDescribeRedshiftIdcApplicationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8133,7 +8338,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) HandleDese return out, metadata, err } -func awsAwsquery_deserializeOpErrorDescribeReservedNodeExchangeStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDescribeRedshiftIdcApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8158,11 +8363,14 @@ func awsAwsquery_deserializeOpErrorDescribeReservedNodeExchangeStatus(response * } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ReservedNodeExchangeNotFond", errorCode): - return awsAwsquery_deserializeErrorReservedNodeExchangeNotFoundFault(response, errorBody) + case strings.EqualFold("DependentServiceAccessDenied", errorCode): + return awsAwsquery_deserializeErrorDependentServiceAccessDeniedFault(response, errorBody) - case strings.EqualFold("ReservedNodeNotFound", errorCode): - return awsAwsquery_deserializeErrorReservedNodeNotFoundFault(response, errorBody) + case strings.EqualFold("DependentServiceUnavailableFault", errorCode): + return awsAwsquery_deserializeErrorDependentServiceUnavailableFault(response, errorBody) + + case strings.EqualFold("RedshiftIdcApplicationNotExists", errorCode): + return awsAwsquery_deserializeErrorRedshiftIdcApplicationNotExistsFault(response, errorBody) case strings.EqualFold("UnsupportedOperation", errorCode): return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) @@ -8177,14 +8385,14 @@ func awsAwsquery_deserializeOpErrorDescribeReservedNodeExchangeStatus(response * } } -type awsAwsquery_deserializeOpDescribeReservedNodeOfferings struct { +type awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus struct { } -func (*awsAwsquery_deserializeOpDescribeReservedNodeOfferings) ID() string { +func (*awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDescribeReservedNodeOfferings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDescribeReservedNodeExchangeStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8198,9 +8406,9 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeOfferings) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDescribeReservedNodeOfferings(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeReservedNodeExchangeStatus(response, &metadata) } - output := &DescribeReservedNodeOfferingsOutput{} + output := &DescribeReservedNodeExchangeStatusOutput{} out.Result = output var buff [1024]byte @@ -8221,7 +8429,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeOfferings) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DescribeReservedNodeOfferingsResult") + t, err = decoder.GetElement("DescribeReservedNodeExchangeStatusResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8233,7 +8441,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeOfferings) HandleDeseriali } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDescribeReservedNodeOfferingsOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDescribeReservedNodeExchangeStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8247,7 +8455,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodeOfferings) HandleDeseriali return out, metadata, err } -func awsAwsquery_deserializeOpErrorDescribeReservedNodeOfferings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDescribeReservedNodeExchangeStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8272,11 +8480,11 @@ func awsAwsquery_deserializeOpErrorDescribeReservedNodeOfferings(response *smith } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("DependentServiceUnavailableFault", errorCode): - return awsAwsquery_deserializeErrorDependentServiceUnavailableFault(response, errorBody) + case strings.EqualFold("ReservedNodeExchangeNotFond", errorCode): + return awsAwsquery_deserializeErrorReservedNodeExchangeNotFoundFault(response, errorBody) - case strings.EqualFold("ReservedNodeOfferingNotFound", errorCode): - return awsAwsquery_deserializeErrorReservedNodeOfferingNotFoundFault(response, errorBody) + case strings.EqualFold("ReservedNodeNotFound", errorCode): + return awsAwsquery_deserializeErrorReservedNodeNotFoundFault(response, errorBody) case strings.EqualFold("UnsupportedOperation", errorCode): return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) @@ -8291,14 +8499,14 @@ func awsAwsquery_deserializeOpErrorDescribeReservedNodeOfferings(response *smith } } -type awsAwsquery_deserializeOpDescribeReservedNodes struct { +type awsAwsquery_deserializeOpDescribeReservedNodeOfferings struct { } -func (*awsAwsquery_deserializeOpDescribeReservedNodes) ID() string { +func (*awsAwsquery_deserializeOpDescribeReservedNodeOfferings) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDescribeReservedNodes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDescribeReservedNodeOfferings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8312,9 +8520,9 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodes) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDescribeReservedNodes(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeReservedNodeOfferings(response, &metadata) } - output := &DescribeReservedNodesOutput{} + output := &DescribeReservedNodeOfferingsOutput{} out.Result = output var buff [1024]byte @@ -8335,7 +8543,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodes) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DescribeReservedNodesResult") + t, err = decoder.GetElement("DescribeReservedNodeOfferingsResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8347,7 +8555,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodes) HandleDeserialize(ctx c } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDescribeReservedNodesOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDescribeReservedNodeOfferingsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8361,7 +8569,7 @@ func (m *awsAwsquery_deserializeOpDescribeReservedNodes) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsquery_deserializeOpErrorDescribeReservedNodes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDescribeReservedNodeOfferings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8389,8 +8597,11 @@ func awsAwsquery_deserializeOpErrorDescribeReservedNodes(response *smithyhttp.Re case strings.EqualFold("DependentServiceUnavailableFault", errorCode): return awsAwsquery_deserializeErrorDependentServiceUnavailableFault(response, errorBody) - case strings.EqualFold("ReservedNodeNotFound", errorCode): - return awsAwsquery_deserializeErrorReservedNodeNotFoundFault(response, errorBody) + case strings.EqualFold("ReservedNodeOfferingNotFound", errorCode): + return awsAwsquery_deserializeErrorReservedNodeOfferingNotFoundFault(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8402,14 +8613,14 @@ func awsAwsquery_deserializeOpErrorDescribeReservedNodes(response *smithyhttp.Re } } -type awsAwsquery_deserializeOpDescribeResize struct { +type awsAwsquery_deserializeOpDescribeReservedNodes struct { } -func (*awsAwsquery_deserializeOpDescribeResize) ID() string { +func (*awsAwsquery_deserializeOpDescribeReservedNodes) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDescribeResize) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsquery_deserializeOpDescribeReservedNodes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8423,9 +8634,9 @@ func (m *awsAwsquery_deserializeOpDescribeResize) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDescribeResize(response, &metadata) + return out, metadata, awsAwsquery_deserializeOpErrorDescribeReservedNodes(response, &metadata) } - output := &DescribeResizeOutput{} + output := &DescribeReservedNodesOutput{} out.Result = output var buff [1024]byte @@ -8446,7 +8657,7 @@ func (m *awsAwsquery_deserializeOpDescribeResize) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DescribeResizeResult") + t, err = decoder.GetElement("DescribeReservedNodesResult") if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8458,7 +8669,7 @@ func (m *awsAwsquery_deserializeOpDescribeResize) HandleDeserialize(ctx context. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDescribeResizeOutput(&output, decoder) + err = awsAwsquery_deserializeOpDocumentDescribeReservedNodesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8472,7 +8683,118 @@ func (m *awsAwsquery_deserializeOpDescribeResize) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsquery_deserializeOpErrorDescribeResize(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsquery_deserializeOpErrorDescribeReservedNodes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DependentServiceUnavailableFault", errorCode): + return awsAwsquery_deserializeErrorDependentServiceUnavailableFault(response, errorBody) + + case strings.EqualFold("ReservedNodeNotFound", errorCode): + return awsAwsquery_deserializeErrorReservedNodeNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeResize struct { +} + +func (*awsAwsquery_deserializeOpDescribeResize) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeResize) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeResize(response, &metadata) + } + output := &DescribeResizeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeResizeResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeResizeOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeResize(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -12132,6 +12454,123 @@ func awsAwsquery_deserializeOpErrorModifyEventSubscription(response *smithyhttp. } } +type awsAwsquery_deserializeOpModifyRedshiftIdcApplication struct { +} + +func (*awsAwsquery_deserializeOpModifyRedshiftIdcApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyRedshiftIdcApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorModifyRedshiftIdcApplication(response, &metadata) + } + output := &ModifyRedshiftIdcApplicationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyRedshiftIdcApplicationResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyRedshiftIdcApplicationOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyRedshiftIdcApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DependentServiceAccessDenied", errorCode): + return awsAwsquery_deserializeErrorDependentServiceAccessDeniedFault(response, errorBody) + + case strings.EqualFold("DependentServiceUnavailableFault", errorCode): + return awsAwsquery_deserializeErrorDependentServiceUnavailableFault(response, errorBody) + + case strings.EqualFold("RedshiftIdcApplicationNotExists", errorCode): + return awsAwsquery_deserializeErrorRedshiftIdcApplicationNotExistsFault(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpModifyScheduledAction struct { } @@ -15880,6 +16319,50 @@ func awsAwsquery_deserializeErrorCustomDomainAssociationNotFoundFault(response * return output } +func awsAwsquery_deserializeErrorDependentServiceAccessDeniedFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DependentServiceAccessDeniedFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDependentServiceAccessDeniedFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + func awsAwsquery_deserializeErrorDependentServiceRequestThrottlingFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.DependentServiceRequestThrottlingFault{} var buff [1024]byte @@ -18388,6 +18871,138 @@ func awsAwsquery_deserializeErrorPartnerNotFoundFault(response *smithyhttp.Respo return output } +func awsAwsquery_deserializeErrorRedshiftIdcApplicationAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RedshiftIdcApplicationAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRedshiftIdcApplicationAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorRedshiftIdcApplicationNotExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RedshiftIdcApplicationNotExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRedshiftIdcApplicationNotExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorRedshiftIdcApplicationQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RedshiftIdcApplicationQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRedshiftIdcApplicationQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + func awsAwsquery_deserializeErrorReservedNodeAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ReservedNodeAlreadyExistsFault{} var buff [1024]byte @@ -21442,6 +22057,209 @@ func awsAwsquery_deserializeDocumentAuthorizationQuotaExceededFault(v **types.Au return nil } +func awsAwsquery_deserializeDocumentAuthorizedAudienceList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAuthorizedAudienceListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAuthorizedTokenIssuer(v **types.AuthorizedTokenIssuer, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AuthorizedTokenIssuer + if *v == nil { + sv = &types.AuthorizedTokenIssuer{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AuthorizedAudiencesList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthorizedAudienceList(&sv.AuthorizedAudiencesList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TrustedTokenIssuerArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TrustedTokenIssuerArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAuthorizedTokenIssuerList(v *[]types.AuthorizedTokenIssuer, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AuthorizedTokenIssuer + if *v == nil { + sv = make([]types.AuthorizedTokenIssuer, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.AuthorizedTokenIssuer + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAuthorizedTokenIssuer(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAuthorizedTokenIssuerListUnwrapped(v *[]types.AuthorizedTokenIssuer, decoder smithyxml.NodeDecoder) error { + var sv []types.AuthorizedTokenIssuer + if *v == nil { + sv = make([]types.AuthorizedTokenIssuer, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AuthorizedTokenIssuer + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAuthorizedTokenIssuer(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsAwsquery_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -26036,6 +26854,55 @@ func awsAwsquery_deserializeDocumentDeferredMaintenanceWindowsListUnwrapped(v *[ *v = sv return nil } +func awsAwsquery_deserializeDocumentDependentServiceAccessDeniedFault(v **types.DependentServiceAccessDeniedFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DependentServiceAccessDeniedFault + if *v == nil { + sv = &types.DependentServiceAccessDeniedFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeDocumentDependentServiceRequestThrottlingFault(v **types.DependentServiceRequestThrottlingFault, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -31272,6 +32139,163 @@ func awsAwsquery_deserializeDocumentIpv6CidrBlockNotFoundFault(v **types.Ipv6Cid return nil } +func awsAwsquery_deserializeDocumentLakeFormationQuery(v **types.LakeFormationQuery, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LakeFormationQuery + if *v == nil { + sv = &types.LakeFormationQuery{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Authorization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Authorization = types.ServiceAuthorization(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLakeFormationScopeUnion(v *types.LakeFormationScopeUnion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var uv types.LakeFormationScopeUnion + var memberFound bool + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + if memberFound { + if err = decoder.Decoder.Skip(); err != nil { + return err + } + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("LakeFormationQuery", t.Name.Local): + var mv types.LakeFormationQuery + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentLakeFormationQuery(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + uv = &types.LakeFormationScopeUnionMemberLakeFormationQuery{Value: mv} + memberFound = true + + default: + uv = &types.UnknownUnionMember{Tag: t.Name.Local} + memberFound = true + + } + decoder = originalDecoder + } + *v = uv + return nil +} + +func awsAwsquery_deserializeDocumentLakeFormationServiceIntegrations(v *[]types.LakeFormationScopeUnion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.LakeFormationScopeUnion + if *v == nil { + sv = make([]types.LakeFormationScopeUnion, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.LakeFormationScopeUnion + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLakeFormationScopeUnion(&col, nodeDecoder); err != nil { + return err + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLakeFormationServiceIntegrationsUnwrapped(v *[]types.LakeFormationScopeUnion, decoder smithyxml.NodeDecoder) error { + var sv []types.LakeFormationScopeUnion + if *v == nil { + sv = make([]types.LakeFormationScopeUnion, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.LakeFormationScopeUnion + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLakeFormationScopeUnion(&mv, nodeDecoder); err != nil { + return err + } + sv = append(sv, mv) + } + *v = sv + return nil +} func awsAwsquery_deserializeDocumentLimitExceededFault(v **types.LimitExceededFault, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -33036,13 +34060,13 @@ func awsAwsquery_deserializeDocumentRecurringChargeListUnwrapped(v *[]types.Recu *v = sv return nil } -func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRedshiftIdcApplication(v **types.RedshiftIdcApplication, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ReservedNode + var sv *types.RedshiftIdcApplication if *v == nil { - sv = &types.ReservedNode{} + sv = &types.RedshiftIdcApplication{} } else { sv = *v } @@ -33058,54 +34082,13 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CurrencyCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CurrencyCode = ptr.String(xtv) - } - - case strings.EqualFold("Duration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Duration = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("FixedPrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("AuthorizedTokenIssuerList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAuthorizedTokenIssuerList(&sv.AuthorizedTokenIssuerList, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.FixedPrice = ptr.Float64(f64) - } - case strings.EqualFold("NodeCount", t.Name.Local): + case strings.EqualFold("IamRoleArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33115,14 +34098,10 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.NodeCount = ptr.Int32(int32(i64)) + sv.IamRoleArn = ptr.String(xtv) } - case strings.EqualFold("NodeType", t.Name.Local): + case strings.EqualFold("IdcDisplayName", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33132,10 +34111,10 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - sv.NodeType = ptr.String(xtv) + sv.IdcDisplayName = ptr.String(xtv) } - case strings.EqualFold("OfferingType", t.Name.Local): + case strings.EqualFold("IdcInstanceArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33145,16 +34124,10 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - sv.OfferingType = ptr.String(xtv) + sv.IdcInstanceArn = ptr.String(xtv) } - case strings.EqualFold("RecurringCharges", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ReservedNodeId", t.Name.Local): + case strings.EqualFold("IdcManagedApplicationArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33164,10 +34137,10 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - sv.ReservedNodeId = ptr.String(xtv) + sv.IdcManagedApplicationArn = ptr.String(xtv) } - case strings.EqualFold("ReservedNodeOfferingId", t.Name.Local): + case strings.EqualFold("IdcOnboardStatus", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33177,10 +34150,10 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - sv.ReservedNodeOfferingId = ptr.String(xtv) + sv.IdcOnboardStatus = ptr.String(xtv) } - case strings.EqualFold("ReservedNodeOfferingType", t.Name.Local): + case strings.EqualFold("IdentityNamespace", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33190,10 +34163,10 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - sv.ReservedNodeOfferingType = types.ReservedNodeOfferingType(xtv) + sv.IdentityNamespace = ptr.String(xtv) } - case strings.EqualFold("StartTime", t.Name.Local): + case strings.EqualFold("RedshiftIdcApplicationArn", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33203,14 +34176,10 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.StartTime = ptr.Time(t) + sv.RedshiftIdcApplicationArn = ptr.String(xtv) } - case strings.EqualFold("State", t.Name.Local): + case strings.EqualFold("RedshiftIdcApplicationName", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -33220,25 +34189,14 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder } { xtv := string(val) - sv.State = ptr.String(xtv) + sv.RedshiftIdcApplicationName = ptr.String(xtv) } - case strings.EqualFold("UsagePrice", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("ServiceIntegrations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServiceIntegrationList(&sv.ServiceIntegrations, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.UsagePrice = ptr.Float64(f64) - } default: // Do nothing and ignore the unexpected tag element @@ -33254,13 +34212,446 @@ func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder return nil } -func awsAwsquery_deserializeDocumentReservedNodeAlreadyExistsFault(v **types.ReservedNodeAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRedshiftIdcApplicationAlreadyExistsFault(v **types.RedshiftIdcApplicationAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ReservedNodeAlreadyExistsFault + var sv *types.RedshiftIdcApplicationAlreadyExistsFault if *v == nil { - sv = &types.ReservedNodeAlreadyExistsFault{} + sv = &types.RedshiftIdcApplicationAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRedshiftIdcApplicationList(v *[]types.RedshiftIdcApplication, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.RedshiftIdcApplication + if *v == nil { + sv = make([]types.RedshiftIdcApplication, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.RedshiftIdcApplication + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentRedshiftIdcApplication(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRedshiftIdcApplicationListUnwrapped(v *[]types.RedshiftIdcApplication, decoder smithyxml.NodeDecoder) error { + var sv []types.RedshiftIdcApplication + if *v == nil { + sv = make([]types.RedshiftIdcApplication, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.RedshiftIdcApplication + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentRedshiftIdcApplication(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentRedshiftIdcApplicationNotExistsFault(v **types.RedshiftIdcApplicationNotExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RedshiftIdcApplicationNotExistsFault + if *v == nil { + sv = &types.RedshiftIdcApplicationNotExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRedshiftIdcApplicationQuotaExceededFault(v **types.RedshiftIdcApplicationQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RedshiftIdcApplicationQuotaExceededFault + if *v == nil { + sv = &types.RedshiftIdcApplicationQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedNode(v **types.ReservedNode, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedNode + if *v == nil { + sv = &types.ReservedNode{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CurrencyCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CurrencyCode = ptr.String(xtv) + } + + case strings.EqualFold("Duration", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Duration = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("FixedPrice", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.FixedPrice = ptr.Float64(f64) + } + + case strings.EqualFold("NodeCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.NodeCount = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("NodeType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NodeType = ptr.String(xtv) + } + + case strings.EqualFold("OfferingType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OfferingType = ptr.String(xtv) + } + + case strings.EqualFold("RecurringCharges", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReservedNodeId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReservedNodeId = ptr.String(xtv) + } + + case strings.EqualFold("ReservedNodeOfferingId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReservedNodeOfferingId = ptr.String(xtv) + } + + case strings.EqualFold("ReservedNodeOfferingType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReservedNodeOfferingType = types.ReservedNodeOfferingType(xtv) + } + + case strings.EqualFold("StartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.StartTime = ptr.Time(t) + } + + case strings.EqualFold("State", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = ptr.String(xtv) + } + + case strings.EqualFold("UsagePrice", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.UsagePrice = ptr.Float64(f64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedNodeAlreadyExistsFault(v **types.ReservedNodeAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedNodeAlreadyExistsFault + if *v == nil { + sv = &types.ReservedNodeAlreadyExistsFault{} } else { sv = *v } @@ -35802,6 +37193,112 @@ func awsAwsquery_deserializeDocumentSecondaryClusterInfo(v **types.SecondaryClus return nil } +func awsAwsquery_deserializeDocumentServiceIntegrationList(v *[]types.ServiceIntegrationsUnion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ServiceIntegrationsUnion + if *v == nil { + sv = make([]types.ServiceIntegrationsUnion, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ServiceIntegrationsUnion + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServiceIntegrationsUnion(&col, nodeDecoder); err != nil { + return err + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentServiceIntegrationListUnwrapped(v *[]types.ServiceIntegrationsUnion, decoder smithyxml.NodeDecoder) error { + var sv []types.ServiceIntegrationsUnion + if *v == nil { + sv = make([]types.ServiceIntegrationsUnion, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ServiceIntegrationsUnion + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServiceIntegrationsUnion(&mv, nodeDecoder); err != nil { + return err + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentServiceIntegrationsUnion(v *types.ServiceIntegrationsUnion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var uv types.ServiceIntegrationsUnion + var memberFound bool + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + if memberFound { + if err = decoder.Decoder.Skip(); err != nil { + return err + } + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("LakeFormation", t.Name.Local): + var mv []types.LakeFormationScopeUnion + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLakeFormationServiceIntegrations(&mv, nodeDecoder); err != nil { + return err + } + uv = &types.ServiceIntegrationsUnionMemberLakeFormation{Value: mv} + memberFound = true + + default: + uv = &types.UnknownUnionMember{Tag: t.Name.Local} + memberFound = true + + } + decoder = originalDecoder + } + *v = uv + return nil +} + func awsAwsquery_deserializeDocumentSnapshot(v **types.Snapshot, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -41714,6 +43211,48 @@ func awsAwsquery_deserializeOpDocumentCreateHsmConfigurationOutput(v **CreateHsm return nil } +func awsAwsquery_deserializeOpDocumentCreateRedshiftIdcApplicationOutput(v **CreateRedshiftIdcApplicationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateRedshiftIdcApplicationOutput + if *v == nil { + sv = &CreateRedshiftIdcApplicationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("RedshiftIdcApplication", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRedshiftIdcApplication(&sv.RedshiftIdcApplication, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentCreateScheduledActionOutput(v **CreateScheduledActionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -44159,6 +45698,61 @@ func awsAwsquery_deserializeOpDocumentDescribePartnersOutput(v **DescribePartner return nil } +func awsAwsquery_deserializeOpDocumentDescribeRedshiftIdcApplicationsOutput(v **DescribeRedshiftIdcApplicationsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeRedshiftIdcApplicationsOutput + if *v == nil { + sv = &DescribeRedshiftIdcApplicationsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("RedshiftIdcApplications", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRedshiftIdcApplicationList(&sv.RedshiftIdcApplications, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentDescribeReservedNodeExchangeStatusOutput(v **DescribeReservedNodeExchangeStatusOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -46521,6 +48115,48 @@ func awsAwsquery_deserializeOpDocumentModifyEventSubscriptionOutput(v **ModifyEv return nil } +func awsAwsquery_deserializeOpDocumentModifyRedshiftIdcApplicationOutput(v **ModifyRedshiftIdcApplicationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyRedshiftIdcApplicationOutput + if *v == nil { + sv = &ModifyRedshiftIdcApplicationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("RedshiftIdcApplication", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRedshiftIdcApplication(&sv.RedshiftIdcApplication, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentModifyScheduledActionOutput(v **ModifyScheduledActionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/redshift/generated.json b/service/redshift/generated.json index cfa59f2b900..bd2b14a05d7 100644 --- a/service/redshift/generated.json +++ b/service/redshift/generated.json @@ -32,6 +32,7 @@ "api_op_CreateEventSubscription.go", "api_op_CreateHsmClientCertificate.go", "api_op_CreateHsmConfiguration.go", + "api_op_CreateRedshiftIdcApplication.go", "api_op_CreateScheduledAction.go", "api_op_CreateSnapshotCopyGrant.go", "api_op_CreateSnapshotSchedule.go", @@ -50,6 +51,7 @@ "api_op_DeleteHsmClientCertificate.go", "api_op_DeleteHsmConfiguration.go", "api_op_DeletePartner.go", + "api_op_DeleteRedshiftIdcApplication.go", "api_op_DeleteResourcePolicy.go", "api_op_DeleteScheduledAction.go", "api_op_DeleteSnapshotCopyGrant.go", @@ -84,6 +86,7 @@ "api_op_DescribeNodeConfigurationOptions.go", "api_op_DescribeOrderableClusterOptions.go", "api_op_DescribePartners.go", + "api_op_DescribeRedshiftIdcApplications.go", "api_op_DescribeReservedNodeExchangeStatus.go", "api_op_DescribeReservedNodeOfferings.go", "api_op_DescribeReservedNodes.go", @@ -119,6 +122,7 @@ "api_op_ModifyCustomDomainAssociation.go", "api_op_ModifyEndpointAccess.go", "api_op_ModifyEventSubscription.go", + "api_op_ModifyRedshiftIdcApplication.go", "api_op_ModifyScheduledAction.go", "api_op_ModifySnapshotCopyRetentionPeriod.go", "api_op_ModifySnapshotSchedule.go", @@ -153,6 +157,7 @@ "types/enums.go", "types/errors.go", "types/types.go", + "types/types_exported_test.go", "validators.go" ], "go": "1.15", diff --git a/service/redshift/serializers.go b/service/redshift/serializers.go index ebab83a8984..bc4991518e8 100644 --- a/service/redshift/serializers.go +++ b/service/redshift/serializers.go @@ -1424,6 +1424,70 @@ func (m *awsAwsquery_serializeOpCreateHsmConfiguration) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpCreateRedshiftIdcApplication struct { +} + +func (*awsAwsquery_serializeOpCreateRedshiftIdcApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateRedshiftIdcApplication) 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.(*CreateRedshiftIdcApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateRedshiftIdcApplication") + body.Key("Version").String("2012-12-01") + + if err := awsAwsquery_serializeOpDocumentCreateRedshiftIdcApplicationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsquery_serializeOpCreateScheduledAction struct { } @@ -2576,6 +2640,70 @@ func (m *awsAwsquery_serializeOpDeletePartner) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpDeleteRedshiftIdcApplication struct { +} + +func (*awsAwsquery_serializeOpDeleteRedshiftIdcApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteRedshiftIdcApplication) 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.(*DeleteRedshiftIdcApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteRedshiftIdcApplication") + body.Key("Version").String("2012-12-01") + + if err := awsAwsquery_serializeOpDocumentDeleteRedshiftIdcApplicationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsquery_serializeOpDeleteResourcePolicy struct { } @@ -4752,6 +4880,70 @@ func (m *awsAwsquery_serializeOpDescribePartners) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpDescribeRedshiftIdcApplications struct { +} + +func (*awsAwsquery_serializeOpDescribeRedshiftIdcApplications) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeRedshiftIdcApplications) 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.(*DescribeRedshiftIdcApplicationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeRedshiftIdcApplications") + body.Key("Version").String("2012-12-01") + + if err := awsAwsquery_serializeOpDocumentDescribeRedshiftIdcApplicationsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsquery_serializeOpDescribeReservedNodeExchangeStatus struct { } @@ -6988,6 +7180,70 @@ func (m *awsAwsquery_serializeOpModifyEventSubscription) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpModifyRedshiftIdcApplication struct { +} + +func (*awsAwsquery_serializeOpModifyRedshiftIdcApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyRedshiftIdcApplication) 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.(*ModifyRedshiftIdcApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyRedshiftIdcApplication") + body.Key("Version").String("2012-12-01") + + if err := awsAwsquery_serializeOpDocumentModifyRedshiftIdcApplicationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsquery_serializeOpModifyScheduledAction struct { } @@ -8213,6 +8469,47 @@ func awsAwsquery_serializeDocumentAttributeNameList(v []string, value query.Valu return nil } +func awsAwsquery_serializeDocumentAuthorizedAudienceList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentAuthorizedTokenIssuer(v *types.AuthorizedTokenIssuer, value query.Value) error { + object := value.Object() + _ = object + + if v.AuthorizedAudiencesList != nil { + objectKey := object.Key("AuthorizedAudiencesList") + if err := awsAwsquery_serializeDocumentAuthorizedAudienceList(v.AuthorizedAudiencesList, objectKey); err != nil { + return err + } + } + + if v.TrustedTokenIssuerArn != nil { + objectKey := object.Key("TrustedTokenIssuerArn") + objectKey.String(*v.TrustedTokenIssuerArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentAuthorizedTokenIssuerList(v []types.AuthorizedTokenIssuer, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentAuthorizedTokenIssuer(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsquery_serializeDocumentClusterSecurityGroupNameList(v []string, value query.Value) error { array := value.Array("ClusterSecurityGroupName") @@ -8282,6 +8579,50 @@ func awsAwsquery_serializeDocumentIamRoleArnList(v []string, value query.Value) return nil } +func awsAwsquery_serializeDocumentLakeFormationQuery(v *types.LakeFormationQuery, value query.Value) error { + object := value.Object() + _ = object + + if len(v.Authorization) > 0 { + objectKey := object.Key("Authorization") + objectKey.String(string(v.Authorization)) + } + + return nil +} + +func awsAwsquery_serializeDocumentLakeFormationScopeUnion(v types.LakeFormationScopeUnion, value query.Value) error { + object := value.Object() + + switch uv := v.(type) { + case *types.LakeFormationScopeUnionMemberLakeFormationQuery: + objectKey := object.Key("LakeFormationQuery") + if err := awsAwsquery_serializeDocumentLakeFormationQuery(&uv.Value, objectKey); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsAwsquery_serializeDocumentLakeFormationServiceIntegrations(v []types.LakeFormationScopeUnion, value query.Value) error { + array := value.Array("member") + + for i := range v { + if vv := v[i]; vv == nil { + continue + } + av := array.Value() + if err := awsAwsquery_serializeDocumentLakeFormationScopeUnion(v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsquery_serializeDocumentLogTypeList(v []string, value query.Value) error { array := value.Array("member") @@ -8527,6 +8868,38 @@ func awsAwsquery_serializeDocumentScheduleDefinitionList(v []string, value query return nil } +func awsAwsquery_serializeDocumentServiceIntegrationList(v []types.ServiceIntegrationsUnion, value query.Value) error { + array := value.Array("member") + + for i := range v { + if vv := v[i]; vv == nil { + continue + } + av := array.Value() + if err := awsAwsquery_serializeDocumentServiceIntegrationsUnion(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentServiceIntegrationsUnion(v types.ServiceIntegrationsUnion, value query.Value) error { + object := value.Object() + + switch uv := v.(type) { + case *types.ServiceIntegrationsUnionMemberLakeFormation: + objectKey := object.Key("LakeFormation") + if err := awsAwsquery_serializeDocumentLakeFormationServiceIntegrations(uv.Value, objectKey); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + func awsAwsquery_serializeDocumentSnapshotIdentifierList(v []string, value query.Value) error { array := value.Array("String") @@ -9108,6 +9481,11 @@ func awsAwsquery_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, va objectKey.Boolean(*v.PubliclyAccessible) } + if v.RedshiftIdcApplicationArn != nil { + objectKey := object.Key("RedshiftIdcApplicationArn") + objectKey.String(*v.RedshiftIdcApplicationArn) + } + if v.SnapshotScheduleIdentifier != nil { objectKey := object.Key("SnapshotScheduleIdentifier") objectKey.String(*v.SnapshotScheduleIdentifier) @@ -9415,6 +9793,52 @@ func awsAwsquery_serializeOpDocumentCreateHsmConfigurationInput(v *CreateHsmConf return nil } +func awsAwsquery_serializeOpDocumentCreateRedshiftIdcApplicationInput(v *CreateRedshiftIdcApplicationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AuthorizedTokenIssuerList != nil { + objectKey := object.Key("AuthorizedTokenIssuerList") + if err := awsAwsquery_serializeDocumentAuthorizedTokenIssuerList(v.AuthorizedTokenIssuerList, objectKey); err != nil { + return err + } + } + + if v.IamRoleArn != nil { + objectKey := object.Key("IamRoleArn") + objectKey.String(*v.IamRoleArn) + } + + if v.IdcDisplayName != nil { + objectKey := object.Key("IdcDisplayName") + objectKey.String(*v.IdcDisplayName) + } + + if v.IdcInstanceArn != nil { + objectKey := object.Key("IdcInstanceArn") + objectKey.String(*v.IdcInstanceArn) + } + + if v.IdentityNamespace != nil { + objectKey := object.Key("IdentityNamespace") + objectKey.String(*v.IdentityNamespace) + } + + if v.RedshiftIdcApplicationName != nil { + objectKey := object.Key("RedshiftIdcApplicationName") + objectKey.String(*v.RedshiftIdcApplicationName) + } + + if v.ServiceIntegrations != nil { + objectKey := object.Key("ServiceIntegrations") + if err := awsAwsquery_serializeDocumentServiceIntegrationList(v.ServiceIntegrations, objectKey); err != nil { + return err + } + } + + return nil +} + func awsAwsquery_serializeOpDocumentCreateScheduledActionInput(v *CreateScheduledActionInput, value query.Value) error { object := value.Object() _ = object @@ -9793,6 +10217,18 @@ func awsAwsquery_serializeOpDocumentDeletePartnerInput(v *DeletePartnerInput, va return nil } +func awsAwsquery_serializeOpDocumentDeleteRedshiftIdcApplicationInput(v *DeleteRedshiftIdcApplicationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.RedshiftIdcApplicationArn != nil { + objectKey := object.Key("RedshiftIdcApplicationArn") + objectKey.String(*v.RedshiftIdcApplicationArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, value query.Value) error { object := value.Object() _ = object @@ -10716,6 +11152,28 @@ func awsAwsquery_serializeOpDocumentDescribePartnersInput(v *DescribePartnersInp return nil } +func awsAwsquery_serializeOpDocumentDescribeRedshiftIdcApplicationsInput(v *DescribeRedshiftIdcApplicationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.RedshiftIdcApplicationArn != nil { + objectKey := object.Key("RedshiftIdcApplicationArn") + objectKey.String(*v.RedshiftIdcApplicationArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentDescribeReservedNodeExchangeStatusInput(v *DescribeReservedNodeExchangeStatusInput, value query.Value) error { object := value.Object() _ = object @@ -11754,6 +12212,47 @@ func awsAwsquery_serializeOpDocumentModifyEventSubscriptionInput(v *ModifyEventS return nil } +func awsAwsquery_serializeOpDocumentModifyRedshiftIdcApplicationInput(v *ModifyRedshiftIdcApplicationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AuthorizedTokenIssuerList != nil { + objectKey := object.Key("AuthorizedTokenIssuerList") + if err := awsAwsquery_serializeDocumentAuthorizedTokenIssuerList(v.AuthorizedTokenIssuerList, objectKey); err != nil { + return err + } + } + + if v.IamRoleArn != nil { + objectKey := object.Key("IamRoleArn") + objectKey.String(*v.IamRoleArn) + } + + if v.IdcDisplayName != nil { + objectKey := object.Key("IdcDisplayName") + objectKey.String(*v.IdcDisplayName) + } + + if v.IdentityNamespace != nil { + objectKey := object.Key("IdentityNamespace") + objectKey.String(*v.IdentityNamespace) + } + + if v.RedshiftIdcApplicationArn != nil { + objectKey := object.Key("RedshiftIdcApplicationArn") + objectKey.String(*v.RedshiftIdcApplicationArn) + } + + if v.ServiceIntegrations != nil { + objectKey := object.Key("ServiceIntegrations") + if err := awsAwsquery_serializeDocumentServiceIntegrationList(v.ServiceIntegrations, objectKey); err != nil { + return err + } + } + + return nil +} + func awsAwsquery_serializeOpDocumentModifyScheduledActionInput(v *ModifyScheduledActionInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/redshift/types/enums.go b/service/redshift/types/enums.go index 965dd3391db..da91323b748 100644 --- a/service/redshift/types/enums.go +++ b/service/redshift/types/enums.go @@ -415,6 +415,24 @@ func (ScheduleState) Values() []ScheduleState { } } +type ServiceAuthorization string + +// Enum values for ServiceAuthorization +const ( + ServiceAuthorizationEnabled ServiceAuthorization = "Enabled" + ServiceAuthorizationDisabled ServiceAuthorization = "Disabled" +) + +// Values returns all known values for ServiceAuthorization. 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 (ServiceAuthorization) Values() []ServiceAuthorization { + return []ServiceAuthorization{ + "Enabled", + "Disabled", + } +} + type SnapshotAttributeToSortBy string // Enum values for SnapshotAttributeToSortBy diff --git a/service/redshift/types/errors.go b/service/redshift/types/errors.go index d066bd4b039..69a055544e6 100644 --- a/service/redshift/types/errors.go +++ b/service/redshift/types/errors.go @@ -891,6 +891,32 @@ func (e *CustomDomainAssociationNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// A dependent service denied access for the integration. +type DependentServiceAccessDeniedFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DependentServiceAccessDeniedFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DependentServiceAccessDeniedFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DependentServiceAccessDeniedFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DependentServiceAccessDenied" + } + return *e.ErrorCodeOverride +} +func (e *DependentServiceAccessDeniedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The request cannot be completed because a dependent service is throttling // requests made by Amazon Redshift on your behalf. Wait and retry the request. type DependentServiceRequestThrottlingFault struct { @@ -2449,6 +2475,90 @@ func (e *PartnerNotFoundFault) ErrorCode() string { } func (e *PartnerNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The application you attempted to add already exists. +type RedshiftIdcApplicationAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RedshiftIdcApplicationAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RedshiftIdcApplicationAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RedshiftIdcApplicationAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RedshiftIdcApplicationAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *RedshiftIdcApplicationAlreadyExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The application you attempted to find doesn't exist. +type RedshiftIdcApplicationNotExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RedshiftIdcApplicationNotExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RedshiftIdcApplicationNotExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RedshiftIdcApplicationNotExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RedshiftIdcApplicationNotExists" + } + return *e.ErrorCodeOverride +} +func (e *RedshiftIdcApplicationNotExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The maximum number of Redshift IAM Identity Center applications was exceeded. +type RedshiftIdcApplicationQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RedshiftIdcApplicationQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RedshiftIdcApplicationQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RedshiftIdcApplicationQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RedshiftIdcApplicationQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *RedshiftIdcApplicationQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // User already has a reservation with the given identifier. type ReservedNodeAlreadyExistsFault struct { Message *string diff --git a/service/redshift/types/types.go b/service/redshift/types/types.go index b7566b9bffe..39a5f927c09 100644 --- a/service/redshift/types/types.go +++ b/service/redshift/types/types.go @@ -88,6 +88,21 @@ type AuthenticationProfile struct { noSmithyDocumentSerde } +// The authorized token issuer for the Amazon Redshift IAM Identity Center +// application. +type AuthorizedTokenIssuer struct { + + // The list of audiences for the authorized token issuer for integrating Amazon + // Redshift with IDC Identity Center. + AuthorizedAudiencesList []string + + // The ARN for the authorized token issuer for integrating Amazon Redshift with + // IDC Identity Center. + TrustedTokenIssuerArn *string + + noSmithyDocumentSerde +} + // Describes an availability zone. type AvailabilityZone struct { @@ -1073,6 +1088,35 @@ type IPRange struct { noSmithyDocumentSerde } +// The Lake Formation scope. +type LakeFormationQuery struct { + + // Determines whether the query scope is enabled or disabled. + // + // This member is required. + Authorization ServiceAuthorization + + noSmithyDocumentSerde +} + +// A list of scopes set up for Lake Formation integration. +// +// The following types satisfy this interface: +// +// LakeFormationScopeUnionMemberLakeFormationQuery +type LakeFormationScopeUnion interface { + isLakeFormationScopeUnion() +} + +// The Lake Formation scope. +type LakeFormationScopeUnionMemberLakeFormationQuery struct { + Value LakeFormationQuery + + noSmithyDocumentSerde +} + +func (*LakeFormationScopeUnionMemberLakeFormationQuery) isLakeFormationScopeUnion() {} + // Defines a maintenance track that determines which Amazon Redshift version to // apply during a maintenance window. If the value for MaintenanceTrack is current // , the cluster is updated to the most recently certified maintenance release. If @@ -1304,6 +1348,46 @@ type RecurringCharge struct { noSmithyDocumentSerde } +// Contains properties for the Redshift IDC application. +type RedshiftIdcApplication struct { + + // The authorized token issuer list for the Amazon Redshift IAM Identity Center + // application. + AuthorizedTokenIssuerList []AuthorizedTokenIssuer + + // The ARN for the Amazon Redshift IAM Identity Center application. It has the + // required permissions to be assumed and invoke the IDC Identity Center API. + IamRoleArn *string + + // The display name for the Amazon Redshift IAM Identity Center application. It + // appears on the console. + IdcDisplayName *string + + // The ARN for the IAM Identity Center instance that Redshift integrates with. + IdcInstanceArn *string + + // The ARN for the Amazon Redshift IAM Identity Center application. + IdcManagedApplicationArn *string + + // The onboarding status for the Amazon Redshift IAM Identity Center application. + IdcOnboardStatus *string + + // The identity namespace for the Amazon Redshift IAM Identity Center application. + // It determines which managed application verifies the connection token. + IdentityNamespace *string + + // The ARN for the Redshift application that integrates with IAM Identity Center. + RedshiftIdcApplicationArn *string + + // The name of the Redshift application in IAM Identity Center. + RedshiftIdcApplicationName *string + + // A list of service integrations for the Redshift IAM Identity Center application. + ServiceIntegrations []ServiceIntegrationsUnion + + noSmithyDocumentSerde +} + // Describes a reserved node. You can call the DescribeReservedNodeOfferings API // to obtain the available reserved node offerings. type ReservedNode struct { @@ -1669,6 +1753,24 @@ type SecondaryClusterInfo struct { noSmithyDocumentSerde } +// A list of service integrations. +// +// The following types satisfy this interface: +// +// ServiceIntegrationsUnionMemberLakeFormation +type ServiceIntegrationsUnion interface { + isServiceIntegrationsUnion() +} + +// A list of scopes set up for Lake Formation integration. +type ServiceIntegrationsUnionMemberLakeFormation struct { + Value []LakeFormationScopeUnion + + noSmithyDocumentSerde +} + +func (*ServiceIntegrationsUnionMemberLakeFormation) isServiceIntegrationsUnion() {} + // Describes a snapshot. type Snapshot struct { @@ -2098,3 +2200,15 @@ type VpcSecurityGroupMembership struct { } 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) isLakeFormationScopeUnion() {} +func (*UnknownUnionMember) isServiceIntegrationsUnion() {} diff --git a/service/redshift/types/types_exported_test.go b/service/redshift/types/types_exported_test.go new file mode 100644 index 00000000000..5585fc259ba --- /dev/null +++ b/service/redshift/types/types_exported_test.go @@ -0,0 +1,44 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/redshift/types" +) + +func ExampleLakeFormationScopeUnion_outputUsage() { + var union types.LakeFormationScopeUnion + // type switches can be used to check the union value + switch v := union.(type) { + case *types.LakeFormationScopeUnionMemberLakeFormationQuery: + _ = v.Value // Value is types.LakeFormationQuery + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.LakeFormationQuery + +func ExampleServiceIntegrationsUnion_outputUsage() { + var union types.ServiceIntegrationsUnion + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ServiceIntegrationsUnionMemberLakeFormation: + _ = v.Value // Value is []types.LakeFormationScopeUnion + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ []types.LakeFormationScopeUnion diff --git a/service/redshift/validators.go b/service/redshift/validators.go index add9961426c..72bdb0ca869 100644 --- a/service/redshift/validators.go +++ b/service/redshift/validators.go @@ -450,6 +450,26 @@ func (m *validateOpCreateHsmConfiguration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCreateRedshiftIdcApplication struct { +} + +func (*validateOpCreateRedshiftIdcApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRedshiftIdcApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRedshiftIdcApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRedshiftIdcApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateScheduledAction struct { } @@ -790,6 +810,26 @@ func (m *validateOpDeletePartner) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteRedshiftIdcApplication struct { +} + +func (*validateOpDeleteRedshiftIdcApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRedshiftIdcApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRedshiftIdcApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRedshiftIdcApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteResourcePolicy struct { } @@ -1530,6 +1570,26 @@ func (m *validateOpModifyEventSubscription) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpModifyRedshiftIdcApplication struct { +} + +func (*validateOpModifyRedshiftIdcApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyRedshiftIdcApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyRedshiftIdcApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyRedshiftIdcApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpModifyScheduledAction struct { } @@ -1978,6 +2038,10 @@ func addOpCreateHsmConfigurationValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpCreateHsmConfiguration{}, middleware.After) } +func addOpCreateRedshiftIdcApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRedshiftIdcApplication{}, middleware.After) +} + func addOpCreateScheduledActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateScheduledAction{}, middleware.After) } @@ -2046,6 +2110,10 @@ func addOpDeletePartnerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePartner{}, middleware.After) } +func addOpDeleteRedshiftIdcApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRedshiftIdcApplication{}, middleware.After) +} + func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) } @@ -2194,6 +2262,10 @@ func addOpModifyEventSubscriptionValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpModifyEventSubscription{}, middleware.After) } +func addOpModifyRedshiftIdcApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyRedshiftIdcApplication{}, middleware.After) +} + func addOpModifyScheduledActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpModifyScheduledAction{}, middleware.After) } @@ -2298,6 +2370,57 @@ func validateDeleteClusterSnapshotMessageList(v []types.DeleteClusterSnapshotMes } } +func validateLakeFormationQuery(v *types.LakeFormationQuery) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LakeFormationQuery"} + if len(v.Authorization) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Authorization")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLakeFormationScopeUnion(v types.LakeFormationScopeUnion) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LakeFormationScopeUnion"} + switch uv := v.(type) { + case *types.LakeFormationScopeUnionMemberLakeFormationQuery: + if err := validateLakeFormationQuery(&uv.Value); err != nil { + invalidParams.AddNested("[LakeFormationQuery]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLakeFormationServiceIntegrations(v []types.LakeFormationScopeUnion) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LakeFormationServiceIntegrations"} + for i := range v { + if err := validateLakeFormationScopeUnion(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validatePauseClusterMessage(v *types.PauseClusterMessage) error { if v == nil { return nil @@ -2405,6 +2528,42 @@ func validateScheduledActionType(v *types.ScheduledActionType) error { } } +func validateServiceIntegrationList(v []types.ServiceIntegrationsUnion) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ServiceIntegrationList"} + for i := range v { + if err := validateServiceIntegrationsUnion(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateServiceIntegrationsUnion(v types.ServiceIntegrationsUnion) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ServiceIntegrationsUnion"} + switch uv := v.(type) { + case *types.ServiceIntegrationsUnionMemberLakeFormation: + if err := validateLakeFormationServiceIntegrations(uv.Value); err != nil { + invalidParams.AddNested("[LakeFormation]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSnapshotSortingEntity(v *types.SnapshotSortingEntity) error { if v == nil { return nil @@ -2843,6 +3002,35 @@ func validateOpCreateHsmConfigurationInput(v *CreateHsmConfigurationInput) error } } +func validateOpCreateRedshiftIdcApplicationInput(v *CreateRedshiftIdcApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRedshiftIdcApplicationInput"} + if v.IdcInstanceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdcInstanceArn")) + } + if v.RedshiftIdcApplicationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RedshiftIdcApplicationName")) + } + if v.IdcDisplayName == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdcDisplayName")) + } + if v.IamRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("IamRoleArn")) + } + if v.ServiceIntegrations != nil { + if err := validateServiceIntegrationList(v.ServiceIntegrations); err != nil { + invalidParams.AddNested("ServiceIntegrations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateScheduledActionInput(v *CreateScheduledActionInput) error { if v == nil { return nil @@ -3138,6 +3326,21 @@ func validateOpDeletePartnerInput(v *DeletePartnerInput) error { } } +func validateOpDeleteRedshiftIdcApplicationInput(v *DeleteRedshiftIdcApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRedshiftIdcApplicationInput"} + if v.RedshiftIdcApplicationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RedshiftIdcApplicationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { if v == nil { return nil @@ -3724,6 +3927,26 @@ func validateOpModifyEventSubscriptionInput(v *ModifyEventSubscriptionInput) err } } +func validateOpModifyRedshiftIdcApplicationInput(v *ModifyRedshiftIdcApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyRedshiftIdcApplicationInput"} + if v.RedshiftIdcApplicationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RedshiftIdcApplicationArn")) + } + if v.ServiceIntegrations != nil { + if err := validateServiceIntegrationList(v.ServiceIntegrations); err != nil { + invalidParams.AddNested("ServiceIntegrations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpModifyScheduledActionInput(v *ModifyScheduledActionInput) error { if v == nil { return nil diff --git a/service/redshiftserverless/api_op_CreateNamespace.go b/service/redshiftserverless/api_op_CreateNamespace.go index a61ea82c498..da43f7df36d 100644 --- a/service/redshiftserverless/api_op_CreateNamespace.go +++ b/service/redshiftserverless/api_op_CreateNamespace.go @@ -72,6 +72,9 @@ type CreateNamespaceInput struct { // for the admin user account's password. ManageAdminPassword *bool + // The ARN for the Redshift application that integrates with IAM Identity Center. + RedshiftIdcApplicationArn *string + // A list of tag instances. Tags []types.Tag diff --git a/service/redshiftserverless/serializers.go b/service/redshiftserverless/serializers.go index a7b5c51b3e8..e2d66c84967 100644 --- a/service/redshiftserverless/serializers.go +++ b/service/redshiftserverless/serializers.go @@ -2756,6 +2756,11 @@ func awsAwsjson11_serializeOpDocumentCreateNamespaceInput(v *CreateNamespaceInpu ok.String(*v.NamespaceName) } + if v.RedshiftIdcApplicationArn != nil { + ok := object.Key("redshiftIdcApplicationArn") + ok.String(*v.RedshiftIdcApplicationArn) + } + if v.Tags != nil { ok := object.Key("tags") if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { diff --git a/service/servicecatalogappregistry/internal/endpoints/endpoints.go b/service/servicecatalogappregistry/internal/endpoints/endpoints.go index e3db484713e..81ca42f0165 100644 --- a/service/servicecatalogappregistry/internal/endpoints/endpoints.go +++ b/service/servicecatalogappregistry/internal/endpoints/endpoints.go @@ -250,6 +250,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, diff --git a/service/ssoadmin/deserializers.go b/service/ssoadmin/deserializers.go index 65bb4efe48d..02e624cdb6d 100644 --- a/service/ssoadmin/deserializers.go +++ b/service/ssoadmin/deserializers.go @@ -10847,6 +10847,26 @@ loop: uv = &types.GrantMemberJwtBearer{Value: mv} break loop + case "RefreshToken": + var mv types.RefreshTokenGrant + destAddr := &mv + if err := awsAwsjson11_deserializeDocumentRefreshTokenGrant(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.GrantMemberRefreshToken{Value: mv} + break loop + + case "TokenExchange": + var mv types.TokenExchangeGrant + destAddr := &mv + if err := awsAwsjson11_deserializeDocumentTokenExchangeGrant(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.GrantMemberTokenExchange{Value: mv} + break loop + default: uv = &types.UnknownUnionMember{Tag: key} break loop @@ -11722,6 +11742,37 @@ func awsAwsjson11_deserializeDocumentRedirectUris(v *[]string, value interface{} return nil } +func awsAwsjson11_deserializeDocumentRefreshTokenGrant(v **types.RefreshTokenGrant, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RefreshTokenGrant + if *v == nil { + sv = &types.RefreshTokenGrant{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12209,6 +12260,37 @@ func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingExc return nil } +func awsAwsjson11_deserializeDocumentTokenExchangeGrant(v **types.TokenExchangeGrant, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TokenExchangeGrant + if *v == nil { + sv = &types.TokenExchangeGrant{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTokenIssuerAudiences(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ssoadmin/serializers.go b/service/ssoadmin/serializers.go index 1b1f2d3624a..df675f907b0 100644 --- a/service/ssoadmin/serializers.go +++ b/service/ssoadmin/serializers.go @@ -4201,6 +4201,18 @@ func awsAwsjson11_serializeDocumentGrant(v types.Grant, value smithyjson.Value) return err } + case *types.GrantMemberRefreshToken: + av := object.Key("RefreshToken") + if err := awsAwsjson11_serializeDocumentRefreshTokenGrant(&uv.Value, av); err != nil { + return err + } + + case *types.GrantMemberTokenExchange: + av := object.Key("TokenExchange") + if err := awsAwsjson11_serializeDocumentTokenExchangeGrant(&uv.Value, av); err != nil { + return err + } + default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) @@ -4401,6 +4413,13 @@ func awsAwsjson11_serializeDocumentRedirectUris(v []string, value smithyjson.Val return nil } +func awsAwsjson11_serializeDocumentRefreshTokenGrant(v *types.RefreshTokenGrant, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + func awsAwsjson11_serializeDocumentScopeTargets(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4470,6 +4489,13 @@ func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value return nil } +func awsAwsjson11_serializeDocumentTokenExchangeGrant(v *types.TokenExchangeGrant, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + func awsAwsjson11_serializeDocumentTokenIssuerAudiences(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/ssoadmin/types/types.go b/service/ssoadmin/types/types.go index a14c221c642..b62f438b281 100644 --- a/service/ssoadmin/types/types.go +++ b/service/ssoadmin/types/types.go @@ -288,10 +288,12 @@ type AuthenticationMethodItem struct { noSmithyDocumentSerde } -// ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ +// A structure that defines configuration settings for an application that +// supports the OAuth 2.0 Authorization Code Grant. type AuthorizationCodeGrant struct { - // ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ + // A list of URIs that are valid locations to redirect a user's browser after the + // user is authorized. RedirectUris []string noSmithyDocumentSerde @@ -346,17 +348,21 @@ type DisplayData struct { noSmithyDocumentSerde } -// ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ +// The Grant union represents the set of possible configuration options for the +// selected grant type. Exactly one member of the union must be specified, and must +// match the grant type selected. // // The following types satisfy this interface: // // GrantMemberAuthorizationCode // GrantMemberJwtBearer +// GrantMemberRefreshToken +// GrantMemberTokenExchange type Grant interface { isGrant() } -// ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ +// Configuration options for the authorization_code grant type. type GrantMemberAuthorizationCode struct { Value AuthorizationCodeGrant @@ -365,7 +371,8 @@ type GrantMemberAuthorizationCode struct { func (*GrantMemberAuthorizationCode) isGrant() {} -// ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ +// Configuration options for the urn:ietf:params:oauth:grant-type:jwt-bearer grant +// type. type GrantMemberJwtBearer struct { Value JwtBearerGrant @@ -374,15 +381,34 @@ type GrantMemberJwtBearer struct { func (*GrantMemberJwtBearer) isGrant() {} -// ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ +// Configuration options for the refresh_token grant type. +type GrantMemberRefreshToken struct { + Value RefreshTokenGrant + + noSmithyDocumentSerde +} + +func (*GrantMemberRefreshToken) isGrant() {} + +// Configuration options for the urn:ietf:params:oauth:grant-type:token-exchange +// grant type. +type GrantMemberTokenExchange struct { + Value TokenExchangeGrant + + noSmithyDocumentSerde +} + +func (*GrantMemberTokenExchange) isGrant() {} + +// A structure that defines a single grant and its configuration. type GrantItem struct { - // ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ + // The configuration structure for the selected grant. // // This member is required. Grant Grant - // ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ + // The type of the selected grant. // // This member is required. GrantType GrantType @@ -443,10 +469,12 @@ type InstanceMetadata struct { noSmithyDocumentSerde } -// ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ +// A structure that defines configuration settings for an application that +// supports the JWT Bearer Token Authorization Grant. type JwtBearerGrant struct { - // ~~~[ TODO: ADD DESCRIPTION HERE ]~~~ + // A list of allowed token issuers trusted by the Identity Center instances for + // this application. AuthorizedTokenIssuers []AuthorizedTokenIssuer noSmithyDocumentSerde @@ -664,6 +692,12 @@ type PortalOptions struct { noSmithyDocumentSerde } +// A structure that defines configuration settings for an application that +// supports the OAuth 2.0 Refresh Token Grant. +type RefreshTokenGrant struct { + noSmithyDocumentSerde +} + // A structure that describes the configuration of a resource server. type ResourceServerConfig struct { @@ -740,6 +774,12 @@ type Tag struct { noSmithyDocumentSerde } +// A structure that defines configuration settings for an application that +// supports the OAuth 2.0 Token Exchange Grant. +type TokenExchangeGrant struct { + noSmithyDocumentSerde +} + // A structure that describes the configuration of a trusted token issuer. The // structure and available settings are determined by the type of the trusted token // issuer. @@ -801,6 +841,8 @@ type TrustedTokenIssuerUpdateConfigurationMemberOidcJwtConfiguration struct { func (*TrustedTokenIssuerUpdateConfigurationMemberOidcJwtConfiguration) isTrustedTokenIssuerUpdateConfiguration() { } +// A structure that describes the options for the access portal associated with an +// application that can be updated. type UpdateApplicationPortalOptions struct { // A structure that describes the sign-in options for an application portal. diff --git a/service/ssoadmin/types/types_exported_test.go b/service/ssoadmin/types/types_exported_test.go index 3e526ec020a..de91cc25040 100644 --- a/service/ssoadmin/types/types_exported_test.go +++ b/service/ssoadmin/types/types_exported_test.go @@ -35,6 +35,12 @@ func ExampleGrant_outputUsage() { case *types.GrantMemberJwtBearer: _ = v.Value // Value is types.JwtBearerGrant + case *types.GrantMemberRefreshToken: + _ = v.Value // Value is types.RefreshTokenGrant + + case *types.GrantMemberTokenExchange: + _ = v.Value // Value is types.TokenExchangeGrant + case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) @@ -46,6 +52,8 @@ func ExampleGrant_outputUsage() { var _ *types.JwtBearerGrant var _ *types.AuthorizationCodeGrant +var _ *types.RefreshTokenGrant +var _ *types.TokenExchangeGrant func ExampleTrustedTokenIssuerConfiguration_outputUsage() { var union types.TrustedTokenIssuerConfiguration diff --git a/service/ssooidc/api_op_CreateToken.go b/service/ssooidc/api_op_CreateToken.go index 73a49e69965..42464294141 100644 --- a/service/ssooidc/api_op_CreateToken.go +++ b/service/ssooidc/api_op_CreateToken.go @@ -10,9 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates and returns an access token for the authorized client. The access token -// issued will be used to fetch short-term credentials for the assigned roles in -// the AWS account. +// Creates and returns access and refresh tokens for clients that are +// authenticated using client secrets. The access token can be used to fetch +// short-term credentials for the assigned AWS accounts or to access application +// APIs using bearer authentication. func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optFns ...func(*Options)) (*CreateTokenOutput, error) { if params == nil { params = &CreateTokenInput{} @@ -30,8 +31,8 @@ func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optF type CreateTokenInput struct { - // The unique identifier string for each client. This value should come from the - // persisted result of the RegisterClient API. + // The unique identifier string for the client or application. This value comes + // from the result of the RegisterClient API. // // This member is required. ClientId *string @@ -42,37 +43,42 @@ type CreateTokenInput struct { // This member is required. ClientSecret *string - // Supports grant types for the authorization code, refresh token, and device code - // request. For device code requests, specify the following value: - // urn:ietf:params:oauth:grant-type:device_code For information about how to - // obtain the device code, see the StartDeviceAuthorization topic. + // Supports the following OAuth grant types: Device Code and Refresh Token. + // Specify either of the following values, depending on the grant type that you + // want: * Device Code - urn:ietf:params:oauth:grant-type:device_code * Refresh + // Token - refresh_token For information about how to obtain the device code, see + // the StartDeviceAuthorization topic. // // This member is required. GrantType *string - // The authorization code received from the authorization service. This parameter - // is required to perform an authorization grant request to get access to a token. + // Used only when calling this API for the Authorization Code grant type. The + // short-term code is used to identify this authorization request. This grant type + // is currently unsupported for the CreateToken API. Code *string - // Used only when calling this API for the device code grant type. This short-term - // code is used to identify this authentication attempt. This should come from an - // in-memory reference to the result of the StartDeviceAuthorization API. + // Used only when calling this API for the Device Code grant type. This short-term + // code is used to identify this authorization request. This comes from the result + // of the StartDeviceAuthorization API. DeviceCode *string - // The location of the application that will receive the authorization code. Users - // authorize the service to send the request to this location. + // Used only when calling this API for the Authorization Code grant type. This + // value specifies the location of the client or application that has registered to + // receive the authorization code. RedirectUri *string - // Currently, refreshToken is not yet implemented and is not supported. For more - // information about the features and limitations of the current IAM Identity - // Center OIDC implementation, see Considerations for Using this Guide in the IAM - // Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) - // . The token used to obtain an access token in the event that the access token is - // invalid or expired. + // Used only when calling this API for the Refresh Token grant type. This token is + // used to refresh short-term tokens, such as the access token, that might expire. + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . RefreshToken *string - // The list of scopes that is defined by the client. Upon authorization, this list - // is used to restrict permissions when granting an access token. + // The list of scopes for which authorization is requested. The access token that + // is issued is limited to the scopes that are granted. If this value is not + // specified, IAM Identity Center authorizes all scopes that are configured for the + // client during the call to RegisterClient . Scope []string noSmithyDocumentSerde @@ -80,29 +86,30 @@ type CreateTokenInput struct { type CreateTokenOutput struct { - // An opaque token to access IAM Identity Center resources assigned to a user. + // A bearer token to access AWS accounts and applications assigned to a user. AccessToken *string // Indicates the time in seconds when an access token will expire. ExpiresIn int32 - // Currently, idToken is not yet implemented and is not supported. For more - // information about the features and limitations of the current IAM Identity - // Center OIDC implementation, see Considerations for Using this Guide in the IAM - // Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) - // . The identifier of the user that associated with the access token, if present. + // The idToken is not implemented or supported. For more information about the + // features and limitations of the current IAM Identity Center OIDC implementation, + // see Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . A JSON Web Token (JWT) that identifies who is associated with the issued + // access token. IdToken *string - // Currently, refreshToken is not yet implemented and is not supported. For more - // information about the features and limitations of the current IAM Identity - // Center OIDC implementation, see Considerations for Using this Guide in the IAM - // Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) - // . A token that, if present, can be used to refresh a previously issued access - // token that might have expired. + // A token that, if present, can be used to refresh a previously issued access + // token that might have expired. For more information about the features and + // limitations of the current IAM Identity Center OIDC implementation, see + // Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . RefreshToken *string // Used to notify the client that the returned token is an access token. The - // supported type is BearerToken . + // supported token type is Bearer . TokenType *string // Metadata pertaining to the operation's result. diff --git a/service/ssooidc/api_op_CreateTokenWithIAM.go b/service/ssooidc/api_op_CreateTokenWithIAM.go new file mode 100644 index 00000000000..ed4b98f7631 --- /dev/null +++ b/service/ssooidc/api_op_CreateTokenWithIAM.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and returns access and refresh tokens for clients and applications that +// are authenticated using IAM entities. The access token can be used to fetch +// short-term credentials for the assigned AWS accounts or to access application +// APIs using bearer authentication. +func (c *Client) CreateTokenWithIAM(ctx context.Context, params *CreateTokenWithIAMInput, optFns ...func(*Options)) (*CreateTokenWithIAMOutput, error) { + if params == nil { + params = &CreateTokenWithIAMInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTokenWithIAM", params, optFns, c.addOperationCreateTokenWithIAMMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTokenWithIAMOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTokenWithIAMInput struct { + + // The unique identifier string for the client or application. This value is an + // application ARN that has OAuth grants configured. + // + // This member is required. + ClientId *string + + // Supports the following OAuth grant types: Authorization Code, Refresh Token, + // JWT Bearer, and Token Exchange. Specify one of the following values, depending + // on the grant type that you want: * Authorization Code - authorization_code * + // Refresh Token - refresh_token * JWT Bearer - + // urn:ietf:params:oauth:grant-type:jwt-bearer * Token Exchange - + // urn:ietf:params:oauth:grant-type:token-exchange + // + // This member is required. + GrantType *string + + // Used only when calling this API for the JWT Bearer grant type. This value + // specifies the JSON Web Token (JWT) issued by a trusted token issuer. To + // authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the + // application. + Assertion *string + + // Used only when calling this API for the Authorization Code grant type. This + // short-term code is used to identify this authorization request. The code is + // obtained through a redirect from IAM Identity Center to a redirect URI persisted + // in the Authorization Code GrantOptions for the application. + Code *string + + // Used only when calling this API for the Authorization Code grant type. This + // value specifies the location of the client or application that has registered to + // receive the authorization code. + RedirectUri *string + + // Used only when calling this API for the Refresh Token grant type. This token is + // used to refresh short-term tokens, such as the access token, that might expire. + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . + RefreshToken *string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the type of token that the requester can receive. The following values + // are supported: * Access Token - urn:ietf:params:oauth:token-type:access_token * + // Refresh Token - urn:ietf:params:oauth:token-type:refresh_token + RequestedTokenType *string + + // The list of scopes for which authorization is requested. The access token that + // is issued is limited to the scopes that are granted. If the value is not + // specified, IAM Identity Center authorizes all scopes configured for the + // application, including the following default scopes: openid , aws , + // sts:identity_context . + Scope []string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the subject of the exchange. The value of the subject token must be an + // access token issued by IAM Identity Center to a different client or application. + // The access token must have authorized scopes that indicate the requested + // application as a target audience. + SubjectToken *string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the type of token that is passed as the subject of the exchange. The + // following value is supported: * Access Token - + // urn:ietf:params:oauth:token-type:access_token + SubjectTokenType *string + + noSmithyDocumentSerde +} + +type CreateTokenWithIAMOutput struct { + + // A bearer token to access AWS accounts and applications assigned to a user. + AccessToken *string + + // Indicates the time in seconds when an access token will expire. + ExpiresIn int32 + + // A JSON Web Token (JWT) that identifies the user associated with the issued + // access token. + IdToken *string + + // Indicates the type of tokens that are issued by IAM Identity Center. The + // following values are supported: * Access Token - + // urn:ietf:params:oauth:token-type:access_token * Refresh Token - + // urn:ietf:params:oauth:token-type:refresh_token + IssuedTokenType *string + + // A token that, if present, can be used to refresh a previously issued access + // token that might have expired. For more information about the features and + // limitations of the current IAM Identity Center OIDC implementation, see + // Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . + RefreshToken *string + + // The list of scopes for which authorization is granted. The access token that is + // issued is limited to the scopes that are granted. + Scope []string + + // Used to notify the requester that the returned token is an access token. The + // supported token type is Bearer . + TokenType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTokenWithIAM{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTokenWithIAM{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTokenWithIAM"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTokenWithIAM(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateTokenWithIAM(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateTokenWithIAM", + } +} diff --git a/service/ssooidc/api_op_RegisterClient.go b/service/ssooidc/api_op_RegisterClient.go index 249c9418eef..7aee9049166 100644 --- a/service/ssooidc/api_op_RegisterClient.go +++ b/service/ssooidc/api_op_RegisterClient.go @@ -50,7 +50,7 @@ type RegisterClientInput struct { type RegisterClientOutput struct { - // The endpoint where the client can request authorization. + // An endpoint that the client can use to request authorization. AuthorizationEndpoint *string // The unique identifier string for each client. This client uses this identifier @@ -67,7 +67,7 @@ type RegisterClientOutput struct { // Indicates the time at which the clientId and clientSecret will become invalid. ClientSecretExpiresAt int64 - // The endpoint where the client can get an access token. + // An endpoint that the client can use to create tokens. TokenEndpoint *string // Metadata pertaining to the operation's result. diff --git a/service/ssooidc/api_op_StartDeviceAuthorization.go b/service/ssooidc/api_op_StartDeviceAuthorization.go index 65582f80d0f..d30349e6b29 100644 --- a/service/ssooidc/api_op_StartDeviceAuthorization.go +++ b/service/ssooidc/api_op_StartDeviceAuthorization.go @@ -42,8 +42,8 @@ type StartDeviceAuthorizationInput struct { // This member is required. ClientSecret *string - // The URL for the AWS access portal. For more information, see Using the AWS - // access portal (https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html) + // The URL for the Amazon Web Services access portal. For more information, see + // Using the Amazon Web Services access portal (https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html) // in the IAM Identity Center User Guide. // // This member is required. diff --git a/service/ssooidc/auth.go b/service/ssooidc/auth.go index e9678e85608..2562611a471 100644 --- a/service/ssooidc/auth.go +++ b/service/ssooidc/auth.go @@ -115,7 +115,7 @@ func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { SchemeID: smithyauth.SchemeIDSigV4, SignerProperties: func() smithy.Properties { var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "awsssooidc") + smithyhttp.SetSigV4SigningName(&props, "sso-oauth") smithyhttp.SetSigV4SigningRegion(&props, params.Region) return props }(), diff --git a/service/ssooidc/deserializers.go b/service/ssooidc/deserializers.go index ca30d22f97b..76a1160eceb 100644 --- a/service/ssooidc/deserializers.go +++ b/service/ssooidc/deserializers.go @@ -239,6 +239,244 @@ func awsRestjson1_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput, return nil } +type awsRestjson1_deserializeOpCreateTokenWithIAM struct { +} + +func (*awsRestjson1_deserializeOpCreateTokenWithIAM) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateTokenWithIAM) HandleDeserialize(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_deserializeOpErrorCreateTokenWithIAM(response, &metadata) + } + output := &CreateTokenWithIAMOutput{} + 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_deserializeOpDocumentCreateTokenWithIAMOutput(&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_deserializeOpErrorCreateTokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("AuthorizationPendingException", errorCode): + return awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody) + + case strings.EqualFold("ExpiredTokenException", errorCode): + return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidClientException", errorCode): + return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) + + case strings.EqualFold("InvalidGrantException", errorCode): + return awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidRequestRegionException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestRegionException(response, errorBody) + + case strings.EqualFold("InvalidScopeException", errorCode): + return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) + + case strings.EqualFold("SlowDownException", errorCode): + return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + case strings.EqualFold("UnsupportedGrantTypeException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(v **CreateTokenWithIAMOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateTokenWithIAMOutput + if *v == nil { + sv = &CreateTokenWithIAMOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessToken to be of type string, got %T instead", value) + } + sv.AccessToken = ptr.String(jtv) + } + + case "expiresIn": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiresIn = int32(i64) + } + + case "idToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdToken to be of type string, got %T instead", value) + } + sv.IdToken = ptr.String(jtv) + } + + case "issuedTokenType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TokenTypeURI to be of type string, got %T instead", value) + } + sv.IssuedTokenType = ptr.String(jtv) + } + + case "refreshToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value) + } + sv.RefreshToken = ptr.String(jtv) + } + + case "scope": + if err := awsRestjson1_deserializeDocumentScopes(&sv.Scope, value); err != nil { + return err + } + + case "tokenType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TokenType to be of type string, got %T instead", value) + } + sv.TokenType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpRegisterClient struct { } @@ -956,6 +1194,42 @@ func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.R return output } +func awsRestjson1_deserializeErrorInvalidRequestRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestRegionException{} + 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_deserializeDocumentInvalidRequestRegionException(&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_deserializeErrorInvalidScopeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidScopeException{} var buff [1024]byte @@ -1492,6 +1766,73 @@ func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRe return nil } +func awsRestjson1_deserializeDocumentInvalidRequestRegionException(v **types.InvalidRequestRegionException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.InvalidRequestRegionException + if *v == nil { + sv = &types.InvalidRequestRegionException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Location to be of type string, got %T instead", value) + } + sv.Endpoint = ptr.String(jtv) + } + + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Region to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScopeException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1541,6 +1882,42 @@ func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScop return nil } +func awsRestjson1_deserializeDocumentScopes(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 Scope to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentSlowDownException(v **types.SlowDownException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ssooidc/doc.go b/service/ssooidc/doc.go index 2239427d889..53cd4f55a03 100644 --- a/service/ssooidc/doc.go +++ b/service/ssooidc/doc.go @@ -3,31 +3,33 @@ // Package ssooidc provides the API client, operations, and parameter types for // AWS SSO OIDC. // -// AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) -// is a web service that enables a client (such as AWS CLI or a native application) -// to register with IAM Identity Center. The service also enables the client to -// fetch the user’s access token upon successful authentication and authorization -// with IAM Identity Center. Although AWS Single Sign-On was renamed, the sso and -// identitystore API namespaces will continue to retain their original name for -// backward compatibility purposes. For more information, see IAM Identity Center -// rename (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed) -// . Considerations for Using This Guide Before you begin using this guide, we -// recommend that you first review the following important information about how -// the IAM Identity Center OIDC service works. +// IAM Identity Center OpenID Connect (OIDC) is a web service that enables a +// client (such as CLI or a native application) to register with IAM Identity +// Center. The service also enables the client to fetch the user’s access token +// upon successful authentication and authorization with IAM Identity Center. IAM +// Identity Center uses the sso and identitystore API namespaces. Considerations +// for Using This Guide Before you begin using this guide, we recommend that you +// first review the following important information about how the IAM Identity +// Center OIDC service works. // - The IAM Identity Center OIDC service currently implements only the portions // of the OAuth 2.0 Device Authorization Grant standard ( // https://tools.ietf.org/html/rfc8628 (https://tools.ietf.org/html/rfc8628) ) -// that are necessary to enable single sign-on authentication with the AWS CLI. -// Support for other OIDC flows frequently needed for native applications, such as -// Authorization Code Flow (+ PKCE), will be addressed in future releases. -// - The service emits only OIDC access tokens, such that obtaining a new token -// (For example, token refresh) requires explicit user re-authentication. -// - The access tokens provided by this service grant access to all AWS account -// entitlements assigned to an IAM Identity Center user, not just a particular -// application. +// that are necessary to enable single sign-on authentication with the CLI. +// - With older versions of the CLI, the service only emits OIDC access tokens, +// so to obtain a new token, users must explicitly re-authenticate. To access the +// OIDC flow that supports token refresh and doesn’t require re-authentication, +// update to the latest CLI version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with +// support for OIDC token refresh and configurable IAM Identity Center session +// durations. For more information, see Configure Amazon Web Services access +// portal session duration (https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html) +// . +// - The access tokens provided by this service grant access to all Amazon Web +// Services account entitlements assigned to an IAM Identity Center user, not just +// a particular application. // - The documentation in this guide does not describe the mechanism to convert -// the access token into AWS Auth (“sigv4”) credentials for use with IAM-protected -// AWS service endpoints. For more information, see GetRoleCredentials (https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html) +// the access token into Amazon Web Services Auth (“sigv4”) credentials for use +// with IAM-protected Amazon Web Services service endpoints. For more information, +// see GetRoleCredentials (https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html) // in the IAM Identity Center Portal API Reference Guide. // // For general information about IAM Identity Center, see What is IAM Identity diff --git a/service/ssooidc/endpoints.go b/service/ssooidc/endpoints.go index 4205c95fc3d..85b87089026 100644 --- a/service/ssooidc/endpoints.go +++ b/service/ssooidc/endpoints.go @@ -115,7 +115,7 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser if len(awsmiddleware.GetSigningName(ctx)) == 0 { signingName := endpoint.SigningName if len(signingName) == 0 { - signingName = "awsssooidc" + signingName = "sso-oauth" } ctx = awsmiddleware.SetSigningName(ctx, signingName) } @@ -366,8 +366,8 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - if "aws-us-gov" == _PartitionResult.Name { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { uriString := func() string { var out strings.Builder out.WriteString("https://oidc.") diff --git a/service/ssooidc/generated.json b/service/ssooidc/generated.json index 90c75236812..0a6b34935a2 100644 --- a/service/ssooidc/generated.json +++ b/service/ssooidc/generated.json @@ -10,6 +10,7 @@ "api_client.go", "api_client_test.go", "api_op_CreateToken.go", + "api_op_CreateTokenWithIAM.go", "api_op_RegisterClient.go", "api_op_StartDeviceAuthorization.go", "auth.go", diff --git a/service/ssooidc/serializers.go b/service/ssooidc/serializers.go index efca8b25079..754218b78e2 100644 --- a/service/ssooidc/serializers.go +++ b/service/ssooidc/serializers.go @@ -125,6 +125,128 @@ func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value return nil } +type awsRestjson1_serializeOpCreateTokenWithIAM struct { +} + +func (*awsRestjson1_serializeOpCreateTokenWithIAM) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateTokenWithIAM) 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.(*CreateTokenWithIAMInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/token?aws_iam=t") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(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_serializeOpHttpBindingsCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Assertion != nil { + ok := object.Key("assertion") + ok.String(*v.Assertion) + } + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.Code != nil { + ok := object.Key("code") + ok.String(*v.Code) + } + + if v.GrantType != nil { + ok := object.Key("grantType") + ok.String(*v.GrantType) + } + + if v.RedirectUri != nil { + ok := object.Key("redirectUri") + ok.String(*v.RedirectUri) + } + + if v.RefreshToken != nil { + ok := object.Key("refreshToken") + ok.String(*v.RefreshToken) + } + + if v.RequestedTokenType != nil { + ok := object.Key("requestedTokenType") + ok.String(*v.RequestedTokenType) + } + + if v.Scope != nil { + ok := object.Key("scope") + if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil { + return err + } + } + + if v.SubjectToken != nil { + ok := object.Key("subjectToken") + ok.String(*v.SubjectToken) + } + + if v.SubjectTokenType != nil { + ok := object.Key("subjectTokenType") + ok.String(*v.SubjectTokenType) + } + + return nil +} + type awsRestjson1_serializeOpRegisterClient struct { } diff --git a/service/ssooidc/types/errors.go b/service/ssooidc/types/errors.go index 115a51a9eb3..86b62049fd9 100644 --- a/service/ssooidc/types/errors.go +++ b/service/ssooidc/types/errors.go @@ -247,6 +247,38 @@ func (e *InvalidRequestException) ErrorCode() string { } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Indicates that a token provided as input to the request was issued by and is +// only usable by calling IAM Identity Center endpoints in another region. +type InvalidRequestRegionException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + Endpoint *string + Region *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestRegionException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestRegionException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestRegionException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestRegionException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestRegionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Indicates that the scope provided in the request is invalid. type InvalidScopeException struct { Message *string diff --git a/service/ssooidc/validators.go b/service/ssooidc/validators.go index 5a309484e01..9c17e4c8e18 100644 --- a/service/ssooidc/validators.go +++ b/service/ssooidc/validators.go @@ -29,6 +29,26 @@ func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateTokenWithIAM struct { +} + +func (*validateOpCreateTokenWithIAM) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTokenWithIAM) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTokenWithIAMInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTokenWithIAMInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRegisterClient struct { } @@ -73,6 +93,10 @@ func addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateToken{}, middleware.After) } +func addOpCreateTokenWithIAMValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTokenWithIAM{}, middleware.After) +} + func addOpRegisterClientValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterClient{}, middleware.After) } @@ -102,6 +126,24 @@ func validateOpCreateTokenInput(v *CreateTokenInput) error { } } +func validateOpCreateTokenWithIAMInput(v *CreateTokenWithIAMInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTokenWithIAMInput"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.GrantType == nil { + invalidParams.Add(smithy.NewErrParamRequired("GrantType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRegisterClientInput(v *RegisterClientInput) error { if v == nil { return nil diff --git a/service/sts/api_op_AssumeRole.go b/service/sts/api_op_AssumeRole.go index 78bf380fa36..ea2e4595ebd 100644 --- a/service/sts/api_op_AssumeRole.go +++ b/service/sts/api_op_AssumeRole.go @@ -200,7 +200,12 @@ type AssumeRoleInput struct { // in the IAM User Guide. PolicyArns []types.PolicyDescriptorType - // Reserved for future use. + // A list of previously acquired trusted context assertions in the format of a + // JSON array. The trusted context assertion is signed and encrypted by Amazon Web + // Services STS. The following is an example of a ProvidedContext value that + // includes a single trusted context assertion and the ARN of the context provider + // from which the trusted context assertion was generated. + // [{"ProviderArn":"arn:aws:iam::aws:contextProvider/identitycenter","ContextAssertion":"trusted-context-assertion"}] ProvidedContexts []types.ProvidedContext // The identification number of the MFA device that is associated with the user diff --git a/service/sts/endpoints.go b/service/sts/endpoints.go index d0d3d88205f..9f7932f9a06 100644 --- a/service/sts/endpoints.go +++ b/service/sts/endpoints.go @@ -916,8 +916,8 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - if "aws-us-gov" == _PartitionResult.Name { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { uriString := func() string { var out strings.Builder out.WriteString("https://sts.") diff --git a/service/sts/endpoints_test.go b/service/sts/endpoints_test.go index 6ee4ba9e492..5d19443a621 100644 --- a/service/sts/endpoints_test.go +++ b/service/sts/endpoints_test.go @@ -2007,10 +2007,10 @@ func TestEndpointCase53(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-northeast-1` func TestEndpointCase54(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-northeast-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2033,10 +2033,10 @@ func TestEndpointCase54(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2063,10 +2063,10 @@ func TestEndpointCase54(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-south-1` func TestEndpointCase55(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2089,10 +2089,10 @@ func TestEndpointCase55(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2119,10 +2119,10 @@ func TestEndpointCase55(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-southeast-1` func TestEndpointCase56(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-southeast-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2145,10 +2145,10 @@ func TestEndpointCase56(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2175,10 +2175,10 @@ func TestEndpointCase56(t *testing.T) { // UseGlobalEndpoint with legacy region `ap-southeast-2` func TestEndpointCase57(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-southeast-2"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2201,10 +2201,10 @@ func TestEndpointCase57(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2231,10 +2231,10 @@ func TestEndpointCase57(t *testing.T) { // UseGlobalEndpoint with legacy region `aws-global` func TestEndpointCase58(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("aws-global"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2257,10 +2257,10 @@ func TestEndpointCase58(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2287,10 +2287,10 @@ func TestEndpointCase58(t *testing.T) { // UseGlobalEndpoint with legacy region `ca-central-1` func TestEndpointCase59(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("ca-central-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2313,10 +2313,10 @@ func TestEndpointCase59(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2343,10 +2343,10 @@ func TestEndpointCase59(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-central-1` func TestEndpointCase60(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-central-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2369,10 +2369,10 @@ func TestEndpointCase60(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2399,10 +2399,10 @@ func TestEndpointCase60(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-north-1` func TestEndpointCase61(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2425,10 +2425,10 @@ func TestEndpointCase61(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2455,10 +2455,10 @@ func TestEndpointCase61(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-west-1` func TestEndpointCase62(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2481,10 +2481,10 @@ func TestEndpointCase62(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2511,10 +2511,10 @@ func TestEndpointCase62(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-west-2` func TestEndpointCase63(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-2"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2537,10 +2537,10 @@ func TestEndpointCase63(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2567,10 +2567,10 @@ func TestEndpointCase63(t *testing.T) { // UseGlobalEndpoint with legacy region `eu-west-3` func TestEndpointCase64(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-3"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2593,10 +2593,10 @@ func TestEndpointCase64(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2623,10 +2623,10 @@ func TestEndpointCase64(t *testing.T) { // UseGlobalEndpoint with legacy region `sa-east-1` func TestEndpointCase65(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("sa-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2649,10 +2649,10 @@ func TestEndpointCase65(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2679,10 +2679,10 @@ func TestEndpointCase65(t *testing.T) { // UseGlobalEndpoint with legacy region `us-east-1` func TestEndpointCase66(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2705,10 +2705,10 @@ func TestEndpointCase66(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2735,10 +2735,10 @@ func TestEndpointCase66(t *testing.T) { // UseGlobalEndpoint with legacy region `us-east-2` func TestEndpointCase67(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-2"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2761,10 +2761,10 @@ func TestEndpointCase67(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2791,10 +2791,10 @@ func TestEndpointCase67(t *testing.T) { // UseGlobalEndpoint with legacy region `us-west-1` func TestEndpointCase68(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2817,10 +2817,10 @@ func TestEndpointCase68(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2847,10 +2847,10 @@ func TestEndpointCase68(t *testing.T) { // UseGlobalEndpoint with legacy region `us-west-2` func TestEndpointCase69(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-2"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2873,10 +2873,10 @@ func TestEndpointCase69(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") return sp }(), }, @@ -2903,10 +2903,10 @@ func TestEndpointCase69(t *testing.T) { // UseGlobalEndpoint with Non-legacy region `us-east-3` func TestEndpointCase70(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-3"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2929,10 +2929,10 @@ func TestEndpointCase70(t *testing.T) { SchemeID: "aws.auth#sigv4", SignerProperties: func() smithy.Properties { var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-3") - smithyhttp.SetSigV4SigningName(&sp, "sts") smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-3") return sp }(), }, @@ -2959,10 +2959,10 @@ func TestEndpointCase70(t *testing.T) { // UseGlobalEndpoint with legacy region and custom endpoint func TestEndpointCase71(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -3000,9 +3000,9 @@ func TestEndpointCase71(t *testing.T) { // UseGlobalEndpoint with unset region and custom endpoint func TestEndpointCase72(t *testing.T) { var params = EndpointParameters{ - UseGlobalEndpoint: ptr.Bool(false), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + UseGlobalEndpoint: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } diff --git a/service/sts/types/types.go b/service/sts/types/types.go index 572a7051225..e3701d11d15 100644 --- a/service/sts/types/types.go +++ b/service/sts/types/types.go @@ -89,13 +89,17 @@ type PolicyDescriptorType struct { noSmithyDocumentSerde } -// Reserved for future use. +// Contains information about the provided context. This includes the signed and +// encrypted trusted context assertion and the context provider ARN from which the +// trusted context assertion was generated. type ProvidedContext struct { - // Reserved for future use. + // The signed and encrypted trusted context assertion generated by the context + // provider. The trusted context assertion is signed and encrypted by Amazon Web + // Services STS. ContextAssertion *string - // Reserved for future use. + // The context provider ARN from which the trusted context assertion was generated. ProviderArn *string noSmithyDocumentSerde diff --git a/service/trustedadvisor/LICENSE.txt b/service/trustedadvisor/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/trustedadvisor/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/trustedadvisor/api_client.go b/service/trustedadvisor/api_client.go new file mode 100644 index 00000000000..8f0a10cce20 --- /dev/null +++ b/service/trustedadvisor/api_client.go @@ -0,0 +1,455 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "TrustedAdvisor" +const ServiceAPIVersion = "2022-09-15" + +// Client provides the API client to make operations call for TrustedAdvisor +// Public 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) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + ignoreAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + return client +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %v", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %v", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "trustedadvisor", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/service/trustedadvisor/api_client_test.go b/service/trustedadvisor/api_client_test.go new file mode 100644 index 00000000000..b23fb3e3177 --- /dev/null +++ b/service/trustedadvisor/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/trustedadvisor/api_op_GetOrganizationRecommendation.go b/service/trustedadvisor/api_op_GetOrganizationRecommendation.go new file mode 100644 index 00000000000..642f2e326d0 --- /dev/null +++ b/service/trustedadvisor/api_op_GetOrganizationRecommendation.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get a specific recommendation within an AWS Organizations organization. This +// API supports only prioritized recommendations. +func (c *Client) GetOrganizationRecommendation(ctx context.Context, params *GetOrganizationRecommendationInput, optFns ...func(*Options)) (*GetOrganizationRecommendationOutput, error) { + if params == nil { + params = &GetOrganizationRecommendationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetOrganizationRecommendation", params, optFns, c.addOperationGetOrganizationRecommendationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetOrganizationRecommendationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetOrganizationRecommendationInput struct { + + // The Recommendation identifier + // + // This member is required. + OrganizationRecommendationIdentifier *string + + noSmithyDocumentSerde +} + +type GetOrganizationRecommendationOutput struct { + + // The Recommendation + OrganizationRecommendation *types.OrganizationRecommendation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetOrganizationRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetOrganizationRecommendation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetOrganizationRecommendation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetOrganizationRecommendation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetOrganizationRecommendationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetOrganizationRecommendation(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetOrganizationRecommendation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetOrganizationRecommendation", + } +} diff --git a/service/trustedadvisor/api_op_GetRecommendation.go b/service/trustedadvisor/api_op_GetRecommendation.go new file mode 100644 index 00000000000..e6b6cc54f35 --- /dev/null +++ b/service/trustedadvisor/api_op_GetRecommendation.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get a specific Recommendation +func (c *Client) GetRecommendation(ctx context.Context, params *GetRecommendationInput, optFns ...func(*Options)) (*GetRecommendationOutput, error) { + if params == nil { + params = &GetRecommendationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRecommendation", params, optFns, c.addOperationGetRecommendationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRecommendationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRecommendationInput struct { + + // The Recommendation identifier + // + // This member is required. + RecommendationIdentifier *string + + noSmithyDocumentSerde +} + +type GetRecommendationOutput struct { + + // The Recommendation + Recommendation *types.Recommendation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRecommendation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRecommendation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRecommendation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetRecommendationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRecommendation(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRecommendation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetRecommendation", + } +} diff --git a/service/trustedadvisor/api_op_ListChecks.go b/service/trustedadvisor/api_op_ListChecks.go new file mode 100644 index 00000000000..480ef35594a --- /dev/null +++ b/service/trustedadvisor/api_op_ListChecks.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List a filterable set of Checks +func (c *Client) ListChecks(ctx context.Context, params *ListChecksInput, optFns ...func(*Options)) (*ListChecksOutput, error) { + if params == nil { + params = &ListChecksInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListChecks", params, optFns, c.addOperationListChecksMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListChecksOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListChecksInput struct { + + // The aws service associated with the check + AwsService *string + + // The ISO 639-1 code for the language that you want your checks to appear in. + Language types.RecommendationLanguage + + // 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 + + // The pillar of the check + Pillar types.RecommendationPillar + + // The source of the check + Source types.RecommendationSource + + noSmithyDocumentSerde +} + +type ListChecksOutput struct { + + // The list of Checks + // + // This member is required. + CheckSummaries []types.CheckSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListChecksMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListChecks{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListChecks{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListChecks"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListChecks(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListChecksAPIClient is a client that implements the ListChecks operation. +type ListChecksAPIClient interface { + ListChecks(context.Context, *ListChecksInput, ...func(*Options)) (*ListChecksOutput, error) +} + +var _ ListChecksAPIClient = (*Client)(nil) + +// ListChecksPaginatorOptions is the paginator options for ListChecks +type ListChecksPaginatorOptions 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 +} + +// ListChecksPaginator is a paginator for ListChecks +type ListChecksPaginator struct { + options ListChecksPaginatorOptions + client ListChecksAPIClient + params *ListChecksInput + nextToken *string + firstPage bool +} + +// NewListChecksPaginator returns a new ListChecksPaginator +func NewListChecksPaginator(client ListChecksAPIClient, params *ListChecksInput, optFns ...func(*ListChecksPaginatorOptions)) *ListChecksPaginator { + if params == nil { + params = &ListChecksInput{} + } + + options := ListChecksPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListChecksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChecksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListChecks page. +func (p *ListChecksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChecksOutput, 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.ListChecks(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_opListChecks(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListChecks", + } +} diff --git a/service/trustedadvisor/api_op_ListOrganizationRecommendationAccounts.go b/service/trustedadvisor/api_op_ListOrganizationRecommendationAccounts.go new file mode 100644 index 00000000000..c700e3162da --- /dev/null +++ b/service/trustedadvisor/api_op_ListOrganizationRecommendationAccounts.go @@ -0,0 +1,247 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the accounts that own the resources for an organization aggregate +// recommendation. This API only supports prioritized recommendations. +func (c *Client) ListOrganizationRecommendationAccounts(ctx context.Context, params *ListOrganizationRecommendationAccountsInput, optFns ...func(*Options)) (*ListOrganizationRecommendationAccountsOutput, error) { + if params == nil { + params = &ListOrganizationRecommendationAccountsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListOrganizationRecommendationAccounts", params, optFns, c.addOperationListOrganizationRecommendationAccountsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListOrganizationRecommendationAccountsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListOrganizationRecommendationAccountsInput struct { + + // The Recommendation identifier + // + // This member is required. + OrganizationRecommendationIdentifier *string + + // An account affected by this organization recommendation + AffectedAccountId *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 ListOrganizationRecommendationAccountsOutput struct { + + // The account recommendations lifecycles that are applicable to the Recommendation + // + // This member is required. + AccountRecommendationLifecycleSummaries []types.AccountRecommendationLifecycleSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListOrganizationRecommendationAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListOrganizationRecommendationAccounts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListOrganizationRecommendationAccounts{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListOrganizationRecommendationAccounts"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListOrganizationRecommendationAccountsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOrganizationRecommendationAccounts(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListOrganizationRecommendationAccountsAPIClient is a client that implements the +// ListOrganizationRecommendationAccounts operation. +type ListOrganizationRecommendationAccountsAPIClient interface { + ListOrganizationRecommendationAccounts(context.Context, *ListOrganizationRecommendationAccountsInput, ...func(*Options)) (*ListOrganizationRecommendationAccountsOutput, error) +} + +var _ ListOrganizationRecommendationAccountsAPIClient = (*Client)(nil) + +// ListOrganizationRecommendationAccountsPaginatorOptions is the paginator options +// for ListOrganizationRecommendationAccounts +type ListOrganizationRecommendationAccountsPaginatorOptions 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 +} + +// ListOrganizationRecommendationAccountsPaginator is a paginator for +// ListOrganizationRecommendationAccounts +type ListOrganizationRecommendationAccountsPaginator struct { + options ListOrganizationRecommendationAccountsPaginatorOptions + client ListOrganizationRecommendationAccountsAPIClient + params *ListOrganizationRecommendationAccountsInput + nextToken *string + firstPage bool +} + +// NewListOrganizationRecommendationAccountsPaginator returns a new +// ListOrganizationRecommendationAccountsPaginator +func NewListOrganizationRecommendationAccountsPaginator(client ListOrganizationRecommendationAccountsAPIClient, params *ListOrganizationRecommendationAccountsInput, optFns ...func(*ListOrganizationRecommendationAccountsPaginatorOptions)) *ListOrganizationRecommendationAccountsPaginator { + if params == nil { + params = &ListOrganizationRecommendationAccountsInput{} + } + + options := ListOrganizationRecommendationAccountsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListOrganizationRecommendationAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationRecommendationAccountsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListOrganizationRecommendationAccounts page. +func (p *ListOrganizationRecommendationAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationRecommendationAccountsOutput, 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.ListOrganizationRecommendationAccounts(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_opListOrganizationRecommendationAccounts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListOrganizationRecommendationAccounts", + } +} diff --git a/service/trustedadvisor/api_op_ListOrganizationRecommendationResources.go b/service/trustedadvisor/api_op_ListOrganizationRecommendationResources.go new file mode 100644 index 00000000000..dc19f773ce1 --- /dev/null +++ b/service/trustedadvisor/api_op_ListOrganizationRecommendationResources.go @@ -0,0 +1,253 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List Resources of a Recommendation within an Organization. This API only +// supports prioritized recommendations. +func (c *Client) ListOrganizationRecommendationResources(ctx context.Context, params *ListOrganizationRecommendationResourcesInput, optFns ...func(*Options)) (*ListOrganizationRecommendationResourcesOutput, error) { + if params == nil { + params = &ListOrganizationRecommendationResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListOrganizationRecommendationResources", params, optFns, c.addOperationListOrganizationRecommendationResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListOrganizationRecommendationResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListOrganizationRecommendationResourcesInput struct { + + // The AWS Organization organization's Recommendation identifier + // + // This member is required. + OrganizationRecommendationIdentifier *string + + // An account affected by this organization recommendation + AffectedAccountId *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 + + // The AWS Region code of the resource + RegionCode *string + + // The status of the resource + Status types.ResourceStatus + + noSmithyDocumentSerde +} + +type ListOrganizationRecommendationResourcesOutput struct { + + // A list of Recommendation Resources + // + // This member is required. + OrganizationRecommendationResourceSummaries []types.OrganizationRecommendationResourceSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListOrganizationRecommendationResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListOrganizationRecommendationResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListOrganizationRecommendationResources{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListOrganizationRecommendationResources"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListOrganizationRecommendationResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOrganizationRecommendationResources(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListOrganizationRecommendationResourcesAPIClient is a client that implements +// the ListOrganizationRecommendationResources operation. +type ListOrganizationRecommendationResourcesAPIClient interface { + ListOrganizationRecommendationResources(context.Context, *ListOrganizationRecommendationResourcesInput, ...func(*Options)) (*ListOrganizationRecommendationResourcesOutput, error) +} + +var _ ListOrganizationRecommendationResourcesAPIClient = (*Client)(nil) + +// ListOrganizationRecommendationResourcesPaginatorOptions is the paginator +// options for ListOrganizationRecommendationResources +type ListOrganizationRecommendationResourcesPaginatorOptions 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 +} + +// ListOrganizationRecommendationResourcesPaginator is a paginator for +// ListOrganizationRecommendationResources +type ListOrganizationRecommendationResourcesPaginator struct { + options ListOrganizationRecommendationResourcesPaginatorOptions + client ListOrganizationRecommendationResourcesAPIClient + params *ListOrganizationRecommendationResourcesInput + nextToken *string + firstPage bool +} + +// NewListOrganizationRecommendationResourcesPaginator returns a new +// ListOrganizationRecommendationResourcesPaginator +func NewListOrganizationRecommendationResourcesPaginator(client ListOrganizationRecommendationResourcesAPIClient, params *ListOrganizationRecommendationResourcesInput, optFns ...func(*ListOrganizationRecommendationResourcesPaginatorOptions)) *ListOrganizationRecommendationResourcesPaginator { + if params == nil { + params = &ListOrganizationRecommendationResourcesInput{} + } + + options := ListOrganizationRecommendationResourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListOrganizationRecommendationResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationRecommendationResourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListOrganizationRecommendationResources page. +func (p *ListOrganizationRecommendationResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationRecommendationResourcesOutput, 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.ListOrganizationRecommendationResources(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_opListOrganizationRecommendationResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListOrganizationRecommendationResources", + } +} diff --git a/service/trustedadvisor/api_op_ListOrganizationRecommendations.go b/service/trustedadvisor/api_op_ListOrganizationRecommendations.go new file mode 100644 index 00000000000..9f4884acc55 --- /dev/null +++ b/service/trustedadvisor/api_op_ListOrganizationRecommendations.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// List a filterable set of Recommendations within an Organization. This API only +// supports prioritized recommendations. +func (c *Client) ListOrganizationRecommendations(ctx context.Context, params *ListOrganizationRecommendationsInput, optFns ...func(*Options)) (*ListOrganizationRecommendationsOutput, error) { + if params == nil { + params = &ListOrganizationRecommendationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListOrganizationRecommendations", params, optFns, c.addOperationListOrganizationRecommendationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListOrganizationRecommendationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListOrganizationRecommendationsInput struct { + + // After the last update of the Recommendation + AfterLastUpdatedAt *time.Time + + // The aws service associated with the Recommendation + AwsService *string + + // Before the last update of the Recommendation + BeforeLastUpdatedAt *time.Time + + // The check identifier of the Recommendation + CheckIdentifier *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 + + // The pillar of the Recommendation + Pillar types.RecommendationPillar + + // The source of the Recommendation + Source types.RecommendationSource + + // The status of the Recommendation + Status types.RecommendationStatus + + // The type of the Recommendation + Type types.RecommendationType + + noSmithyDocumentSerde +} + +type ListOrganizationRecommendationsOutput struct { + + // The list of Recommendations + // + // This member is required. + OrganizationRecommendationSummaries []types.OrganizationRecommendationSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListOrganizationRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListOrganizationRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListOrganizationRecommendations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListOrganizationRecommendations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOrganizationRecommendations(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListOrganizationRecommendationsAPIClient is a client that implements the +// ListOrganizationRecommendations operation. +type ListOrganizationRecommendationsAPIClient interface { + ListOrganizationRecommendations(context.Context, *ListOrganizationRecommendationsInput, ...func(*Options)) (*ListOrganizationRecommendationsOutput, error) +} + +var _ ListOrganizationRecommendationsAPIClient = (*Client)(nil) + +// ListOrganizationRecommendationsPaginatorOptions is the paginator options for +// ListOrganizationRecommendations +type ListOrganizationRecommendationsPaginatorOptions 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 +} + +// ListOrganizationRecommendationsPaginator is a paginator for +// ListOrganizationRecommendations +type ListOrganizationRecommendationsPaginator struct { + options ListOrganizationRecommendationsPaginatorOptions + client ListOrganizationRecommendationsAPIClient + params *ListOrganizationRecommendationsInput + nextToken *string + firstPage bool +} + +// NewListOrganizationRecommendationsPaginator returns a new +// ListOrganizationRecommendationsPaginator +func NewListOrganizationRecommendationsPaginator(client ListOrganizationRecommendationsAPIClient, params *ListOrganizationRecommendationsInput, optFns ...func(*ListOrganizationRecommendationsPaginatorOptions)) *ListOrganizationRecommendationsPaginator { + if params == nil { + params = &ListOrganizationRecommendationsInput{} + } + + options := ListOrganizationRecommendationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListOrganizationRecommendationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationRecommendationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListOrganizationRecommendations page. +func (p *ListOrganizationRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationRecommendationsOutput, 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.ListOrganizationRecommendations(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_opListOrganizationRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListOrganizationRecommendations", + } +} diff --git a/service/trustedadvisor/api_op_ListRecommendationResources.go b/service/trustedadvisor/api_op_ListRecommendationResources.go new file mode 100644 index 00000000000..e9ca1ed63d7 --- /dev/null +++ b/service/trustedadvisor/api_op_ListRecommendationResources.go @@ -0,0 +1,249 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List Resources of a Recommendation +func (c *Client) ListRecommendationResources(ctx context.Context, params *ListRecommendationResourcesInput, optFns ...func(*Options)) (*ListRecommendationResourcesOutput, error) { + if params == nil { + params = &ListRecommendationResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRecommendationResources", params, optFns, c.addOperationListRecommendationResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRecommendationResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRecommendationResourcesInput struct { + + // The Recommendation identifier + // + // This member is required. + RecommendationIdentifier *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 + + // The AWS Region code of the resource + RegionCode *string + + // The status of the resource + Status types.ResourceStatus + + noSmithyDocumentSerde +} + +type ListRecommendationResourcesOutput struct { + + // A list of Recommendation Resources + // + // This member is required. + RecommendationResourceSummaries []types.RecommendationResourceSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRecommendationResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRecommendationResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRecommendationResources{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListRecommendationResources"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListRecommendationResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRecommendationResources(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListRecommendationResourcesAPIClient is a client that implements the +// ListRecommendationResources operation. +type ListRecommendationResourcesAPIClient interface { + ListRecommendationResources(context.Context, *ListRecommendationResourcesInput, ...func(*Options)) (*ListRecommendationResourcesOutput, error) +} + +var _ ListRecommendationResourcesAPIClient = (*Client)(nil) + +// ListRecommendationResourcesPaginatorOptions is the paginator options for +// ListRecommendationResources +type ListRecommendationResourcesPaginatorOptions 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 +} + +// ListRecommendationResourcesPaginator is a paginator for +// ListRecommendationResources +type ListRecommendationResourcesPaginator struct { + options ListRecommendationResourcesPaginatorOptions + client ListRecommendationResourcesAPIClient + params *ListRecommendationResourcesInput + nextToken *string + firstPage bool +} + +// NewListRecommendationResourcesPaginator returns a new +// ListRecommendationResourcesPaginator +func NewListRecommendationResourcesPaginator(client ListRecommendationResourcesAPIClient, params *ListRecommendationResourcesInput, optFns ...func(*ListRecommendationResourcesPaginatorOptions)) *ListRecommendationResourcesPaginator { + if params == nil { + params = &ListRecommendationResourcesInput{} + } + + options := ListRecommendationResourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRecommendationResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecommendationResourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRecommendationResources page. +func (p *ListRecommendationResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationResourcesOutput, 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.ListRecommendationResources(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_opListRecommendationResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListRecommendationResources", + } +} diff --git a/service/trustedadvisor/api_op_ListRecommendations.go b/service/trustedadvisor/api_op_ListRecommendations.go new file mode 100644 index 00000000000..71fa1ffb556 --- /dev/null +++ b/service/trustedadvisor/api_op_ListRecommendations.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// List a filterable set of Recommendations +func (c *Client) ListRecommendations(ctx context.Context, params *ListRecommendationsInput, optFns ...func(*Options)) (*ListRecommendationsOutput, error) { + if params == nil { + params = &ListRecommendationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRecommendations", params, optFns, c.addOperationListRecommendationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRecommendationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRecommendationsInput struct { + + // After the last update of the Recommendation + AfterLastUpdatedAt *time.Time + + // The aws service associated with the Recommendation + AwsService *string + + // Before the last update of the Recommendation + BeforeLastUpdatedAt *time.Time + + // The check identifier of the Recommendation + CheckIdentifier *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 + + // The pillar of the Recommendation + Pillar types.RecommendationPillar + + // The source of the Recommendation + Source types.RecommendationSource + + // The status of the Recommendation + Status types.RecommendationStatus + + // The type of the Recommendation + Type types.RecommendationType + + noSmithyDocumentSerde +} + +type ListRecommendationsOutput struct { + + // The list of Recommendations + // + // This member is required. + RecommendationSummaries []types.RecommendationSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRecommendations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListRecommendations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRecommendations(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListRecommendationsAPIClient is a client that implements the +// ListRecommendations operation. +type ListRecommendationsAPIClient interface { + ListRecommendations(context.Context, *ListRecommendationsInput, ...func(*Options)) (*ListRecommendationsOutput, error) +} + +var _ ListRecommendationsAPIClient = (*Client)(nil) + +// ListRecommendationsPaginatorOptions is the paginator options for +// ListRecommendations +type ListRecommendationsPaginatorOptions 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 +} + +// ListRecommendationsPaginator is a paginator for ListRecommendations +type ListRecommendationsPaginator struct { + options ListRecommendationsPaginatorOptions + client ListRecommendationsAPIClient + params *ListRecommendationsInput + nextToken *string + firstPage bool +} + +// NewListRecommendationsPaginator returns a new ListRecommendationsPaginator +func NewListRecommendationsPaginator(client ListRecommendationsAPIClient, params *ListRecommendationsInput, optFns ...func(*ListRecommendationsPaginatorOptions)) *ListRecommendationsPaginator { + if params == nil { + params = &ListRecommendationsInput{} + } + + options := ListRecommendationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRecommendationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecommendationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRecommendations page. +func (p *ListRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationsOutput, 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.ListRecommendations(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_opListRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListRecommendations", + } +} diff --git a/service/trustedadvisor/api_op_UpdateOrganizationRecommendationLifecycle.go b/service/trustedadvisor/api_op_UpdateOrganizationRecommendationLifecycle.go new file mode 100644 index 00000000000..49c33edc0f6 --- /dev/null +++ b/service/trustedadvisor/api_op_UpdateOrganizationRecommendationLifecycle.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update the lifecyle of a Recommendation within an Organization. This API only +// supports prioritized recommendations. +func (c *Client) UpdateOrganizationRecommendationLifecycle(ctx context.Context, params *UpdateOrganizationRecommendationLifecycleInput, optFns ...func(*Options)) (*UpdateOrganizationRecommendationLifecycleOutput, error) { + if params == nil { + params = &UpdateOrganizationRecommendationLifecycleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateOrganizationRecommendationLifecycle", params, optFns, c.addOperationUpdateOrganizationRecommendationLifecycleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateOrganizationRecommendationLifecycleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateOrganizationRecommendationLifecycleInput struct { + + // The new lifecycle stage + // + // This member is required. + LifecycleStage types.UpdateRecommendationLifecycleStage + + // The Recommendation identifier for AWS Trusted Advisor Priority recommendations + // + // This member is required. + OrganizationRecommendationIdentifier *string + + // Reason for the lifecycle stage change + UpdateReason *string + + // Reason code for the lifecycle state change + UpdateReasonCode types.UpdateRecommendationLifecycleStageReasonCode + + noSmithyDocumentSerde +} + +type UpdateOrganizationRecommendationLifecycleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateOrganizationRecommendationLifecycleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateOrganizationRecommendationLifecycle{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateOrganizationRecommendationLifecycle{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateOrganizationRecommendationLifecycle"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateOrganizationRecommendationLifecycleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOrganizationRecommendationLifecycle(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateOrganizationRecommendationLifecycle(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateOrganizationRecommendationLifecycle", + } +} diff --git a/service/trustedadvisor/api_op_UpdateRecommendationLifecycle.go b/service/trustedadvisor/api_op_UpdateRecommendationLifecycle.go new file mode 100644 index 00000000000..6bdfca689a0 --- /dev/null +++ b/service/trustedadvisor/api_op_UpdateRecommendationLifecycle.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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/trustedadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update the lifecyle of a Recommendation. This API only supports prioritized +// recommendations. +func (c *Client) UpdateRecommendationLifecycle(ctx context.Context, params *UpdateRecommendationLifecycleInput, optFns ...func(*Options)) (*UpdateRecommendationLifecycleOutput, error) { + if params == nil { + params = &UpdateRecommendationLifecycleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRecommendationLifecycle", params, optFns, c.addOperationUpdateRecommendationLifecycleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRecommendationLifecycleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRecommendationLifecycleInput struct { + + // The new lifecycle stage + // + // This member is required. + LifecycleStage types.UpdateRecommendationLifecycleStage + + // The Recommendation identifier for AWS Trusted Advisor Priority recommendations + // + // This member is required. + RecommendationIdentifier *string + + // Reason for the lifecycle stage change + UpdateReason *string + + // Reason code for the lifecycle state change + UpdateReasonCode types.UpdateRecommendationLifecycleStageReasonCode + + noSmithyDocumentSerde +} + +type UpdateRecommendationLifecycleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRecommendationLifecycleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRecommendationLifecycle{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRecommendationLifecycle{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateRecommendationLifecycle"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRecommendationLifecycleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRecommendationLifecycle(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRecommendationLifecycle(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateRecommendationLifecycle", + } +} diff --git a/service/trustedadvisor/auth.go b/service/trustedadvisor/auth.go new file mode 100644 index 00000000000..01d9908c3ba --- /dev/null +++ b/service/trustedadvisor/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "trustedadvisor") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %v", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %v", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %v", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/trustedadvisor/deserializers.go b/service/trustedadvisor/deserializers.go new file mode 100644 index 00000000000..ae8ece5fed9 --- /dev/null +++ b/service/trustedadvisor/deserializers.go @@ -0,0 +1,3663 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/trustedadvisor/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" + "math" + "strings" +) + +type awsRestjson1_deserializeOpGetOrganizationRecommendation struct { +} + +func (*awsRestjson1_deserializeOpGetOrganizationRecommendation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetOrganizationRecommendation) HandleDeserialize(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_deserializeOpErrorGetOrganizationRecommendation(response, &metadata) + } + output := &GetOrganizationRecommendationOutput{} + 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_deserializeOpDocumentGetOrganizationRecommendationOutput(&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_deserializeOpErrorGetOrganizationRecommendation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetOrganizationRecommendationOutput(v **GetOrganizationRecommendationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetOrganizationRecommendationOutput + if *v == nil { + sv = &GetOrganizationRecommendationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "organizationRecommendation": + if err := awsRestjson1_deserializeDocumentOrganizationRecommendation(&sv.OrganizationRecommendation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetRecommendation struct { +} + +func (*awsRestjson1_deserializeOpGetRecommendation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetRecommendation) HandleDeserialize(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_deserializeOpErrorGetRecommendation(response, &metadata) + } + output := &GetRecommendationOutput{} + 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_deserializeOpDocumentGetRecommendationOutput(&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_deserializeOpErrorGetRecommendation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetRecommendationOutput(v **GetRecommendationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetRecommendationOutput + if *v == nil { + sv = &GetRecommendationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "recommendation": + if err := awsRestjson1_deserializeDocumentRecommendation(&sv.Recommendation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListChecks struct { +} + +func (*awsRestjson1_deserializeOpListChecks) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListChecks) HandleDeserialize(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_deserializeOpErrorListChecks(response, &metadata) + } + output := &ListChecksOutput{} + 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_deserializeOpDocumentListChecksOutput(&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_deserializeOpErrorListChecks(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListChecksOutput(v **ListChecksOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListChecksOutput + if *v == nil { + sv = &ListChecksOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "checkSummaries": + if err := awsRestjson1_deserializeDocumentCheckSummaryList(&sv.CheckSummaries, 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 +} + +type awsRestjson1_deserializeOpListOrganizationRecommendationAccounts struct { +} + +func (*awsRestjson1_deserializeOpListOrganizationRecommendationAccounts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListOrganizationRecommendationAccounts) HandleDeserialize(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_deserializeOpErrorListOrganizationRecommendationAccounts(response, &metadata) + } + output := &ListOrganizationRecommendationAccountsOutput{} + 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_deserializeOpDocumentListOrganizationRecommendationAccountsOutput(&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_deserializeOpErrorListOrganizationRecommendationAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListOrganizationRecommendationAccountsOutput(v **ListOrganizationRecommendationAccountsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListOrganizationRecommendationAccountsOutput + if *v == nil { + sv = &ListOrganizationRecommendationAccountsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountRecommendationLifecycleSummaries": + if err := awsRestjson1_deserializeDocumentAccountRecommendationLifecycleSummaryList(&sv.AccountRecommendationLifecycleSummaries, 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 +} + +type awsRestjson1_deserializeOpListOrganizationRecommendationResources struct { +} + +func (*awsRestjson1_deserializeOpListOrganizationRecommendationResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListOrganizationRecommendationResources) HandleDeserialize(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_deserializeOpErrorListOrganizationRecommendationResources(response, &metadata) + } + output := &ListOrganizationRecommendationResourcesOutput{} + 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_deserializeOpDocumentListOrganizationRecommendationResourcesOutput(&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_deserializeOpErrorListOrganizationRecommendationResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListOrganizationRecommendationResourcesOutput(v **ListOrganizationRecommendationResourcesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListOrganizationRecommendationResourcesOutput + if *v == nil { + sv = &ListOrganizationRecommendationResourcesOutput{} + } 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 "organizationRecommendationResourceSummaries": + if err := awsRestjson1_deserializeDocumentOrganizationRecommendationResourceSummaryList(&sv.OrganizationRecommendationResourceSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListOrganizationRecommendations struct { +} + +func (*awsRestjson1_deserializeOpListOrganizationRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListOrganizationRecommendations) HandleDeserialize(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_deserializeOpErrorListOrganizationRecommendations(response, &metadata) + } + output := &ListOrganizationRecommendationsOutput{} + 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_deserializeOpDocumentListOrganizationRecommendationsOutput(&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_deserializeOpErrorListOrganizationRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListOrganizationRecommendationsOutput(v **ListOrganizationRecommendationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListOrganizationRecommendationsOutput + if *v == nil { + sv = &ListOrganizationRecommendationsOutput{} + } 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 "organizationRecommendationSummaries": + if err := awsRestjson1_deserializeDocumentOrganizationRecommendationSummaryList(&sv.OrganizationRecommendationSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRecommendationResources struct { +} + +func (*awsRestjson1_deserializeOpListRecommendationResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRecommendationResources) HandleDeserialize(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_deserializeOpErrorListRecommendationResources(response, &metadata) + } + output := &ListRecommendationResourcesOutput{} + 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_deserializeOpDocumentListRecommendationResourcesOutput(&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_deserializeOpErrorListRecommendationResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRecommendationResourcesOutput(v **ListRecommendationResourcesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListRecommendationResourcesOutput + if *v == nil { + sv = &ListRecommendationResourcesOutput{} + } 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 "recommendationResourceSummaries": + if err := awsRestjson1_deserializeDocumentRecommendationResourceSummaryList(&sv.RecommendationResourceSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRecommendations struct { +} + +func (*awsRestjson1_deserializeOpListRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRecommendations) HandleDeserialize(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_deserializeOpErrorListRecommendations(response, &metadata) + } + output := &ListRecommendationsOutput{} + 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_deserializeOpDocumentListRecommendationsOutput(&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_deserializeOpErrorListRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRecommendationsOutput(v **ListRecommendationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListRecommendationsOutput + if *v == nil { + sv = &ListRecommendationsOutput{} + } 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 "recommendationSummaries": + if err := awsRestjson1_deserializeDocumentRecommendationSummaryList(&sv.RecommendationSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateOrganizationRecommendationLifecycle struct { +} + +func (*awsRestjson1_deserializeOpUpdateOrganizationRecommendationLifecycle) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateOrganizationRecommendationLifecycle) HandleDeserialize(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_deserializeOpErrorUpdateOrganizationRecommendationLifecycle(response, &metadata) + } + output := &UpdateOrganizationRecommendationLifecycleOutput{} + 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_deserializeOpErrorUpdateOrganizationRecommendationLifecycle(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateRecommendationLifecycle struct { +} + +func (*awsRestjson1_deserializeOpUpdateRecommendationLifecycle) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateRecommendationLifecycle) HandleDeserialize(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_deserializeOpErrorUpdateRecommendationLifecycle(response, &metadata) + } + output := &UpdateRecommendationLifecycleOutput{} + 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_deserializeOpErrorUpdateRecommendationLifecycle(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_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_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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + 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_deserializeDocumentAccountRecommendationLifecycleSummary(v **types.AccountRecommendationLifecycleSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AccountRecommendationLifecycleSummary + if *v == nil { + sv = &types.AccountRecommendationLifecycleSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "accountRecommendationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountRecommendationArn to be of type string, got %T instead", value) + } + sv.AccountRecommendationArn = ptr.String(jtv) + } + + case "lastUpdatedAt": + 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.LastUpdatedAt = ptr.Time(t) + } + + case "lifecycleStage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationLifecycleStage to be of type string, got %T instead", value) + } + sv.LifecycleStage = types.RecommendationLifecycleStage(jtv) + } + + case "updatedOnBehalfOf": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpdatedOnBehalfOf = ptr.String(jtv) + } + + case "updatedOnBehalfOfJobTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpdatedOnBehalfOfJobTitle = ptr.String(jtv) + } + + case "updateReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationUpdateReason to be of type string, got %T instead", value) + } + sv.UpdateReason = ptr.String(jtv) + } + + case "updateReasonCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateRecommendationLifecycleStageReasonCode to be of type string, got %T instead", value) + } + sv.UpdateReasonCode = types.UpdateRecommendationLifecycleStageReasonCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountRecommendationLifecycleSummaryList(v *[]types.AccountRecommendationLifecycleSummary, 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.AccountRecommendationLifecycleSummary + if *v == nil { + cv = []types.AccountRecommendationLifecycleSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountRecommendationLifecycleSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccountRecommendationLifecycleSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCheckSummary(v **types.CheckSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CheckSummary + if *v == nil { + sv = &types.CheckSummary{} + } 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 CheckArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "awsServices": + if err := awsRestjson1_deserializeDocumentRecommendationAwsServiceList(&sv.AwsServices, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentStringMap(&sv.Metadata, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pillars": + if err := awsRestjson1_deserializeDocumentRecommendationPillarList(&sv.Pillars, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationSource to be of type string, got %T instead", value) + } + sv.Source = types.RecommendationSource(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCheckSummaryList(v *[]types.CheckSummary, 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.CheckSummary + if *v == nil { + cv = []types.CheckSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CheckSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCheckSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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_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_deserializeDocumentOrganizationRecommendation(v **types.OrganizationRecommendation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.OrganizationRecommendation + if *v == nil { + sv = &types.OrganizationRecommendation{} + } 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 OrganizationRecommendationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "awsServices": + if err := awsRestjson1_deserializeDocumentRecommendationAwsServiceList(&sv.AwsServices, value); err != nil { + return err + } + + case "checkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CheckArn = 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 "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + 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.LastUpdatedAt = ptr.Time(t) + } + + case "lifecycleStage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationLifecycleStage to be of type string, got %T instead", value) + } + sv.LifecycleStage = types.RecommendationLifecycleStage(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pillars": + if err := awsRestjson1_deserializeDocumentRecommendationPillarList(&sv.Pillars, value); err != nil { + return err + } + + case "pillarSpecificAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationPillarSpecificAggregates(&sv.PillarSpecificAggregates, value); err != nil { + return err + } + + case "resolvedAt": + 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.ResolvedAt = ptr.Time(t) + } + + case "resourcesAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationResourcesAggregates(&sv.ResourcesAggregates, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationSource to be of type string, got %T instead", value) + } + sv.Source = types.RecommendationSource(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value) + } + sv.Status = types.RecommendationStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationType to be of type string, got %T instead", value) + } + sv.Type = types.RecommendationType(jtv) + } + + case "updatedOnBehalfOf": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpdatedOnBehalfOf = ptr.String(jtv) + } + + case "updatedOnBehalfOfJobTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpdatedOnBehalfOfJobTitle = ptr.String(jtv) + } + + case "updateReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationUpdateReason to be of type string, got %T instead", value) + } + sv.UpdateReason = ptr.String(jtv) + } + + case "updateReasonCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateRecommendationLifecycleStageReasonCode to be of type string, got %T instead", value) + } + sv.UpdateReasonCode = types.UpdateRecommendationLifecycleStageReasonCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOrganizationRecommendationResourceSummary(v **types.OrganizationRecommendationResourceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.OrganizationRecommendationResourceSummary + if *v == nil { + sv = &types.OrganizationRecommendationResourceSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "awsResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AwsResourceId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + 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.LastUpdatedAt = ptr.Time(t) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentStringMap(&sv.Metadata, value); err != nil { + return err + } + + case "recommendationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OrganizationRecommendationArn to be of type string, got %T instead", value) + } + sv.RecommendationArn = ptr.String(jtv) + } + + case "regionCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationRegionCode to be of type string, got %T instead", value) + } + sv.RegionCode = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.ResourceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOrganizationRecommendationResourceSummaryList(v *[]types.OrganizationRecommendationResourceSummary, 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.OrganizationRecommendationResourceSummary + if *v == nil { + cv = []types.OrganizationRecommendationResourceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OrganizationRecommendationResourceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentOrganizationRecommendationResourceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentOrganizationRecommendationSummary(v **types.OrganizationRecommendationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.OrganizationRecommendationSummary + if *v == nil { + sv = &types.OrganizationRecommendationSummary{} + } 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 OrganizationRecommendationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "awsServices": + if err := awsRestjson1_deserializeDocumentRecommendationAwsServiceList(&sv.AwsServices, value); err != nil { + return err + } + + case "checkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CheckArn = 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 "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + 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.LastUpdatedAt = ptr.Time(t) + } + + case "lifecycleStage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationLifecycleStage to be of type string, got %T instead", value) + } + sv.LifecycleStage = types.RecommendationLifecycleStage(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pillars": + if err := awsRestjson1_deserializeDocumentRecommendationPillarList(&sv.Pillars, value); err != nil { + return err + } + + case "pillarSpecificAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationPillarSpecificAggregates(&sv.PillarSpecificAggregates, value); err != nil { + return err + } + + case "resourcesAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationResourcesAggregates(&sv.ResourcesAggregates, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationSource to be of type string, got %T instead", value) + } + sv.Source = types.RecommendationSource(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value) + } + sv.Status = types.RecommendationStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationType to be of type string, got %T instead", value) + } + sv.Type = types.RecommendationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOrganizationRecommendationSummaryList(v *[]types.OrganizationRecommendationSummary, 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.OrganizationRecommendationSummary + if *v == nil { + cv = []types.OrganizationRecommendationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OrganizationRecommendationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentOrganizationRecommendationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Recommendation + if *v == nil { + sv = &types.Recommendation{} + } 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 AccountRecommendationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "awsServices": + if err := awsRestjson1_deserializeDocumentRecommendationAwsServiceList(&sv.AwsServices, value); err != nil { + return err + } + + case "checkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CheckArn = 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 "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + 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.LastUpdatedAt = ptr.Time(t) + } + + case "lifecycleStage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationLifecycleStage to be of type string, got %T instead", value) + } + sv.LifecycleStage = types.RecommendationLifecycleStage(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pillars": + if err := awsRestjson1_deserializeDocumentRecommendationPillarList(&sv.Pillars, value); err != nil { + return err + } + + case "pillarSpecificAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationPillarSpecificAggregates(&sv.PillarSpecificAggregates, value); err != nil { + return err + } + + case "resolvedAt": + 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.ResolvedAt = ptr.Time(t) + } + + case "resourcesAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationResourcesAggregates(&sv.ResourcesAggregates, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationSource to be of type string, got %T instead", value) + } + sv.Source = types.RecommendationSource(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value) + } + sv.Status = types.RecommendationStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationType to be of type string, got %T instead", value) + } + sv.Type = types.RecommendationType(jtv) + } + + case "updatedOnBehalfOf": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpdatedOnBehalfOf = ptr.String(jtv) + } + + case "updatedOnBehalfOfJobTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UpdatedOnBehalfOfJobTitle = ptr.String(jtv) + } + + case "updateReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationUpdateReason to be of type string, got %T instead", value) + } + sv.UpdateReason = ptr.String(jtv) + } + + case "updateReasonCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateRecommendationLifecycleStageReasonCode to be of type string, got %T instead", value) + } + sv.UpdateReasonCode = types.UpdateRecommendationLifecycleStageReasonCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationAwsServiceList(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 RecommendationAwsService to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationCostOptimizingAggregates(v **types.RecommendationCostOptimizingAggregates, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RecommendationCostOptimizingAggregates + if *v == nil { + sv = &types.RecommendationCostOptimizingAggregates{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "estimatedMonthlySavings": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedMonthlySavings = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.EstimatedMonthlySavings = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedPercentMonthlySavings": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedPercentMonthlySavings = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.EstimatedPercentMonthlySavings = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationPillarList(v *[]types.RecommendationPillar, 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.RecommendationPillar + if *v == nil { + cv = []types.RecommendationPillar{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationPillar + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationPillar to be of type string, got %T instead", value) + } + col = types.RecommendationPillar(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationPillarSpecificAggregates(v **types.RecommendationPillarSpecificAggregates, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RecommendationPillarSpecificAggregates + if *v == nil { + sv = &types.RecommendationPillarSpecificAggregates{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "costOptimizing": + if err := awsRestjson1_deserializeDocumentRecommendationCostOptimizingAggregates(&sv.CostOptimizing, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationResourcesAggregates(v **types.RecommendationResourcesAggregates, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RecommendationResourcesAggregates + if *v == nil { + sv = &types.RecommendationResourcesAggregates{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ErrorCount = ptr.Int64(i64) + } + + case "okCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.OkCount = ptr.Int64(i64) + } + + case "warningCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WarningCount = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationResourceSummary(v **types.RecommendationResourceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RecommendationResourceSummary + if *v == nil { + sv = &types.RecommendationResourceSummary{} + } 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 RecommendationResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "awsResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AwsResourceId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + 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.LastUpdatedAt = ptr.Time(t) + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentStringMap(&sv.Metadata, value); err != nil { + return err + } + + case "recommendationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountRecommendationArn to be of type string, got %T instead", value) + } + sv.RecommendationArn = ptr.String(jtv) + } + + case "regionCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationRegionCode to be of type string, got %T instead", value) + } + sv.RegionCode = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.ResourceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationResourceSummaryList(v *[]types.RecommendationResourceSummary, 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.RecommendationResourceSummary + if *v == nil { + cv = []types.RecommendationResourceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationResourceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationResourceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationSummary(v **types.RecommendationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RecommendationSummary + if *v == nil { + sv = &types.RecommendationSummary{} + } 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 AccountRecommendationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "awsServices": + if err := awsRestjson1_deserializeDocumentRecommendationAwsServiceList(&sv.AwsServices, value); err != nil { + return err + } + + case "checkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CheckArn = 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 "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + 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.LastUpdatedAt = ptr.Time(t) + } + + case "lifecycleStage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationLifecycleStage to be of type string, got %T instead", value) + } + sv.LifecycleStage = types.RecommendationLifecycleStage(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "pillars": + if err := awsRestjson1_deserializeDocumentRecommendationPillarList(&sv.Pillars, value); err != nil { + return err + } + + case "pillarSpecificAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationPillarSpecificAggregates(&sv.PillarSpecificAggregates, value); err != nil { + return err + } + + case "resourcesAggregates": + if err := awsRestjson1_deserializeDocumentRecommendationResourcesAggregates(&sv.ResourcesAggregates, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationSource to be of type string, got %T instead", value) + } + sv.Source = types.RecommendationSource(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value) + } + sv.Status = types.RecommendationStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationType to be of type string, got %T instead", value) + } + sv.Type = types.RecommendationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationSummaryList(v *[]types.RecommendationSummary, 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.RecommendationSummary + if *v == nil { + cv = []types.RecommendationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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_deserializeDocumentStringMap(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 String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + 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/trustedadvisor/doc.go b/service/trustedadvisor/doc.go new file mode 100644 index 00000000000..f5d68e94247 --- /dev/null +++ b/service/trustedadvisor/doc.go @@ -0,0 +1,7 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package trustedadvisor provides the API client, operations, and parameter types +// for TrustedAdvisor Public API. +// +// TrustedAdvisor Public API +package trustedadvisor diff --git a/service/trustedadvisor/endpoints.go b/service/trustedadvisor/endpoints.go new file mode 100644 index 00000000000..0b0a40d85c8 --- /dev/null +++ b/service/trustedadvisor/endpoints.go @@ -0,0 +1,509 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/trustedadvisor/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "trustedadvisor" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_TRUSTEDADVISOR") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "TrustedAdvisor", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://trustedadvisor-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://trustedadvisor-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://trustedadvisor.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://trustedadvisor.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/trustedadvisor/endpoints_config_test.go b/service/trustedadvisor/endpoints_config_test.go new file mode 100644 index 00000000000..0cb7584c76f --- /dev/null +++ b/service/trustedadvisor/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-trustedadvisor.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-trustedadvisor.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-trustedadvisor.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-trustedadvisor.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-trustedadvisor.dev", + expectURL: aws.String("https://env-trustedadvisor.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-trustedadvisor.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-trustedadvisor.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-trustedadvisor.dev", + expectURL: aws.String("http://config-trustedadvisor.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-trustedadvisor.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-trustedadvisor.dev", + clientEndpoint: aws.String("https://client-trustedadvisor.dev"), + expectURL: aws.String("https://client-trustedadvisor.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_TRUSTEDADVISOR", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/trustedadvisor/endpoints_test.go b/service/trustedadvisor/endpoints_test.go new file mode 100644 index 00000000000..a8bcb5f2e04 --- /dev/null +++ b/service/trustedadvisor/endpoints_test.go @@ -0,0 +1,856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "github.com/google/go-cmp/cmp" + "net/http" + "net/url" + "strings" + "testing" +) + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack disabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://trustedadvisor.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with region not set and fips disabled and dualstack disabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with fips enabled and dualstack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/trustedadvisor/generated.json b/service/trustedadvisor/generated.json new file mode 100644 index 00000000000..5379ad22c60 --- /dev/null +++ b/service/trustedadvisor/generated.json @@ -0,0 +1,42 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_GetOrganizationRecommendation.go", + "api_op_GetRecommendation.go", + "api_op_ListChecks.go", + "api_op_ListOrganizationRecommendationAccounts.go", + "api_op_ListOrganizationRecommendationResources.go", + "api_op_ListOrganizationRecommendations.go", + "api_op_ListRecommendationResources.go", + "api_op_ListRecommendations.go", + "api_op_UpdateOrganizationRecommendationLifecycle.go", + "api_op_UpdateRecommendationLifecycle.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/trustedadvisor", + "unstable": false +} diff --git a/service/trustedadvisor/go.mod b/service/trustedadvisor/go.mod new file mode 100644 index 00000000000..e601d806391 --- /dev/null +++ b/service/trustedadvisor/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/trustedadvisor + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.0 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 + github.com/aws/smithy-go v1.17.0 + github.com/google/go-cmp v0.5.8 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/trustedadvisor/go.sum b/service/trustedadvisor/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/trustedadvisor/go.sum @@ -0,0 +1,4 @@ +github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= +github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= diff --git a/service/trustedadvisor/go_module_metadata.go b/service/trustedadvisor/go_module_metadata.go new file mode 100644 index 00000000000..12b57af7df0 --- /dev/null +++ b/service/trustedadvisor/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package trustedadvisor + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/trustedadvisor/internal/endpoints/endpoints.go b/service/trustedadvisor/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..82391cbb10e --- /dev/null +++ b/service/trustedadvisor/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver TrustedAdvisor endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "trustedadvisor.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "trustedadvisor.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "trustedadvisor.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "trustedadvisor.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "trustedadvisor.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "trustedadvisor.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "trustedadvisor.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "trustedadvisor.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "trustedadvisor.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "trustedadvisor-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "trustedadvisor.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/trustedadvisor/internal/endpoints/endpoints_test.go b/service/trustedadvisor/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/trustedadvisor/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/trustedadvisor/options.go b/service/trustedadvisor/options.go new file mode 100644 index 00000000000..5044644b248 --- /dev/null +++ b/service/trustedadvisor/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { + options.Credentials = nil + } +} diff --git a/service/trustedadvisor/protocol_test.go b/service/trustedadvisor/protocol_test.go new file mode 100644 index 00000000000..6d2fea82aa2 --- /dev/null +++ b/service/trustedadvisor/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor diff --git a/service/trustedadvisor/serializers.go b/service/trustedadvisor/serializers.go new file mode 100644 index 00000000000..041facefff4 --- /dev/null +++ b/service/trustedadvisor/serializers.go @@ -0,0 +1,856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +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" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpGetOrganizationRecommendation struct { +} + +func (*awsRestjson1_serializeOpGetOrganizationRecommendation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetOrganizationRecommendation) 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.(*GetOrganizationRecommendationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/organization-recommendations/{organizationRecommendationIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetOrganizationRecommendationInput(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_serializeOpHttpBindingsGetOrganizationRecommendationInput(v *GetOrganizationRecommendationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.OrganizationRecommendationIdentifier == nil || len(*v.OrganizationRecommendationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member organizationRecommendationIdentifier must not be empty")} + } + if v.OrganizationRecommendationIdentifier != nil { + if err := encoder.SetURI("organizationRecommendationIdentifier").String(*v.OrganizationRecommendationIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetRecommendation struct { +} + +func (*awsRestjson1_serializeOpGetRecommendation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRecommendation) 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.(*GetRecommendationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/recommendations/{recommendationIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetRecommendationInput(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_serializeOpHttpBindingsGetRecommendationInput(v *GetRecommendationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RecommendationIdentifier == nil || len(*v.RecommendationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member recommendationIdentifier must not be empty")} + } + if v.RecommendationIdentifier != nil { + if err := encoder.SetURI("recommendationIdentifier").String(*v.RecommendationIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListChecks struct { +} + +func (*awsRestjson1_serializeOpListChecks) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListChecks) 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.(*ListChecksInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/checks") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListChecksInput(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_serializeOpHttpBindingsListChecksInput(v *ListChecksInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AwsService != nil { + encoder.SetQuery("awsService").String(*v.AwsService) + } + + if len(v.Language) > 0 { + encoder.SetQuery("language").String(string(v.Language)) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Pillar) > 0 { + encoder.SetQuery("pillar").String(string(v.Pillar)) + } + + if len(v.Source) > 0 { + encoder.SetQuery("source").String(string(v.Source)) + } + + return nil +} + +type awsRestjson1_serializeOpListOrganizationRecommendationAccounts struct { +} + +func (*awsRestjson1_serializeOpListOrganizationRecommendationAccounts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListOrganizationRecommendationAccounts) 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.(*ListOrganizationRecommendationAccountsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/organization-recommendations/{organizationRecommendationIdentifier}/accounts") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListOrganizationRecommendationAccountsInput(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_serializeOpHttpBindingsListOrganizationRecommendationAccountsInput(v *ListOrganizationRecommendationAccountsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AffectedAccountId != nil { + encoder.SetQuery("affectedAccountId").String(*v.AffectedAccountId) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.OrganizationRecommendationIdentifier == nil || len(*v.OrganizationRecommendationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member organizationRecommendationIdentifier must not be empty")} + } + if v.OrganizationRecommendationIdentifier != nil { + if err := encoder.SetURI("organizationRecommendationIdentifier").String(*v.OrganizationRecommendationIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListOrganizationRecommendationResources struct { +} + +func (*awsRestjson1_serializeOpListOrganizationRecommendationResources) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListOrganizationRecommendationResources) 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.(*ListOrganizationRecommendationResourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/organization-recommendations/{organizationRecommendationIdentifier}/resources") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListOrganizationRecommendationResourcesInput(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_serializeOpHttpBindingsListOrganizationRecommendationResourcesInput(v *ListOrganizationRecommendationResourcesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AffectedAccountId != nil { + encoder.SetQuery("affectedAccountId").String(*v.AffectedAccountId) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.OrganizationRecommendationIdentifier == nil || len(*v.OrganizationRecommendationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member organizationRecommendationIdentifier must not be empty")} + } + if v.OrganizationRecommendationIdentifier != nil { + if err := encoder.SetURI("organizationRecommendationIdentifier").String(*v.OrganizationRecommendationIdentifier); err != nil { + return err + } + } + + if v.RegionCode != nil { + encoder.SetQuery("regionCode").String(*v.RegionCode) + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + return nil +} + +type awsRestjson1_serializeOpListOrganizationRecommendations struct { +} + +func (*awsRestjson1_serializeOpListOrganizationRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListOrganizationRecommendations) 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.(*ListOrganizationRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/organization-recommendations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListOrganizationRecommendationsInput(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_serializeOpHttpBindingsListOrganizationRecommendationsInput(v *ListOrganizationRecommendationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AfterLastUpdatedAt != nil { + encoder.SetQuery("afterLastUpdatedAt").String(smithytime.FormatDateTime(*v.AfterLastUpdatedAt)) + } + + if v.AwsService != nil { + encoder.SetQuery("awsService").String(*v.AwsService) + } + + if v.BeforeLastUpdatedAt != nil { + encoder.SetQuery("beforeLastUpdatedAt").String(smithytime.FormatDateTime(*v.BeforeLastUpdatedAt)) + } + + if v.CheckIdentifier != nil { + encoder.SetQuery("checkIdentifier").String(*v.CheckIdentifier) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Pillar) > 0 { + encoder.SetQuery("pillar").String(string(v.Pillar)) + } + + if len(v.Source) > 0 { + encoder.SetQuery("source").String(string(v.Source)) + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + if len(v.Type) > 0 { + encoder.SetQuery("type").String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpListRecommendationResources struct { +} + +func (*awsRestjson1_serializeOpListRecommendationResources) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRecommendationResources) 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.(*ListRecommendationResourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/recommendations/{recommendationIdentifier}/resources") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListRecommendationResourcesInput(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_serializeOpHttpBindingsListRecommendationResourcesInput(v *ListRecommendationResourcesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.RecommendationIdentifier == nil || len(*v.RecommendationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member recommendationIdentifier must not be empty")} + } + if v.RecommendationIdentifier != nil { + if err := encoder.SetURI("recommendationIdentifier").String(*v.RecommendationIdentifier); err != nil { + return err + } + } + + if v.RegionCode != nil { + encoder.SetQuery("regionCode").String(*v.RegionCode) + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + return nil +} + +type awsRestjson1_serializeOpListRecommendations struct { +} + +func (*awsRestjson1_serializeOpListRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRecommendations) 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.(*ListRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/recommendations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListRecommendationsInput(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_serializeOpHttpBindingsListRecommendationsInput(v *ListRecommendationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AfterLastUpdatedAt != nil { + encoder.SetQuery("afterLastUpdatedAt").String(smithytime.FormatDateTime(*v.AfterLastUpdatedAt)) + } + + if v.AwsService != nil { + encoder.SetQuery("awsService").String(*v.AwsService) + } + + if v.BeforeLastUpdatedAt != nil { + encoder.SetQuery("beforeLastUpdatedAt").String(smithytime.FormatDateTime(*v.BeforeLastUpdatedAt)) + } + + if v.CheckIdentifier != nil { + encoder.SetQuery("checkIdentifier").String(*v.CheckIdentifier) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Pillar) > 0 { + encoder.SetQuery("pillar").String(string(v.Pillar)) + } + + if len(v.Source) > 0 { + encoder.SetQuery("source").String(string(v.Source)) + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + if len(v.Type) > 0 { + encoder.SetQuery("type").String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateOrganizationRecommendationLifecycle struct { +} + +func (*awsRestjson1_serializeOpUpdateOrganizationRecommendationLifecycle) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateOrganizationRecommendationLifecycle) 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.(*UpdateOrganizationRecommendationLifecycleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/organization-recommendations/{organizationRecommendationIdentifier}/lifecycle") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateOrganizationRecommendationLifecycleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateOrganizationRecommendationLifecycleInput(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_serializeOpHttpBindingsUpdateOrganizationRecommendationLifecycleInput(v *UpdateOrganizationRecommendationLifecycleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.OrganizationRecommendationIdentifier == nil || len(*v.OrganizationRecommendationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member organizationRecommendationIdentifier must not be empty")} + } + if v.OrganizationRecommendationIdentifier != nil { + if err := encoder.SetURI("organizationRecommendationIdentifier").String(*v.OrganizationRecommendationIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateOrganizationRecommendationLifecycleInput(v *UpdateOrganizationRecommendationLifecycleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.LifecycleStage) > 0 { + ok := object.Key("lifecycleStage") + ok.String(string(v.LifecycleStage)) + } + + if v.UpdateReason != nil { + ok := object.Key("updateReason") + ok.String(*v.UpdateReason) + } + + if len(v.UpdateReasonCode) > 0 { + ok := object.Key("updateReasonCode") + ok.String(string(v.UpdateReasonCode)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateRecommendationLifecycle struct { +} + +func (*awsRestjson1_serializeOpUpdateRecommendationLifecycle) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateRecommendationLifecycle) 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.(*UpdateRecommendationLifecycleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/recommendations/{recommendationIdentifier}/lifecycle") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateRecommendationLifecycleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateRecommendationLifecycleInput(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_serializeOpHttpBindingsUpdateRecommendationLifecycleInput(v *UpdateRecommendationLifecycleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RecommendationIdentifier == nil || len(*v.RecommendationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member recommendationIdentifier must not be empty")} + } + if v.RecommendationIdentifier != nil { + if err := encoder.SetURI("recommendationIdentifier").String(*v.RecommendationIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateRecommendationLifecycleInput(v *UpdateRecommendationLifecycleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.LifecycleStage) > 0 { + ok := object.Key("lifecycleStage") + ok.String(string(v.LifecycleStage)) + } + + if v.UpdateReason != nil { + ok := object.Key("updateReason") + ok.String(*v.UpdateReason) + } + + if len(v.UpdateReasonCode) > 0 { + ok := object.Key("updateReasonCode") + ok.String(string(v.UpdateReasonCode)) + } + + return nil +} diff --git a/service/trustedadvisor/types/enums.go b/service/trustedadvisor/types/enums.go new file mode 100644 index 00000000000..20b03548ba8 --- /dev/null +++ b/service/trustedadvisor/types/enums.go @@ -0,0 +1,238 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type RecommendationLanguage string + +// Enum values for RecommendationLanguage +const ( + RecommendationLanguageEnglish RecommendationLanguage = "en" + RecommendationLanguageJapanese RecommendationLanguage = "ja" + RecommendationLanguageChinese RecommendationLanguage = "zh" + RecommendationLanguageFrench RecommendationLanguage = "fr" + RecommendationLanguageGerman RecommendationLanguage = "de" + RecommendationLanguageKorean RecommendationLanguage = "ko" + RecommendationLanguageTraditionalChinese RecommendationLanguage = "zh_TW" + RecommendationLanguageItalian RecommendationLanguage = "it" + RecommendationLanguageSpanish RecommendationLanguage = "es" + RecommendationLanguageBrazilianPortuguese RecommendationLanguage = "pt_BR" + RecommendationLanguageBahasaIndonesia RecommendationLanguage = "id" +) + +// Values returns all known values for RecommendationLanguage. 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 (RecommendationLanguage) Values() []RecommendationLanguage { + return []RecommendationLanguage{ + "en", + "ja", + "zh", + "fr", + "de", + "ko", + "zh_TW", + "it", + "es", + "pt_BR", + "id", + } +} + +type RecommendationLifecycleStage string + +// Enum values for RecommendationLifecycleStage +const ( + RecommendationLifecycleStageInProgress RecommendationLifecycleStage = "in_progress" + RecommendationLifecycleStagePendingResponse RecommendationLifecycleStage = "pending_response" + RecommendationLifecycleStageDismissed RecommendationLifecycleStage = "dismissed" + RecommendationLifecycleStageResolved RecommendationLifecycleStage = "resolved" +) + +// Values returns all known values for RecommendationLifecycleStage. 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 (RecommendationLifecycleStage) Values() []RecommendationLifecycleStage { + return []RecommendationLifecycleStage{ + "in_progress", + "pending_response", + "dismissed", + "resolved", + } +} + +type RecommendationPillar string + +// Enum values for RecommendationPillar +const ( + RecommendationPillarCostOptimizing RecommendationPillar = "cost_optimizing" + RecommendationPillarPerformance RecommendationPillar = "performance" + RecommendationPillarSecurity RecommendationPillar = "security" + RecommendationPillarServiceLimits RecommendationPillar = "service_limits" + RecommendationPillarFaultTolerance RecommendationPillar = "fault_tolerance" + RecommendationPillarOperationalExcellence RecommendationPillar = "operational_excellence" +) + +// Values returns all known values for RecommendationPillar. 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 (RecommendationPillar) Values() []RecommendationPillar { + return []RecommendationPillar{ + "cost_optimizing", + "performance", + "security", + "service_limits", + "fault_tolerance", + "operational_excellence", + } +} + +type RecommendationSource string + +// Enum values for RecommendationSource +const ( + RecommendationSourceAwsConfig RecommendationSource = "aws_config" + RecommendationSourceComputeOptimizer RecommendationSource = "compute_optimizer" + RecommendationSourceCostExplorer RecommendationSource = "cost_explorer" + RecommendationSourceLse RecommendationSource = "lse" + RecommendationSourceManual RecommendationSource = "manual" + RecommendationSourcePse RecommendationSource = "pse" + RecommendationSourceRds RecommendationSource = "rds" + RecommendationSourceResilience RecommendationSource = "resilience" + RecommendationSourceResilienceHub RecommendationSource = "resilience_hub" + RecommendationSourceSecurityHub RecommendationSource = "security_hub" + RecommendationSourceStir RecommendationSource = "stir" + RecommendationSourceTaCheck RecommendationSource = "ta_check" + RecommendationSourceWellArchitected RecommendationSource = "well_architected" +) + +// Values returns all known values for RecommendationSource. 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 (RecommendationSource) Values() []RecommendationSource { + return []RecommendationSource{ + "aws_config", + "compute_optimizer", + "cost_explorer", + "lse", + "manual", + "pse", + "rds", + "resilience", + "resilience_hub", + "security_hub", + "stir", + "ta_check", + "well_architected", + } +} + +type RecommendationStatus string + +// Enum values for RecommendationStatus +const ( + RecommendationStatusOk RecommendationStatus = "ok" + RecommendationStatusWarning RecommendationStatus = "warning" + RecommendationStatusError RecommendationStatus = "error" +) + +// Values returns all known values for RecommendationStatus. 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 (RecommendationStatus) Values() []RecommendationStatus { + return []RecommendationStatus{ + "ok", + "warning", + "error", + } +} + +type RecommendationType string + +// Enum values for RecommendationType +const ( + RecommendationTypeStandard RecommendationType = "standard" + RecommendationTypePriority RecommendationType = "priority" +) + +// Values returns all known values for RecommendationType. 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 (RecommendationType) Values() []RecommendationType { + return []RecommendationType{ + "standard", + "priority", + } +} + +type ResourceStatus string + +// Enum values for ResourceStatus +const ( + ResourceStatusOk ResourceStatus = "ok" + ResourceStatusWarning ResourceStatus = "warning" + ResourceStatusError ResourceStatus = "error" +) + +// Values returns all known values for ResourceStatus. 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 (ResourceStatus) Values() []ResourceStatus { + return []ResourceStatus{ + "ok", + "warning", + "error", + } +} + +type UpdateRecommendationLifecycleStage string + +// Enum values for UpdateRecommendationLifecycleStage +const ( + UpdateRecommendationLifecycleStagePendingResponse UpdateRecommendationLifecycleStage = "pending_response" + UpdateRecommendationLifecycleStageInProgress UpdateRecommendationLifecycleStage = "in_progress" + UpdateRecommendationLifecycleStageDismissed UpdateRecommendationLifecycleStage = "dismissed" + UpdateRecommendationLifecycleStageResolved UpdateRecommendationLifecycleStage = "resolved" +) + +// Values returns all known values for UpdateRecommendationLifecycleStage. 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 (UpdateRecommendationLifecycleStage) Values() []UpdateRecommendationLifecycleStage { + return []UpdateRecommendationLifecycleStage{ + "pending_response", + "in_progress", + "dismissed", + "resolved", + } +} + +type UpdateRecommendationLifecycleStageReasonCode string + +// Enum values for UpdateRecommendationLifecycleStageReasonCode +const ( + UpdateRecommendationLifecycleStageReasonCodeNonCriticalAccount UpdateRecommendationLifecycleStageReasonCode = "non_critical_account" + UpdateRecommendationLifecycleStageReasonCodeTemporaryAccount UpdateRecommendationLifecycleStageReasonCode = "temporary_account" + UpdateRecommendationLifecycleStageReasonCodeValidBusinessCase UpdateRecommendationLifecycleStageReasonCode = "valid_business_case" + UpdateRecommendationLifecycleStageReasonCodeOtherMethodsAvailable UpdateRecommendationLifecycleStageReasonCode = "other_methods_available" + UpdateRecommendationLifecycleStageReasonCodeLowPriority UpdateRecommendationLifecycleStageReasonCode = "low_priority" + UpdateRecommendationLifecycleStageReasonCodeNotApplicable UpdateRecommendationLifecycleStageReasonCode = "not_applicable" + UpdateRecommendationLifecycleStageReasonCodeOther UpdateRecommendationLifecycleStageReasonCode = "other" +) + +// Values returns all known values for +// UpdateRecommendationLifecycleStageReasonCode. 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 (UpdateRecommendationLifecycleStageReasonCode) Values() []UpdateRecommendationLifecycleStageReasonCode { + return []UpdateRecommendationLifecycleStageReasonCode{ + "non_critical_account", + "temporary_account", + "valid_business_case", + "other_methods_available", + "low_priority", + "not_applicable", + "other", + } +} diff --git a/service/trustedadvisor/types/errors.go b/service/trustedadvisor/types/errors.go new file mode 100644 index 00000000000..ed86f639fb8 --- /dev/null +++ b/service/trustedadvisor/types/errors.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Exception that access has been denied due to insufficient access +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception that the request was denied due to conflictions in state +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception to notify that an unexpected internal error occurred during +// processing of the request +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Exception that the requested resource has not been found +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception to notify that requests are being throttled +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception that the request failed to satisfy service constraints +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/trustedadvisor/types/types.go b/service/trustedadvisor/types/types.go new file mode 100644 index 00000000000..3d3b8178c8c --- /dev/null +++ b/service/trustedadvisor/types/types.go @@ -0,0 +1,554 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Summary of an AccountRecommendationLifecycle for an Organization Recommendation +type AccountRecommendationLifecycleSummary struct { + + // The AWS account ID + AccountId *string + + // The Recommendation ARN + AccountRecommendationArn *string + + // When the Recommendation was last updated + LastUpdatedAt *time.Time + + // The lifecycle stage from AWS Trusted Advisor Priority + LifecycleStage RecommendationLifecycleStage + + // Reason for the lifecycle stage change + UpdateReason *string + + // Reason code for the lifecycle state change + UpdateReasonCode UpdateRecommendationLifecycleStageReasonCode + + // The person on whose behalf a Technical Account Manager (TAM) updated the + // recommendation. This information is only available when a Technical Account + // Manager takes an action on a recommendation managed by AWS Trusted Advisor + // Priority + UpdatedOnBehalfOf *string + + // The job title of the person on whose behalf a Technical Account Manager (TAM) + // updated the recommendation. This information is only available when a Technical + // Account Manager takes an action on a recommendation managed by AWS Trusted + // Advisor Priority + UpdatedOnBehalfOfJobTitle *string + + noSmithyDocumentSerde +} + +// A summary of an AWS Trusted Advisor Check +type CheckSummary struct { + + // The ARN of the AWS Trusted Advisor Check + // + // This member is required. + Arn *string + + // The AWS Services that the Check applies to + // + // This member is required. + AwsServices []string + + // A description of what the AWS Trusted Advisor Check is monitoring + // + // This member is required. + Description *string + + // The unique identifier of the AWS Trusted Advisor Check + // + // This member is required. + Id *string + + // The column headings for the metadata returned in the resource + // + // This member is required. + Metadata map[string]string + + // The name of the AWS Trusted Advisor Check + // + // This member is required. + Name *string + + // The Recommendation pillars that the AWS Trusted Advisor Check falls under + // + // This member is required. + Pillars []RecommendationPillar + + // The source of the Recommendation + // + // This member is required. + Source RecommendationSource + + noSmithyDocumentSerde +} + +// A Recommendation for accounts within an Organization +type OrganizationRecommendation struct { + + // The ARN of the Recommendation + // + // This member is required. + Arn *string + + // A description for AWS Trusted Advisor recommendations + // + // This member is required. + Description *string + + // The ID which identifies where the Recommendation was produced + // + // This member is required. + Id *string + + // The name of the AWS Trusted Advisor Recommendation + // + // This member is required. + Name *string + + // The Pillars that the Recommendation is optimizing + // + // This member is required. + Pillars []RecommendationPillar + + // An aggregation of all resources + // + // This member is required. + ResourcesAggregates *RecommendationResourcesAggregates + + // The source of the Recommendation + // + // This member is required. + Source RecommendationSource + + // The status of the Recommendation + // + // This member is required. + Status RecommendationStatus + + // Whether the Recommendation was automated or generated by AWS Trusted Advisor + // Priority + // + // This member is required. + Type RecommendationType + + // The AWS Services that the Recommendation applies to + AwsServices []string + + // The AWS Trusted Advisor Check ARN that relates to the Recommendation + CheckArn *string + + // When the Recommendation was created, if created by AWS Trusted Advisor Priority + CreatedAt *time.Time + + // The creator, if created by AWS Trusted Advisor Priority + CreatedBy *string + + // When the Recommendation was last updated + LastUpdatedAt *time.Time + + // The lifecycle stage from AWS Trusted Advisor Priority + LifecycleStage RecommendationLifecycleStage + + // The pillar aggregations for cost savings + PillarSpecificAggregates *RecommendationPillarSpecificAggregates + + // When the Recommendation was resolved + ResolvedAt *time.Time + + // Reason for the lifecycle stage change + UpdateReason *string + + // Reason code for the lifecycle state change + UpdateReasonCode UpdateRecommendationLifecycleStageReasonCode + + // The person on whose behalf a Technical Account Manager (TAM) updated the + // recommendation. This information is only available when a Technical Account + // Manager takes an action on a recommendation managed by AWS Trusted Advisor + // Priority + UpdatedOnBehalfOf *string + + // The job title of the person on whose behalf a Technical Account Manager (TAM) + // updated the recommendation. This information is only available when a Technical + // Account Manager takes an action on a recommendation managed by AWS Trusted + // Advisor Priority + UpdatedOnBehalfOfJobTitle *string + + noSmithyDocumentSerde +} + +// Organization Recommendation Resource Summary +type OrganizationRecommendationResourceSummary struct { + + // The ARN of the Recommendation Resource + // + // This member is required. + Arn *string + + // The AWS resource identifier + // + // This member is required. + AwsResourceId *string + + // The ID of the Recommendation Resource + // + // This member is required. + Id *string + + // When the Recommendation Resource was last updated + // + // This member is required. + LastUpdatedAt *time.Time + + // Metadata associated with the Recommendation Resource + // + // This member is required. + Metadata map[string]string + + // The Recommendation ARN + // + // This member is required. + RecommendationArn *string + + // The AWS Region code that the Recommendation Resource is in + // + // This member is required. + RegionCode *string + + // The current status of the Recommendation Resource + // + // This member is required. + Status ResourceStatus + + // The AWS account ID + AccountId *string + + noSmithyDocumentSerde +} + +// Summary of recommendation for accounts within an Organization +type OrganizationRecommendationSummary struct { + + // The ARN of the Recommendation + // + // This member is required. + Arn *string + + // The ID which identifies where the Recommendation was produced + // + // This member is required. + Id *string + + // The name of the AWS Trusted Advisor Recommendation + // + // This member is required. + Name *string + + // The Pillars that the Recommendation is optimizing + // + // This member is required. + Pillars []RecommendationPillar + + // An aggregation of all resources + // + // This member is required. + ResourcesAggregates *RecommendationResourcesAggregates + + // The source of the Recommendation + // + // This member is required. + Source RecommendationSource + + // The status of the Recommendation + // + // This member is required. + Status RecommendationStatus + + // Whether the Recommendation was automated or generated by AWS Trusted Advisor + // Priority + // + // This member is required. + Type RecommendationType + + // The AWS Services that the Recommendation applies to + AwsServices []string + + // The AWS Trusted Advisor Check ARN that relates to the Recommendation + CheckArn *string + + // When the Recommendation was created, if created by AWS Trusted Advisor Priority + CreatedAt *time.Time + + // When the Recommendation was last updated + LastUpdatedAt *time.Time + + // The lifecycle stage from AWS Trusted Advisor Priority + LifecycleStage RecommendationLifecycleStage + + // The pillar aggregations for cost savings + PillarSpecificAggregates *RecommendationPillarSpecificAggregates + + noSmithyDocumentSerde +} + +// A Recommendation for an Account +type Recommendation struct { + + // The ARN of the Recommendation + // + // This member is required. + Arn *string + + // A description for AWS Trusted Advisor recommendations + // + // This member is required. + Description *string + + // The ID which identifies where the Recommendation was produced + // + // This member is required. + Id *string + + // The name of the AWS Trusted Advisor Recommendation + // + // This member is required. + Name *string + + // The Pillars that the Recommendation is optimizing + // + // This member is required. + Pillars []RecommendationPillar + + // An aggregation of all resources + // + // This member is required. + ResourcesAggregates *RecommendationResourcesAggregates + + // The source of the Recommendation + // + // This member is required. + Source RecommendationSource + + // The status of the Recommendation + // + // This member is required. + Status RecommendationStatus + + // Whether the Recommendation was automated or generated by AWS Trusted Advisor + // Priority + // + // This member is required. + Type RecommendationType + + // The AWS Services that the Recommendation applies to + AwsServices []string + + // The AWS Trusted Advisor Check ARN that relates to the Recommendation + CheckArn *string + + // When the Recommendation was created, if created by AWS Trusted Advisor Priority + CreatedAt *time.Time + + // The creator, if created by AWS Trusted Advisor Priority + CreatedBy *string + + // When the Recommendation was last updated + LastUpdatedAt *time.Time + + // The lifecycle stage from AWS Trusted Advisor Priority + LifecycleStage RecommendationLifecycleStage + + // The pillar aggregations for cost savings + PillarSpecificAggregates *RecommendationPillarSpecificAggregates + + // When the Recommendation was resolved + ResolvedAt *time.Time + + // Reason for the lifecycle stage change + UpdateReason *string + + // Reason code for the lifecycle state change + UpdateReasonCode UpdateRecommendationLifecycleStageReasonCode + + // The person on whose behalf a Technical Account Manager (TAM) updated the + // recommendation. This information is only available when a Technical Account + // Manager takes an action on a recommendation managed by AWS Trusted Advisor + // Priority + UpdatedOnBehalfOf *string + + // The job title of the person on whose behalf a Technical Account Manager (TAM) + // updated the recommendation. This information is only available when a Technical + // Account Manager takes an action on a recommendation managed by AWS Trusted + // Advisor Priority + UpdatedOnBehalfOfJobTitle *string + + noSmithyDocumentSerde +} + +// Cost optimizing aggregates for a Recommendation +type RecommendationCostOptimizingAggregates struct { + + // The estimated monthly savings + // + // This member is required. + EstimatedMonthlySavings *float64 + + // The estimated percently monthly savings + // + // This member is required. + EstimatedPercentMonthlySavings *float64 + + noSmithyDocumentSerde +} + +// Recommendation pillar aggregates +type RecommendationPillarSpecificAggregates struct { + + // Cost optimizing aggregates + CostOptimizing *RecommendationCostOptimizingAggregates + + noSmithyDocumentSerde +} + +// Aggregation of Recommendation Resources +type RecommendationResourcesAggregates struct { + + // The number of AWS resources that were flagged to have errors according to the + // Trusted Advisor check + // + // This member is required. + ErrorCount *int64 + + // The number of AWS resources that were flagged to be OK according to the Trusted + // Advisor check + // + // This member is required. + OkCount *int64 + + // The number of AWS resources that were flagged to have warning according to the + // Trusted Advisor check + // + // This member is required. + WarningCount *int64 + + noSmithyDocumentSerde +} + +// Summary of a Recommendation Resource +type RecommendationResourceSummary struct { + + // The ARN of the Recommendation Resource + // + // This member is required. + Arn *string + + // The AWS resource identifier + // + // This member is required. + AwsResourceId *string + + // The ID of the Recommendation Resource + // + // This member is required. + Id *string + + // When the Recommendation Resource was last updated + // + // This member is required. + LastUpdatedAt *time.Time + + // Metadata associated with the Recommendation Resource + // + // This member is required. + Metadata map[string]string + + // The Recommendation ARN + // + // This member is required. + RecommendationArn *string + + // The AWS Region code that the Recommendation Resource is in + // + // This member is required. + RegionCode *string + + // The current status of the Recommendation Resource + // + // This member is required. + Status ResourceStatus + + noSmithyDocumentSerde +} + +// Summary of Recommendation for an Account +type RecommendationSummary struct { + + // The ARN of the Recommendation + // + // This member is required. + Arn *string + + // The ID which identifies where the Recommendation was produced + // + // This member is required. + Id *string + + // The name of the AWS Trusted Advisor Recommendation + // + // This member is required. + Name *string + + // The Pillars that the Recommendation is optimizing + // + // This member is required. + Pillars []RecommendationPillar + + // An aggregation of all resources + // + // This member is required. + ResourcesAggregates *RecommendationResourcesAggregates + + // The source of the Recommendation + // + // This member is required. + Source RecommendationSource + + // The status of the Recommendation + // + // This member is required. + Status RecommendationStatus + + // Whether the Recommendation was automated or generated by AWS Trusted Advisor + // Priority + // + // This member is required. + Type RecommendationType + + // The AWS Services that the Recommendation applies to + AwsServices []string + + // The AWS Trusted Advisor Check ARN that relates to the Recommendation + CheckArn *string + + // When the Recommendation was created, if created by AWS Trusted Advisor Priority + CreatedAt *time.Time + + // When the Recommendation was last updated + LastUpdatedAt *time.Time + + // The lifecycle stage from AWS Trusted Advisor Priority + LifecycleStage RecommendationLifecycleStage + + // The pillar aggregations for cost savings + PillarSpecificAggregates *RecommendationPillarSpecificAggregates + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/trustedadvisor/validators.go b/service/trustedadvisor/validators.go new file mode 100644 index 00000000000..ca709931445 --- /dev/null +++ b/service/trustedadvisor/validators.go @@ -0,0 +1,289 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpGetOrganizationRecommendation struct { +} + +func (*validateOpGetOrganizationRecommendation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetOrganizationRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetOrganizationRecommendationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetOrganizationRecommendationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRecommendation struct { +} + +func (*validateOpGetRecommendation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRecommendationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRecommendationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListOrganizationRecommendationAccounts struct { +} + +func (*validateOpListOrganizationRecommendationAccounts) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListOrganizationRecommendationAccounts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListOrganizationRecommendationAccountsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListOrganizationRecommendationAccountsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListOrganizationRecommendationResources struct { +} + +func (*validateOpListOrganizationRecommendationResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListOrganizationRecommendationResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListOrganizationRecommendationResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListOrganizationRecommendationResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListRecommendationResources struct { +} + +func (*validateOpListRecommendationResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRecommendationResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRecommendationResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRecommendationResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateOrganizationRecommendationLifecycle struct { +} + +func (*validateOpUpdateOrganizationRecommendationLifecycle) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateOrganizationRecommendationLifecycle) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateOrganizationRecommendationLifecycleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateOrganizationRecommendationLifecycleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateRecommendationLifecycle struct { +} + +func (*validateOpUpdateRecommendationLifecycle) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRecommendationLifecycle) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRecommendationLifecycleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRecommendationLifecycleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpGetOrganizationRecommendationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetOrganizationRecommendation{}, middleware.After) +} + +func addOpGetRecommendationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRecommendation{}, middleware.After) +} + +func addOpListOrganizationRecommendationAccountsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListOrganizationRecommendationAccounts{}, middleware.After) +} + +func addOpListOrganizationRecommendationResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListOrganizationRecommendationResources{}, middleware.After) +} + +func addOpListRecommendationResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRecommendationResources{}, middleware.After) +} + +func addOpUpdateOrganizationRecommendationLifecycleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateOrganizationRecommendationLifecycle{}, middleware.After) +} + +func addOpUpdateRecommendationLifecycleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRecommendationLifecycle{}, middleware.After) +} + +func validateOpGetOrganizationRecommendationInput(v *GetOrganizationRecommendationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetOrganizationRecommendationInput"} + if v.OrganizationRecommendationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationRecommendationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRecommendationInput(v *GetRecommendationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRecommendationInput"} + if v.RecommendationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecommendationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListOrganizationRecommendationAccountsInput(v *ListOrganizationRecommendationAccountsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListOrganizationRecommendationAccountsInput"} + if v.OrganizationRecommendationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationRecommendationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListOrganizationRecommendationResourcesInput(v *ListOrganizationRecommendationResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListOrganizationRecommendationResourcesInput"} + if v.OrganizationRecommendationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationRecommendationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListRecommendationResourcesInput(v *ListRecommendationResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRecommendationResourcesInput"} + if v.RecommendationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecommendationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateOrganizationRecommendationLifecycleInput(v *UpdateOrganizationRecommendationLifecycleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateOrganizationRecommendationLifecycleInput"} + if len(v.LifecycleStage) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("LifecycleStage")) + } + if v.OrganizationRecommendationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationRecommendationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateRecommendationLifecycleInput(v *UpdateRecommendationLifecycleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRecommendationLifecycleInput"} + if len(v.LifecycleStage) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("LifecycleStage")) + } + if v.RecommendationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecommendationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/verifiedpermissions/api_op_BatchIsAuthorized.go b/service/verifiedpermissions/api_op_BatchIsAuthorized.go new file mode 100644 index 00000000000..52ec8a6ed7b --- /dev/null +++ b/service/verifiedpermissions/api_op_BatchIsAuthorized.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +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/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Makes a series of decisions about multiple authorization requests for one +// principal or resource. Each request contains the equivalent content of an +// IsAuthorized request: principal, action, resource, and context. Either the +// principal or the resource parameter must be identical across all requests. For +// example, Verified Permissions won't evaluate a pair of requests where bob views +// photo1 and alice views photo2 . Authorization of bob to view photo1 and photo2 , +// or bob and alice to view photo1 , are valid batches. The request is evaluated +// against all policies in the specified policy store that match the entities that +// you declare. The result of the decisions is a series of Allow or Deny +// responses, along with the IDs of the policies that produced each decision. The +// entities of a BatchIsAuthorized API request can contain up to 100 principals +// and up to 100 resources. The requests of a BatchIsAuthorized API request can +// contain up to 30 requests. +func (c *Client) BatchIsAuthorized(ctx context.Context, params *BatchIsAuthorizedInput, optFns ...func(*Options)) (*BatchIsAuthorizedOutput, error) { + if params == nil { + params = &BatchIsAuthorizedInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchIsAuthorized", params, optFns, c.addOperationBatchIsAuthorizedMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchIsAuthorizedOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchIsAuthorizedInput struct { + + // Specifies the ID of the policy store. Policies in this policy store will be + // used to make the authorization decisions for the input. + // + // This member is required. + PolicyStoreId *string + + // An array of up to 30 requests that you want Verified Permissions to evaluate. + // + // This member is required. + Requests []types.BatchIsAuthorizedInputItem + + // Specifies the list of resources and principals and their associated attributes + // that Verified Permissions can examine when evaluating the policies. You can + // include only principal and resource entities in this parameter; you can't + // include actions. You must specify actions in the schema. + Entities types.EntitiesDefinition + + noSmithyDocumentSerde +} + +type BatchIsAuthorizedOutput struct { + + // A series of Allow or Deny decisions for each request, and the policies that + // produced them. + // + // This member is required. + Results []types.BatchIsAuthorizedOutputItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchIsAuthorizedMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpBatchIsAuthorized{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpBatchIsAuthorized{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchIsAuthorized"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpBatchIsAuthorizedValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchIsAuthorized(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchIsAuthorized(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchIsAuthorized", + } +} diff --git a/service/verifiedpermissions/deserializers.go b/service/verifiedpermissions/deserializers.go index 31f8b392c41..3af6e8eea2b 100644 --- a/service/verifiedpermissions/deserializers.go +++ b/service/verifiedpermissions/deserializers.go @@ -19,6 +19,129 @@ import ( "strings" ) +type awsAwsjson10_deserializeOpBatchIsAuthorized struct { +} + +func (*awsAwsjson10_deserializeOpBatchIsAuthorized) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpBatchIsAuthorized) HandleDeserialize(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_deserializeOpErrorBatchIsAuthorized(response, &metadata) + } + output := &BatchIsAuthorizedOutput{} + 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_deserializeOpDocumentBatchIsAuthorizedOutput(&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_deserializeOpErrorBatchIsAuthorized(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return 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_deserializeOpCreateIdentitySource struct { } @@ -3301,6 +3424,291 @@ func awsAwsjson10_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } +func awsAwsjson10_deserializeDocumentActionIdentifier(v **types.ActionIdentifier, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ActionIdentifier + if *v == nil { + sv = &types.ActionIdentifier{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionId to be of type string, got %T instead", value) + } + sv.ActionId = ptr.String(jtv) + } + + case "actionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionType to be of type string, got %T instead", value) + } + sv.ActionType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentAttributeValue(v *types.AttributeValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.AttributeValue +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "boolean": + var mv bool + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanAttribute to be of type *bool, got %T instead", value) + } + mv = jtv + } + uv = &types.AttributeValueMemberBoolean{Value: mv} + break loop + + case "entityIdentifier": + var mv types.EntityIdentifier + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.AttributeValueMemberEntityIdentifier{Value: mv} + break loop + + case "long": + var mv int64 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongAttribute to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + mv = i64 + } + uv = &types.AttributeValueMemberLong{Value: mv} + break loop + + case "record": + var mv map[string]types.AttributeValue + if err := awsAwsjson10_deserializeDocumentRecordAttribute(&mv, value); err != nil { + return err + } + uv = &types.AttributeValueMemberRecord{Value: mv} + break loop + + case "set": + var mv []types.AttributeValue + if err := awsAwsjson10_deserializeDocumentSetAttribute(&mv, value); err != nil { + return err + } + uv = &types.AttributeValueMemberSet{Value: mv} + break loop + + case "string": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StringAttribute to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.AttributeValueMemberString{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsAwsjson10_deserializeDocumentBatchIsAuthorizedInputItem(v **types.BatchIsAuthorizedInputItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BatchIsAuthorizedInputItem + if *v == nil { + sv = &types.BatchIsAuthorizedInputItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if err := awsAwsjson10_deserializeDocumentActionIdentifier(&sv.Action, value); err != nil { + return err + } + + case "context": + if err := awsAwsjson10_deserializeDocumentContextDefinition(&sv.Context, value); err != nil { + return err + } + + case "principal": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Principal, value); err != nil { + return err + } + + case "resource": + if err := awsAwsjson10_deserializeDocumentEntityIdentifier(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentBatchIsAuthorizedOutputItem(v **types.BatchIsAuthorizedOutputItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BatchIsAuthorizedOutputItem + if *v == nil { + sv = &types.BatchIsAuthorizedOutputItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "decision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Decision to be of type string, got %T instead", value) + } + sv.Decision = types.Decision(jtv) + } + + case "determiningPolicies": + if err := awsAwsjson10_deserializeDocumentDeterminingPolicyList(&sv.DeterminingPolicies, value); err != nil { + return err + } + + case "errors": + if err := awsAwsjson10_deserializeDocumentEvaluationErrorList(&sv.Errors, value); err != nil { + return err + } + + case "request": + if err := awsAwsjson10_deserializeDocumentBatchIsAuthorizedInputItem(&sv.Request, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentBatchIsAuthorizedOutputList(v *[]types.BatchIsAuthorizedOutputItem, 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.BatchIsAuthorizedOutputItem + if *v == nil { + cv = []types.BatchIsAuthorizedOutputItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchIsAuthorizedOutputItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentBatchIsAuthorizedOutputItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentClientIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3382,6 +3790,78 @@ func awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsAwsjson10_deserializeDocumentContextDefinition(v *types.ContextDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ContextDefinition +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "contextMap": + var mv map[string]types.AttributeValue + if err := awsAwsjson10_deserializeDocumentContextMap(&mv, value); err != nil { + return err + } + uv = &types.ContextDefinitionMemberContextMap{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsAwsjson10_deserializeDocumentContextMap(v *map[string]types.AttributeValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.AttributeValue + if *v == nil { + mv = map[string]types.AttributeValue{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.AttributeValue + mapVar := parsedVal + if err := awsAwsjson10_deserializeDocumentAttributeValue(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson10_deserializeDocumentDeterminingPolicyItem(v **types.DeterminingPolicyItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4351,6 +4831,40 @@ func awsAwsjson10_deserializeDocumentPolicyTemplatesList(v *[]types.PolicyTempla return nil } +func awsAwsjson10_deserializeDocumentRecordAttribute(v *map[string]types.AttributeValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.AttributeValue + if *v == nil { + mv = map[string]types.AttributeValue{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.AttributeValue + mapVar := parsedVal + if err := awsAwsjson10_deserializeDocumentAttributeValue(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson10_deserializeDocumentResourceConflict(v **types.ResourceConflict, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4568,6 +5082,38 @@ func awsAwsjson10_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsAwsjson10_deserializeDocumentSetAttribute(v *[]types.AttributeValue, 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.AttributeValue + if *v == nil { + cv = []types.AttributeValue{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AttributeValue + if err := awsAwsjson10_deserializeDocumentAttributeValue(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentStaticPolicyDefinitionDetail(v **types.StaticPolicyDefinitionDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4983,6 +5529,42 @@ func awsAwsjson10_deserializeDocumentValidationSettings(v **types.ValidationSett return nil } +func awsAwsjson10_deserializeOpDocumentBatchIsAuthorizedOutput(v **BatchIsAuthorizedOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchIsAuthorizedOutput + if *v == nil { + sv = &BatchIsAuthorizedOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "results": + if err := awsAwsjson10_deserializeDocumentBatchIsAuthorizedOutputList(&sv.Results, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentCreateIdentitySourceOutput(v **CreateIdentitySourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/verifiedpermissions/generated.json b/service/verifiedpermissions/generated.json index 2c69e76b8ee..4dfae8f179a 100644 --- a/service/verifiedpermissions/generated.json +++ b/service/verifiedpermissions/generated.json @@ -9,6 +9,7 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_BatchIsAuthorized.go", "api_op_CreateIdentitySource.go", "api_op_CreatePolicy.go", "api_op_CreatePolicyStore.go", diff --git a/service/verifiedpermissions/serializers.go b/service/verifiedpermissions/serializers.go index 435593a9d39..2dd38443a48 100644 --- a/service/verifiedpermissions/serializers.go +++ b/service/verifiedpermissions/serializers.go @@ -15,6 +15,61 @@ import ( "path" ) +type awsAwsjson10_serializeOpBatchIsAuthorized struct { +} + +func (*awsAwsjson10_serializeOpBatchIsAuthorized) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpBatchIsAuthorized) 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.(*BatchIsAuthorizedInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.BatchIsAuthorized") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentBatchIsAuthorizedInput(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_serializeOpCreateIdentitySource struct { } @@ -1393,6 +1448,54 @@ func awsAwsjson10_serializeDocumentAttributeValue(v types.AttributeValue, value return nil } +func awsAwsjson10_serializeDocumentBatchIsAuthorizedInputItem(v *types.BatchIsAuthorizedInputItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("action") + if err := awsAwsjson10_serializeDocumentActionIdentifier(v.Action, ok); err != nil { + return err + } + } + + if v.Context != nil { + ok := object.Key("context") + if err := awsAwsjson10_serializeDocumentContextDefinition(v.Context, ok); err != nil { + return err + } + } + + if v.Principal != nil { + ok := object.Key("principal") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Principal, ok); err != nil { + return err + } + } + + if v.Resource != nil { + ok := object.Key("resource") + if err := awsAwsjson10_serializeDocumentEntityIdentifier(v.Resource, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentBatchIsAuthorizedInputList(v []types.BatchIsAuthorizedInputItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentBatchIsAuthorizedInputItem(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson10_serializeDocumentClientIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1857,6 +1960,32 @@ func awsAwsjson10_serializeDocumentValidationSettings(v *types.ValidationSetting return nil } +func awsAwsjson10_serializeOpDocumentBatchIsAuthorizedInput(v *BatchIsAuthorizedInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Entities != nil { + ok := object.Key("entities") + if err := awsAwsjson10_serializeDocumentEntitiesDefinition(v.Entities, ok); err != nil { + return err + } + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + if v.Requests != nil { + ok := object.Key("requests") + if err := awsAwsjson10_serializeDocumentBatchIsAuthorizedInputList(v.Requests, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentCreateIdentitySourceInput(v *CreateIdentitySourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/verifiedpermissions/types/types.go b/service/verifiedpermissions/types/types.go index e0951e50dff..ee59ba4a062 100644 --- a/service/verifiedpermissions/types/types.go +++ b/service/verifiedpermissions/types/types.go @@ -8,9 +8,10 @@ import ( ) // Contains information about an action for a request for which an authorization -// decision is made. This data type is used as an request parameter to the +// decision is made. This data type is used as a request parameter to the // IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// , BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html) +// , and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) // operations. Example: { "actionId": "", "actionType": "Action" } type ActionIdentifier struct { @@ -31,7 +32,8 @@ type ActionIdentifier struct { // request for which an authorization decision is made. This data type is used as a // member of the ContextDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ContextDefinition.html) // structure which is uses as a request parameter for the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// , BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html) +// , and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) // operations. // // The following types satisfy this interface: @@ -107,6 +109,61 @@ type AttributeValueMemberString struct { func (*AttributeValueMemberString) isAttributeValue() {} +// An authorization request that you include in a BatchIsAuthorized API request. +type BatchIsAuthorizedInputItem struct { + + // Specifies the requested action to be authorized. For example, is the principal + // authorized to perform this action on the resource? + Action *ActionIdentifier + + // Specifies additional context that can be used to make more granular + // authorization decisions. + Context ContextDefinition + + // Specifies the principal for which the authorization decision is to be made. + Principal *EntityIdentifier + + // Specifies the resource for which the authorization decision is to be made. + Resource *EntityIdentifier + + noSmithyDocumentSerde +} + +// The decision, based on policy evaluation, from an individual authorization +// request in a BatchIsAuthorized API request. +type BatchIsAuthorizedOutputItem struct { + + // An authorization decision that indicates if the authorization request should be + // allowed or denied. + // + // This member is required. + Decision Decision + + // The list of determining policies used to make the authorization decision. For + // example, if there are two matching policies, where one is a forbid and the other + // is a permit, then the forbid policy will be the determining policy. In the case + // of multiple matching permit policies then there would be multiple determining + // policies. In the case that no policies match, and hence the response is DENY, + // there would be no determining policies. + // + // This member is required. + DeterminingPolicies []DeterminingPolicyItem + + // Errors that occurred while making an authorization decision, for example, a + // policy references an Entity or entity Attribute that does not exist in the + // slice. + // + // This member is required. + Errors []EvaluationErrorItem + + // The authorization request that initiated the decision. + // + // This member is required. + Request *BatchIsAuthorizedInputItem + + noSmithyDocumentSerde +} + // The configuration for an identity source that represents a connection to an // Amazon Cognito user pool used as an identity provider for Verified Permissions. // This data type is used as a field that is part of an Configuration (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_Configuration.html) @@ -162,9 +219,10 @@ func (*ConfigurationMemberCognitoUserPoolConfiguration) isConfiguration() {} // Permissions evaluates this information in an authorization request as part of // the when and unless clauses in a policy. This data type is used as a request // parameter for the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// , BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html) +// , and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) // operations. Example: -// "context":{"Context":{"":{"boolean":true},"":{"long":1234}}} +// "context":{"contextMap":{"":{"boolean":true},"":{"long":1234}}} // // The following types satisfy this interface: // @@ -176,7 +234,7 @@ type ContextDefinition interface { // An list of attributes that are needed to successfully evaluate an authorization // request. Each attribute in this array must include a map of a data type and its // value. Example: -// "Context":{"":{"boolean":true},"":{"long":1234}} +// "contextMap":{"":{"boolean":true},"":{"long":1234}} type ContextDefinitionMemberContextMap struct { Value map[string]AttributeValue @@ -188,7 +246,8 @@ func (*ContextDefinitionMemberContextMap) isContextDefinition() {} // Contains information about one of the policies that determined an authorization // decision. This data type is used as an element in a response parameter for the // IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// , BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html) +// , and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) // operations. Example: // "determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}] type DeterminingPolicyItem struct { @@ -303,9 +362,10 @@ type EntityReferenceMemberUnspecified struct { func (*EntityReferenceMemberUnspecified) isEntityReference() {} -// Contains a description of an evaluation error. This data type is used as a -// request parameter in the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) +// Contains a description of an evaluation error. This data type is a response +// parameter of the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) +// , BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html) +// , and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) // operations. type EvaluationErrorItem struct { diff --git a/service/verifiedpermissions/validators.go b/service/verifiedpermissions/validators.go index 8498dd7f008..0d2084e13ba 100644 --- a/service/verifiedpermissions/validators.go +++ b/service/verifiedpermissions/validators.go @@ -10,6 +10,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpBatchIsAuthorized struct { +} + +func (*validateOpBatchIsAuthorized) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchIsAuthorized) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchIsAuthorizedInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchIsAuthorizedInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateIdentitySource struct { } @@ -470,6 +490,10 @@ func (m *validateOpUpdatePolicyTemplate) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +func addOpBatchIsAuthorizedValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchIsAuthorized{}, middleware.After) +} + func addOpCreateIdentitySourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateIdentitySource{}, middleware.After) } @@ -609,6 +633,55 @@ func validateAttributeValue(v types.AttributeValue) error { } } +func validateBatchIsAuthorizedInputItem(v *types.BatchIsAuthorizedInputItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchIsAuthorizedInputItem"} + if v.Principal != nil { + if err := validateEntityIdentifier(v.Principal); err != nil { + invalidParams.AddNested("Principal", err.(smithy.InvalidParamsError)) + } + } + if v.Action != nil { + if err := validateActionIdentifier(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if v.Resource != nil { + if err := validateEntityIdentifier(v.Resource); err != nil { + invalidParams.AddNested("Resource", err.(smithy.InvalidParamsError)) + } + } + if v.Context != nil { + if err := validateContextDefinition(v.Context); err != nil { + invalidParams.AddNested("Context", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBatchIsAuthorizedInputList(v []types.BatchIsAuthorizedInputItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchIsAuthorizedInputList"} + for i := range v { + if err := validateBatchIsAuthorizedInputItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCognitoUserPoolConfiguration(v *types.CognitoUserPoolConfiguration) error { if v == nil { return nil @@ -1018,6 +1091,33 @@ func validateValidationSettings(v *types.ValidationSettings) error { } } +func validateOpBatchIsAuthorizedInput(v *BatchIsAuthorizedInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchIsAuthorizedInput"} + if v.PolicyStoreId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyStoreId")) + } + if v.Entities != nil { + if err := validateEntitiesDefinition(v.Entities); err != nil { + invalidParams.AddNested("Entities", err.(smithy.InvalidParamsError)) + } + } + if v.Requests == nil { + invalidParams.Add(smithy.NewErrParamRequired("Requests")) + } else if v.Requests != nil { + if err := validateBatchIsAuthorizedInputList(v.Requests); err != nil { + invalidParams.AddNested("Requests", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateIdentitySourceInput(v *CreateIdentitySourceInput) error { if v == nil { return nil diff --git a/service/wisdom/api_op_CreateAssistant.go b/service/wisdom/api_op_CreateAssistant.go index 0a6703af932..93379134508 100644 --- a/service/wisdom/api_op_CreateAssistant.go +++ b/service/wisdom/api_op_CreateAssistant.go @@ -51,13 +51,13 @@ type CreateAssistantInput struct { Description *string // The configuration information for the customer managed key used for encryption. - // The customer managed key must have a policy that allows kms:CreateGrant and - // kms:DescribeKey permissions to the IAM identity using the key to invoke Wisdom. - // To use Wisdom with chat, the key policy must also allow kms:Decrypt , - // kms:GenerateDataKey* , and kms:DescribeKey permissions to the - // connect.amazonaws.com service principal. For more information about setting up a - // customer managed key for Wisdom, see Enable Amazon Connect Wisdom for your - // instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) + // The customer managed key must have a policy that allows kms:CreateGrant , + // kms:DescribeKey , and kms:Decrypt/kms:GenerateDataKey permissions to the IAM + // identity using the key to invoke Wisdom. To use Wisdom with chat, the key policy + // must also allow kms:Decrypt , kms:GenerateDataKey* , and kms:DescribeKey + // permissions to the connect.amazonaws.com service principal. For more + // information about setting up a customer managed key for Wisdom, see Enable + // Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) // . ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration diff --git a/service/wisdom/api_op_CreateContent.go b/service/wisdom/api_op_CreateContent.go index c2e65dfbcfc..e2722459cff 100644 --- a/service/wisdom/api_op_CreateContent.go +++ b/service/wisdom/api_op_CreateContent.go @@ -31,8 +31,9 @@ func (c *Client) CreateContent(ctx context.Context, params *CreateContentInput, type CreateContentInput struct { - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_CreateKnowledgeBase.go b/service/wisdom/api_op_CreateKnowledgeBase.go index da3f7adfb88..d193ea8cbe8 100644 --- a/service/wisdom/api_op_CreateKnowledgeBase.go +++ b/service/wisdom/api_op_CreateKnowledgeBase.go @@ -69,10 +69,10 @@ type CreateKnowledgeBaseInput struct { RenderingConfiguration *types.RenderingConfiguration // The configuration information for the customer managed key used for encryption. - // This KMS key must have a policy that allows kms:CreateGrant and kms:DescribeKey - // permissions to the IAM identity using the key to invoke Wisdom. For more - // information about setting up a customer managed key for Wisdom, see Enable - // Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) + // This KMS key must have a policy that allows kms:CreateGrant , kms:DescribeKey , + // and kms:Decrypt/kms:GenerateDataKey permissions to the IAM identity using the + // key to invoke Wisdom. For more information about setting up a customer managed + // key for Wisdom, see Enable Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) // . ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration diff --git a/service/wisdom/api_op_CreateQuickResponse.go b/service/wisdom/api_op_CreateQuickResponse.go new file mode 100644 index 00000000000..0e08eea93cb --- /dev/null +++ b/service/wisdom/api_op_CreateQuickResponse.go @@ -0,0 +1,224 @@ +// 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" +) + +// Creates a Wisdom quick response. +func (c *Client) CreateQuickResponse(ctx context.Context, params *CreateQuickResponseInput, optFns ...func(*Options)) (*CreateQuickResponseOutput, error) { + if params == nil { + params = &CreateQuickResponseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateQuickResponse", params, optFns, c.addOperationCreateQuickResponseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateQuickResponseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateQuickResponseInput struct { + + // The content of the quick response. + // + // This member is required. + Content types.QuickResponseDataProvider + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The name of the quick response. + // + // This member is required. + Name *string + + // The Amazon Connect channels this quick response applies to. + Channels []string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If not provided, the Amazon Web Services SDK populates this + // field. For more information about idempotency, see Making retries safe with + // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/) + // . + ClientToken *string + + // The media type of the quick response content. + // - Use application/x.quickresponse;format=plain for a quick response written in + // plain text. + // - Use application/x.quickresponse;format=markdown for a quick response written + // in richtext. + ContentType *string + + // The description of the quick response. + Description *string + + // The configuration information of the user groups that the quick response is + // accessible to. + GroupingConfiguration *types.GroupingConfiguration + + // Whether the quick response is active. + IsActive *bool + + // The language code value for the language in which the quick response is + // written. The supported language codes include de_DE , en_US , es_ES , fr_FR , + // id_ID , it_IT , ja_JP , ko_KR , pt_BR , zh_CN , zh_TW + Language *string + + // The shortcut key of the quick response. The value should be unique across the + // knowledge base. + ShortcutKey *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateQuickResponseOutput struct { + + // The quick response. + QuickResponse *types.QuickResponseData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateQuickResponseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateQuickResponse{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateQuickResponse{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateQuickResponse"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateQuickResponseMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateQuickResponseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateQuickResponse(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateQuickResponse struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateQuickResponse) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateQuickResponse) 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.(*CreateQuickResponseInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateQuickResponseInput ") + } + + 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_opCreateQuickResponseMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateQuickResponse{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateQuickResponse(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateQuickResponse", + } +} diff --git a/service/wisdom/api_op_DeleteContent.go b/service/wisdom/api_op_DeleteContent.go index 82d8ea16050..141f5cfc4f2 100644 --- a/service/wisdom/api_op_DeleteContent.go +++ b/service/wisdom/api_op_DeleteContent.go @@ -35,8 +35,9 @@ type DeleteContentInput struct { // This member is required. ContentId *string - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_DeleteImportJob.go b/service/wisdom/api_op_DeleteImportJob.go new file mode 100644 index 00000000000..1732a03953b --- /dev/null +++ b/service/wisdom/api_op_DeleteImportJob.go @@ -0,0 +1,138 @@ +// 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/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the quick response import job. +func (c *Client) DeleteImportJob(ctx context.Context, params *DeleteImportJobInput, optFns ...func(*Options)) (*DeleteImportJobOutput, error) { + if params == nil { + params = &DeleteImportJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteImportJob", params, optFns, c.addOperationDeleteImportJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteImportJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteImportJobInput struct { + + // The identifier of the import job to be deleted. + // + // This member is required. + ImportJobId *string + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type DeleteImportJobOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteImportJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteImportJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteImportJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteImportJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteImportJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteImportJob(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteImportJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteImportJob", + } +} diff --git a/service/wisdom/api_op_DeleteQuickResponse.go b/service/wisdom/api_op_DeleteQuickResponse.go new file mode 100644 index 00000000000..9bd05400867 --- /dev/null +++ b/service/wisdom/api_op_DeleteQuickResponse.go @@ -0,0 +1,139 @@ +// 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/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a quick response. +func (c *Client) DeleteQuickResponse(ctx context.Context, params *DeleteQuickResponseInput, optFns ...func(*Options)) (*DeleteQuickResponseOutput, error) { + if params == nil { + params = &DeleteQuickResponseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteQuickResponse", params, optFns, c.addOperationDeleteQuickResponseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteQuickResponseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteQuickResponseInput struct { + + // The knowledge base from which the quick response is deleted. The identifier of + // the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if + // you're storing Wisdom Content resource to it. + // + // This member is required. + KnowledgeBaseId *string + + // The identifier of the quick response to delete. + // + // This member is required. + QuickResponseId *string + + noSmithyDocumentSerde +} + +type DeleteQuickResponseOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteQuickResponseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteQuickResponse{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteQuickResponse{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteQuickResponse"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteQuickResponseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteQuickResponse(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteQuickResponse(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteQuickResponse", + } +} diff --git a/service/wisdom/api_op_GetContent.go b/service/wisdom/api_op_GetContent.go index e1754a52e71..e3e96e37a0c 100644 --- a/service/wisdom/api_op_GetContent.go +++ b/service/wisdom/api_op_GetContent.go @@ -36,8 +36,9 @@ type GetContentInput struct { // This member is required. ContentId *string - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_GetContentSummary.go b/service/wisdom/api_op_GetContentSummary.go index 2caa12f08ef..96b2df581b2 100644 --- a/service/wisdom/api_op_GetContentSummary.go +++ b/service/wisdom/api_op_GetContentSummary.go @@ -36,8 +36,9 @@ type GetContentSummaryInput struct { // This member is required. ContentId *string - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_GetImportJob.go b/service/wisdom/api_op_GetImportJob.go new file mode 100644 index 00000000000..0e1b738a9fa --- /dev/null +++ b/service/wisdom/api_op_GetImportJob.go @@ -0,0 +1,142 @@ +// 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" +) + +// Retrieves the started import job. +func (c *Client) GetImportJob(ctx context.Context, params *GetImportJobInput, optFns ...func(*Options)) (*GetImportJobOutput, error) { + if params == nil { + params = &GetImportJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetImportJob", params, optFns, c.addOperationGetImportJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetImportJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetImportJobInput struct { + + // The identifier of the import job to retrieve. + // + // This member is required. + ImportJobId *string + + // The identifier of the knowledge base that the import job belongs to. + // + // This member is required. + KnowledgeBaseId *string + + noSmithyDocumentSerde +} + +type GetImportJobOutput struct { + + // The import job. + ImportJob *types.ImportJobData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetImportJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetImportJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetImportJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetImportJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetImportJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetImportJob(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetImportJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetImportJob", + } +} diff --git a/service/wisdom/api_op_GetKnowledgeBase.go b/service/wisdom/api_op_GetKnowledgeBase.go index 8cf43920ad3..4fd14d421f3 100644 --- a/service/wisdom/api_op_GetKnowledgeBase.go +++ b/service/wisdom/api_op_GetKnowledgeBase.go @@ -30,8 +30,9 @@ func (c *Client) GetKnowledgeBase(ctx context.Context, params *GetKnowledgeBaseI type GetKnowledgeBaseInput struct { - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_GetQuickResponse.go b/service/wisdom/api_op_GetQuickResponse.go new file mode 100644 index 00000000000..92474e043bc --- /dev/null +++ b/service/wisdom/api_op_GetQuickResponse.go @@ -0,0 +1,143 @@ +// 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" +) + +// Retrieves the quick response. +func (c *Client) GetQuickResponse(ctx context.Context, params *GetQuickResponseInput, optFns ...func(*Options)) (*GetQuickResponseOutput, error) { + if params == nil { + params = &GetQuickResponseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetQuickResponse", params, optFns, c.addOperationGetQuickResponseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetQuickResponseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetQuickResponseInput struct { + + // The identifier of the knowledge base. This should be a QUICK_RESPONSES type + // knowledge base. + // + // This member is required. + KnowledgeBaseId *string + + // The identifier of the quick response. + // + // This member is required. + QuickResponseId *string + + noSmithyDocumentSerde +} + +type GetQuickResponseOutput struct { + + // The quick response. + QuickResponse *types.QuickResponseData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetQuickResponseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetQuickResponse{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetQuickResponse{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetQuickResponse"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetQuickResponseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetQuickResponse(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetQuickResponse(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetQuickResponse", + } +} diff --git a/service/wisdom/api_op_ListContents.go b/service/wisdom/api_op_ListContents.go index c6ff2f781ce..5e8ee2db9cc 100644 --- a/service/wisdom/api_op_ListContents.go +++ b/service/wisdom/api_op_ListContents.go @@ -30,8 +30,9 @@ func (c *Client) ListContents(ctx context.Context, params *ListContentsInput, op type ListContentsInput struct { - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_ListImportJobs.go b/service/wisdom/api_op_ListImportJobs.go new file mode 100644 index 00000000000..122993cdcfd --- /dev/null +++ b/service/wisdom/api_op_ListImportJobs.go @@ -0,0 +1,242 @@ +// 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 import jobs. +func (c *Client) ListImportJobs(ctx context.Context, params *ListImportJobsInput, optFns ...func(*Options)) (*ListImportJobsOutput, error) { + if params == nil { + params = &ListImportJobsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListImportJobs", params, optFns, c.addOperationListImportJobsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListImportJobsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListImportJobsInput struct { + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. 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 ListImportJobsOutput struct { + + // Summary information about the import jobs. + // + // This member is required. + ImportJobSummaries []types.ImportJobSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListImportJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListImportJobs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImportJobs{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListImportJobs"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListImportJobsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImportJobs(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListImportJobsAPIClient is a client that implements the ListImportJobs +// operation. +type ListImportJobsAPIClient interface { + ListImportJobs(context.Context, *ListImportJobsInput, ...func(*Options)) (*ListImportJobsOutput, error) +} + +var _ ListImportJobsAPIClient = (*Client)(nil) + +// ListImportJobsPaginatorOptions is the paginator options for ListImportJobs +type ListImportJobsPaginatorOptions 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 +} + +// ListImportJobsPaginator is a paginator for ListImportJobs +type ListImportJobsPaginator struct { + options ListImportJobsPaginatorOptions + client ListImportJobsAPIClient + params *ListImportJobsInput + nextToken *string + firstPage bool +} + +// NewListImportJobsPaginator returns a new ListImportJobsPaginator +func NewListImportJobsPaginator(client ListImportJobsAPIClient, params *ListImportJobsInput, optFns ...func(*ListImportJobsPaginatorOptions)) *ListImportJobsPaginator { + if params == nil { + params = &ListImportJobsInput{} + } + + options := ListImportJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListImportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImportJobsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListImportJobs page. +func (p *ListImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportJobsOutput, 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.ListImportJobs(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_opListImportJobs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListImportJobs", + } +} diff --git a/service/wisdom/api_op_ListQuickResponses.go b/service/wisdom/api_op_ListQuickResponses.go new file mode 100644 index 00000000000..10a310d4f50 --- /dev/null +++ b/service/wisdom/api_op_ListQuickResponses.go @@ -0,0 +1,243 @@ +// 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 quick response. +func (c *Client) ListQuickResponses(ctx context.Context, params *ListQuickResponsesInput, optFns ...func(*Options)) (*ListQuickResponsesOutput, error) { + if params == nil { + params = &ListQuickResponsesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListQuickResponses", params, optFns, c.addOperationListQuickResponsesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListQuickResponsesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListQuickResponsesInput struct { + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. 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 ListQuickResponsesOutput struct { + + // Summary information about the quick responses. + // + // This member is required. + QuickResponseSummaries []types.QuickResponseSummary + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListQuickResponsesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListQuickResponses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListQuickResponses{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListQuickResponses"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListQuickResponsesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListQuickResponses(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListQuickResponsesAPIClient is a client that implements the ListQuickResponses +// operation. +type ListQuickResponsesAPIClient interface { + ListQuickResponses(context.Context, *ListQuickResponsesInput, ...func(*Options)) (*ListQuickResponsesOutput, error) +} + +var _ ListQuickResponsesAPIClient = (*Client)(nil) + +// ListQuickResponsesPaginatorOptions is the paginator options for +// ListQuickResponses +type ListQuickResponsesPaginatorOptions 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 +} + +// ListQuickResponsesPaginator is a paginator for ListQuickResponses +type ListQuickResponsesPaginator struct { + options ListQuickResponsesPaginatorOptions + client ListQuickResponsesAPIClient + params *ListQuickResponsesInput + nextToken *string + firstPage bool +} + +// NewListQuickResponsesPaginator returns a new ListQuickResponsesPaginator +func NewListQuickResponsesPaginator(client ListQuickResponsesAPIClient, params *ListQuickResponsesInput, optFns ...func(*ListQuickResponsesPaginatorOptions)) *ListQuickResponsesPaginator { + if params == nil { + params = &ListQuickResponsesInput{} + } + + options := ListQuickResponsesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListQuickResponsesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQuickResponsesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListQuickResponses page. +func (p *ListQuickResponsesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQuickResponsesOutput, 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.ListQuickResponses(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_opListQuickResponses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListQuickResponses", + } +} diff --git a/service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go b/service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go index 3355776c461..df422e189e3 100644 --- a/service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go +++ b/service/wisdom/api_op_RemoveKnowledgeBaseTemplateUri.go @@ -29,8 +29,9 @@ func (c *Client) RemoveKnowledgeBaseTemplateUri(ctx context.Context, params *Rem type RemoveKnowledgeBaseTemplateUriInput struct { - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_SearchContent.go b/service/wisdom/api_op_SearchContent.go index bad76918884..9ba3039a591 100644 --- a/service/wisdom/api_op_SearchContent.go +++ b/service/wisdom/api_op_SearchContent.go @@ -31,8 +31,9 @@ func (c *Client) SearchContent(ctx context.Context, params *SearchContentInput, type SearchContentInput struct { - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_SearchQuickResponses.go b/service/wisdom/api_op_SearchQuickResponses.go new file mode 100644 index 00000000000..16868c0805c --- /dev/null +++ b/service/wisdom/api_op_SearchQuickResponses.go @@ -0,0 +1,251 @@ +// 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 existing Wisdom quick responses in a Wisdom knowledge base. +func (c *Client) SearchQuickResponses(ctx context.Context, params *SearchQuickResponsesInput, optFns ...func(*Options)) (*SearchQuickResponsesOutput, error) { + if params == nil { + params = &SearchQuickResponsesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchQuickResponses", params, optFns, c.addOperationSearchQuickResponsesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchQuickResponsesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchQuickResponsesInput struct { + + // The identifier of the knowledge base. This should be a QUICK_RESPONSES type + // knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The search expression for querying the quick response. + // + // This member is required. + SearchExpression *types.QuickResponseSearchExpression + + // The user-defined Amazon Connect contact attributes (https://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html#user-defined-attributes) + // to be resolved when search results are returned. + Attributes map[string]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 SearchQuickResponsesOutput struct { + + // The results of the quick response search. + // + // This member is required. + Results []types.QuickResponseSearchResultData + + // 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 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchQuickResponsesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchQuickResponses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchQuickResponses{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SearchQuickResponses"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSearchQuickResponsesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchQuickResponses(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// SearchQuickResponsesAPIClient is a client that implements the +// SearchQuickResponses operation. +type SearchQuickResponsesAPIClient interface { + SearchQuickResponses(context.Context, *SearchQuickResponsesInput, ...func(*Options)) (*SearchQuickResponsesOutput, error) +} + +var _ SearchQuickResponsesAPIClient = (*Client)(nil) + +// SearchQuickResponsesPaginatorOptions is the paginator options for +// SearchQuickResponses +type SearchQuickResponsesPaginatorOptions 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 +} + +// SearchQuickResponsesPaginator is a paginator for SearchQuickResponses +type SearchQuickResponsesPaginator struct { + options SearchQuickResponsesPaginatorOptions + client SearchQuickResponsesAPIClient + params *SearchQuickResponsesInput + nextToken *string + firstPage bool +} + +// NewSearchQuickResponsesPaginator returns a new SearchQuickResponsesPaginator +func NewSearchQuickResponsesPaginator(client SearchQuickResponsesAPIClient, params *SearchQuickResponsesInput, optFns ...func(*SearchQuickResponsesPaginatorOptions)) *SearchQuickResponsesPaginator { + if params == nil { + params = &SearchQuickResponsesInput{} + } + + options := SearchQuickResponsesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchQuickResponsesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchQuickResponsesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchQuickResponses page. +func (p *SearchQuickResponsesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchQuickResponsesOutput, 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.SearchQuickResponses(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_opSearchQuickResponses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SearchQuickResponses", + } +} diff --git a/service/wisdom/api_op_StartContentUpload.go b/service/wisdom/api_op_StartContentUpload.go index 7f85a6ced55..54747cf8463 100644 --- a/service/wisdom/api_op_StartContentUpload.go +++ b/service/wisdom/api_op_StartContentUpload.go @@ -40,12 +40,17 @@ type StartContentUploadInput struct { // This member is required. ContentType *string - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string + // The expected expiration time of the generated presigned URL, specified in + // minutes. + PresignedUrlTimeToLive *int32 + noSmithyDocumentSerde } diff --git a/service/wisdom/api_op_StartImportJob.go b/service/wisdom/api_op_StartImportJob.go new file mode 100644 index 00000000000..15cec9d69b0 --- /dev/null +++ b/service/wisdom/api_op_StartImportJob.go @@ -0,0 +1,205 @@ +// 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" +) + +// Start an asynchronous job to import Wisdom resources from an uploaded source +// file. Before calling this API, use StartContentUpload (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html) +// to upload an asset that contains the resource data. +// - For importing Wisdom quick responses, you need to upload a csv file +// including the quick responses. For information about how to format the csv file +// for importing quick responses, see Import quick responses (https://docs.aws.amazon.com/console/connect/quick-responses/add-data) +// . +func (c *Client) StartImportJob(ctx context.Context, params *StartImportJobInput, optFns ...func(*Options)) (*StartImportJobOutput, error) { + if params == nil { + params = &StartImportJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartImportJob", params, optFns, c.addOperationStartImportJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartImportJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartImportJobInput struct { + + // The type of the import job. + // - For importing quick response resource, set the value to QUICK_RESPONSES . + // + // This member is required. + ImportJobType types.ImportJobType + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. + // - For importing Wisdom quick responses, this should be a QUICK_RESPONSES type + // knowledge base. + // + // This member is required. + KnowledgeBaseId *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 + + // The tags used to organize, track, or control access for this resource. + ClientToken *string + + // The configuration information of the external source that the resource data are + // imported from. + ExternalSourceConfiguration *types.ExternalSourceConfiguration + + // The metadata fields of the imported Wisdom resources. + Metadata map[string]string + + noSmithyDocumentSerde +} + +type StartImportJobOutput struct { + + // The import job. + ImportJob *types.ImportJobData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartImportJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartImportJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartImportJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartImportJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opStartImportJobMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartImportJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartImportJob(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpStartImportJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartImportJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartImportJob) 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.(*StartImportJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartImportJobInput ") + } + + 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_opStartImportJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartImportJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartImportJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartImportJob", + } +} diff --git a/service/wisdom/api_op_UpdateContent.go b/service/wisdom/api_op_UpdateContent.go index 14b9a37d627..80036208307 100644 --- a/service/wisdom/api_op_UpdateContent.go +++ b/service/wisdom/api_op_UpdateContent.go @@ -36,7 +36,9 @@ type UpdateContentInput struct { // This member is required. ContentId *string - // The identifier of the knowledge base. Can be either the ID or the ARN + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go b/service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go index 3920c8aaaf5..03e8b377dde 100644 --- a/service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go +++ b/service/wisdom/api_op_UpdateKnowledgeBaseTemplateUri.go @@ -36,8 +36,9 @@ func (c *Client) UpdateKnowledgeBaseTemplateUri(ctx context.Context, params *Upd type UpdateKnowledgeBaseTemplateUriInput struct { - // The identifier of the knowledge base. Can be either the ID or the ARN. URLs - // cannot contain the ARN. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. // // This member is required. KnowledgeBaseId *string diff --git a/service/wisdom/api_op_UpdateQuickResponse.go b/service/wisdom/api_op_UpdateQuickResponse.go new file mode 100644 index 00000000000..fdeb69eb159 --- /dev/null +++ b/service/wisdom/api_op_UpdateQuickResponse.go @@ -0,0 +1,188 @@ +// 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" +) + +// Updates an existing Wisdom quick response. +func (c *Client) UpdateQuickResponse(ctx context.Context, params *UpdateQuickResponseInput, optFns ...func(*Options)) (*UpdateQuickResponseOutput, error) { + if params == nil { + params = &UpdateQuickResponseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateQuickResponse", params, optFns, c.addOperationUpdateQuickResponseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateQuickResponseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateQuickResponseInput struct { + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The identifier of the quick response. + // + // This member is required. + QuickResponseId *string + + // The Amazon Connect contact channels this quick response applies to. The + // supported contact channel types include Chat . + Channels []string + + // The updated content of the quick response. + Content types.QuickResponseDataProvider + + // The media type of the quick response content. + // - Use application/x.quickresponse;format=plain for quick response written in + // plain text. + // - Use application/x.quickresponse;format=markdown for quick response written + // in richtext. + ContentType *string + + // The updated description of the quick response. + Description *string + + // The updated grouping configuration of the quick response. + GroupingConfiguration *types.GroupingConfiguration + + // Whether the quick response is active. + IsActive *bool + + // The language code value for the language in which the quick response is + // written. The supported language codes include de_DE , en_US , es_ES , fr_FR , + // id_ID , it_IT , ja_JP , ko_KR , pt_BR , zh_CN , zh_TW + Language *string + + // The name of the quick response. + Name *string + + // Whether to remove the description from the quick response. + RemoveDescription *bool + + // Whether to remove the grouping configuration of the quick response. + RemoveGroupingConfiguration *bool + + // Whether to remove the shortcut key of the quick response. + RemoveShortcutKey *bool + + // The shortcut key of the quick response. The value should be unique across the + // knowledge base. + ShortcutKey *string + + noSmithyDocumentSerde +} + +type UpdateQuickResponseOutput struct { + + // The quick response. + QuickResponse *types.QuickResponseData + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateQuickResponseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateQuickResponse{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateQuickResponse{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateQuickResponse"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateQuickResponseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateQuickResponse(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateQuickResponse(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateQuickResponse", + } +} diff --git a/service/wisdom/deserializers.go b/service/wisdom/deserializers.go index d34e62a46b3..2d1004c85b8 100644 --- a/service/wisdom/deserializers.go +++ b/service/wisdom/deserializers.go @@ -650,14 +650,14 @@ func awsRestjson1_deserializeOpDocumentCreateKnowledgeBaseOutput(v **CreateKnowl return nil } -type awsRestjson1_deserializeOpCreateSession struct { +type awsRestjson1_deserializeOpCreateQuickResponse struct { } -func (*awsRestjson1_deserializeOpCreateSession) ID() string { +func (*awsRestjson1_deserializeOpCreateQuickResponse) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateQuickResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -671,9 +671,9 @@ func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateSession(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateQuickResponse(response, &metadata) } - output := &CreateSessionOutput{} + output := &CreateQuickResponseOutput{} out.Result = output var buff [1024]byte @@ -694,7 +694,7 @@ func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateSessionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateQuickResponseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -707,7 +707,7 @@ func (m *awsRestjson1_deserializeOpCreateSession) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateSession(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -748,12 +748,18 @@ func awsRestjson1_deserializeOpErrorCreateSession(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("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) @@ -767,7 +773,7 @@ func awsRestjson1_deserializeOpErrorCreateSession(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateQuickResponseOutput(v **CreateQuickResponseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -780,17 +786,17 @@ func awsRestjson1_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateSessionOutput + var sv *CreateQuickResponseOutput if *v == nil { - sv = &CreateSessionOutput{} + sv = &CreateQuickResponseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "session": - if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + case "quickResponse": + if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, value); err != nil { return err } @@ -803,14 +809,14 @@ func awsRestjson1_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutp return nil } -type awsRestjson1_deserializeOpDeleteAssistant struct { +type awsRestjson1_deserializeOpCreateSession struct { } -func (*awsRestjson1_deserializeOpDeleteAssistant) ID() string { +func (*awsRestjson1_deserializeOpCreateSession) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -824,15 +830,43 @@ func (m *awsRestjson1_deserializeOpDeleteAssistant) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateSession(response, &metadata) } - output := &DeleteAssistantOutput{} + 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_deserializeOpErrorDeleteAssistant(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -873,8 +907,8 @@ func awsRestjson1_deserializeOpErrorDeleteAssistant(response *smithyhttp.Respons } 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) @@ -892,14 +926,50 @@ func awsRestjson1_deserializeOpErrorDeleteAssistant(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteAssistantAssociation struct { +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 } -func (*awsRestjson1_deserializeOpDeleteAssistantAssociation) ID() string { +type awsRestjson1_deserializeOpDeleteAssistant struct { +} + +func (*awsRestjson1_deserializeOpDeleteAssistant) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAssistantAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -913,15 +983,15 @@ func (m *awsRestjson1_deserializeOpDeleteAssistantAssociation) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistant(response, &metadata) } - output := &DeleteAssistantAssociationOutput{} + output := &DeleteAssistantOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -981,14 +1051,14 @@ func awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response *smithyh } } -type awsRestjson1_deserializeOpDeleteContent struct { +type awsRestjson1_deserializeOpDeleteAssistantAssociation struct { } -func (*awsRestjson1_deserializeOpDeleteContent) ID() string { +func (*awsRestjson1_deserializeOpDeleteAssistantAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -1002,15 +1072,15 @@ func (m *awsRestjson1_deserializeOpDeleteContent) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssistantAssociation(response, &metadata) } - output := &DeleteContentOutput{} + output := &DeleteAssistantAssociationOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -1070,14 +1140,14 @@ func awsRestjson1_deserializeOpErrorDeleteContent(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeleteKnowledgeBase struct { +type awsRestjson1_deserializeOpDeleteContent struct { } -func (*awsRestjson1_deserializeOpDeleteKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpDeleteContent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -1091,15 +1161,15 @@ func (m *awsRestjson1_deserializeOpDeleteKnowledgeBase) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteContent(response, &metadata) } - output := &DeleteKnowledgeBaseOutput{} + output := &DeleteContentOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -1143,9 +1213,6 @@ func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1162,14 +1229,14 @@ func awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpGetAssistant struct { +type awsRestjson1_deserializeOpDeleteImportJob struct { } -func (*awsRestjson1_deserializeOpGetAssistant) ID() string { +func (*awsRestjson1_deserializeOpDeleteImportJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1183,43 +1250,15 @@ func (m *awsRestjson1_deserializeOpGetAssistant) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAssistant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteImportJob(response, &metadata) } - output := &GetAssistantOutput{} + output := &DeleteImportJobOutput{} 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 { +func awsRestjson1_deserializeOpErrorDeleteImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1263,6 +1302,9 @@ func awsRestjson1_deserializeOpErrorGetAssistant(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1279,50 +1321,14 @@ func awsRestjson1_deserializeOpErrorGetAssistant(response *smithyhttp.Response, } } -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 { +type awsRestjson1_deserializeOpDeleteKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpGetAssistantAssociation) ID() string { +func (*awsRestjson1_deserializeOpDeleteKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAssistantAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -1336,43 +1342,15 @@ func (m *awsRestjson1_deserializeOpGetAssistantAssociation) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAssistantAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteKnowledgeBase(response, &metadata) } - output := &GetAssistantAssociationOutput{} + output := &DeleteKnowledgeBaseOutput{} 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 { +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)} @@ -1416,6 +1394,9 @@ func awsRestjson1_deserializeOpErrorGetAssistantAssociation(response *smithyhttp 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) @@ -1432,50 +1413,103 @@ func awsRestjson1_deserializeOpErrorGetAssistantAssociation(response *smithyhttp } } -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 +type awsRestjson1_deserializeOpDeleteQuickResponse struct { +} + +func (*awsRestjson1_deserializeOpDeleteQuickResponse) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteQuickResponse) HandleDeserialize(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 } - shape, ok := value.(map[string]interface{}) + response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - var sv *GetAssistantAssociationOutput - if *v == nil { - sv = &GetAssistantAssociationOutput{} - } else { - sv = *v + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteQuickResponse(response, &metadata) } + output := &DeleteQuickResponseOutput{} + out.Result = output - for key, value := range shape { - switch key { - case "assistantAssociation": - if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, value); err != nil { - return err - } + return out, metadata, err +} - default: - _, _ = key, value +func awsRestjson1_deserializeOpErrorDeleteQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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 + } - *v = sv - return nil } -type awsRestjson1_deserializeOpGetContent struct { +type awsRestjson1_deserializeOpGetAssistant struct { } -func (*awsRestjson1_deserializeOpGetContent) ID() string { +func (*awsRestjson1_deserializeOpGetAssistant) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -1489,9 +1523,9 @@ func (m *awsRestjson1_deserializeOpGetContent) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAssistant(response, &metadata) } - output := &GetContentOutput{} + output := &GetAssistantOutput{} out.Result = output var buff [1024]byte @@ -1512,7 +1546,7 @@ func (m *awsRestjson1_deserializeOpGetContent) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetContentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAssistantOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1525,7 +1559,7 @@ func (m *awsRestjson1_deserializeOpGetContent) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -1585,7 +1619,7 @@ func awsRestjson1_deserializeOpErrorGetContent(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetContentOutput(v **GetContentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAssistantOutput(v **GetAssistantOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1598,17 +1632,17 @@ func awsRestjson1_deserializeOpDocumentGetContentOutput(v **GetContentOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetContentOutput + var sv *GetAssistantOutput if *v == nil { - sv = &GetContentOutput{} + sv = &GetAssistantOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "content": - if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + case "assistant": + if err := awsRestjson1_deserializeDocumentAssistantData(&sv.Assistant, value); err != nil { return err } @@ -1621,14 +1655,14 @@ func awsRestjson1_deserializeOpDocumentGetContentOutput(v **GetContentOutput, va return nil } -type awsRestjson1_deserializeOpGetContentSummary struct { +type awsRestjson1_deserializeOpGetAssistantAssociation struct { } -func (*awsRestjson1_deserializeOpGetContentSummary) ID() string { +func (*awsRestjson1_deserializeOpGetAssistantAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetContentSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -1642,9 +1676,9 @@ func (m *awsRestjson1_deserializeOpGetContentSummary) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetContentSummary(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAssistantAssociation(response, &metadata) } - output := &GetContentSummaryOutput{} + output := &GetAssistantAssociationOutput{} out.Result = output var buff [1024]byte @@ -1665,7 +1699,7 @@ func (m *awsRestjson1_deserializeOpGetContentSummary) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAssistantAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1678,7 +1712,7 @@ func (m *awsRestjson1_deserializeOpGetContentSummary) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetContentSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -1738,7 +1772,7 @@ func awsRestjson1_deserializeOpErrorGetContentSummary(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(v **GetContentSummaryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAssistantAssociationOutput(v **GetAssistantAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1751,17 +1785,17 @@ func awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(v **GetContentSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetContentSummaryOutput + var sv *GetAssistantAssociationOutput if *v == nil { - sv = &GetContentSummaryOutput{} + sv = &GetAssistantAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "contentSummary": - if err := awsRestjson1_deserializeDocumentContentSummary(&sv.ContentSummary, value); err != nil { + case "assistantAssociation": + if err := awsRestjson1_deserializeDocumentAssistantAssociationData(&sv.AssistantAssociation, value); err != nil { return err } @@ -1774,14 +1808,14 @@ func awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(v **GetContentSum return nil } -type awsRestjson1_deserializeOpGetKnowledgeBase struct { +type awsRestjson1_deserializeOpGetContent struct { } -func (*awsRestjson1_deserializeOpGetKnowledgeBase) ID() string { +func (*awsRestjson1_deserializeOpGetContent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -1795,9 +1829,9 @@ func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetKnowledgeBase(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetContent(response, &metadata) } - output := &GetKnowledgeBaseOutput{} + output := &GetContentOutput{} out.Result = output var buff [1024]byte @@ -1818,7 +1852,7 @@ func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetContentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1831,7 +1865,7 @@ func (m *awsRestjson1_deserializeOpGetKnowledgeBase) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -1891,7 +1925,7 @@ func awsRestjson1_deserializeOpErrorGetKnowledgeBase(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBaseOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetContentOutput(v **GetContentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1904,17 +1938,17 @@ func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBa return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetKnowledgeBaseOutput + var sv *GetContentOutput if *v == nil { - sv = &GetKnowledgeBaseOutput{} + sv = &GetContentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + case "content": + if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { return err } @@ -1927,14 +1961,14 @@ func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBa return nil } -type awsRestjson1_deserializeOpGetRecommendations struct { +type awsRestjson1_deserializeOpGetContentSummary struct { } -func (*awsRestjson1_deserializeOpGetRecommendations) ID() string { +func (*awsRestjson1_deserializeOpGetContentSummary) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -1948,9 +1982,9 @@ func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetRecommendations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetContentSummary(response, &metadata) } - output := &GetRecommendationsOutput{} + output := &GetContentSummaryOutput{} out.Result = output var buff [1024]byte @@ -1971,7 +2005,7 @@ func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1984,7 +2018,7 @@ func (m *awsRestjson1_deserializeOpGetRecommendations) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetRecommendations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -2044,7 +2078,7 @@ func awsRestjson1_deserializeOpErrorGetRecommendations(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommendationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetContentSummaryOutput(v **GetContentSummaryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2057,22 +2091,17 @@ func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommend return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetRecommendationsOutput + var sv *GetContentSummaryOutput if *v == nil { - sv = &GetRecommendationsOutput{} + sv = &GetContentSummaryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "recommendations": - if err := awsRestjson1_deserializeDocumentRecommendationList(&sv.Recommendations, value); err != nil { - return err - } - - case "triggers": - if err := awsRestjson1_deserializeDocumentRecommendationTriggerList(&sv.Triggers, value); err != nil { + case "contentSummary": + if err := awsRestjson1_deserializeDocumentContentSummary(&sv.ContentSummary, value); err != nil { return err } @@ -2085,14 +2114,14 @@ func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommend return nil } -type awsRestjson1_deserializeOpGetSession struct { +type awsRestjson1_deserializeOpGetImportJob struct { } -func (*awsRestjson1_deserializeOpGetSession) ID() string { +func (*awsRestjson1_deserializeOpGetImportJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2106,9 +2135,9 @@ func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetSession(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetImportJob(response, &metadata) } - output := &GetSessionOutput{} + output := &GetImportJobOutput{} out.Result = output var buff [1024]byte @@ -2129,7 +2158,7 @@ func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSessionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetImportJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2142,7 +2171,7 @@ func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetSession(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2202,7 +2231,7 @@ func awsRestjson1_deserializeOpErrorGetSession(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetImportJobOutput(v **GetImportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2215,17 +2244,17 @@ func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSessionOutput + var sv *GetImportJobOutput if *v == nil { - sv = &GetSessionOutput{} + sv = &GetImportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "session": - if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, value); err != nil { + case "importJob": + if err := awsRestjson1_deserializeDocumentImportJobData(&sv.ImportJob, value); err != nil { return err } @@ -2238,14 +2267,14 @@ func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, va return nil } -type awsRestjson1_deserializeOpListAssistantAssociations struct { +type awsRestjson1_deserializeOpGetKnowledgeBase struct { } -func (*awsRestjson1_deserializeOpListAssistantAssociations) ID() string { +func (*awsRestjson1_deserializeOpGetKnowledgeBase) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -2259,9 +2288,9 @@ func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssistantAssociations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetKnowledgeBase(response, &metadata) } - output := &ListAssistantAssociationsOutput{} + output := &GetKnowledgeBaseOutput{} out.Result = output var buff [1024]byte @@ -2282,7 +2311,7 @@ func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2295,7 +2324,7 @@ func (m *awsRestjson1_deserializeOpListAssistantAssociations) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssistantAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -2355,7 +2384,7 @@ func awsRestjson1_deserializeOpErrorListAssistantAssociations(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListAssistantAssociationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetKnowledgeBaseOutput(v **GetKnowledgeBaseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2368,29 +2397,20 @@ func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssistantAssociationsOutput + var sv *GetKnowledgeBaseOutput if *v == nil { - sv = &ListAssistantAssociationsOutput{} + sv = &GetKnowledgeBaseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantAssociationSummaries": - if err := awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(&sv.AssistantAssociationSummaries, value); err != nil { + case "knowledgeBase": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, 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 @@ -2400,14 +2420,14 @@ func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListA return nil } -type awsRestjson1_deserializeOpListAssistants struct { +type awsRestjson1_deserializeOpGetQuickResponse struct { } -func (*awsRestjson1_deserializeOpListAssistants) ID() string { +func (*awsRestjson1_deserializeOpGetQuickResponse) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetQuickResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2421,9 +2441,9 @@ func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssistants(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetQuickResponse(response, &metadata) } - output := &ListAssistantsOutput{} + output := &GetQuickResponseOutput{} out.Result = output var buff [1024]byte @@ -2444,7 +2464,7 @@ func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssistantsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2457,7 +2477,7 @@ func (m *awsRestjson1_deserializeOpListAssistants) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssistants(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2501,6 +2521,9 @@ func awsRestjson1_deserializeOpErrorListAssistants(response *smithyhttp.Response 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) @@ -2514,7 +2537,7 @@ func awsRestjson1_deserializeOpErrorListAssistants(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetQuickResponseOutput(v **GetQuickResponseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2527,29 +2550,20 @@ func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssistantsOutput + var sv *GetQuickResponseOutput if *v == nil { - sv = &ListAssistantsOutput{} + sv = &GetQuickResponseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantSummaries": - if err := awsRestjson1_deserializeDocumentAssistantList(&sv.AssistantSummaries, value); err != nil { + case "quickResponse": + if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, 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 @@ -2559,14 +2573,14 @@ func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOu return nil } -type awsRestjson1_deserializeOpListContents struct { +type awsRestjson1_deserializeOpGetRecommendations struct { } -func (*awsRestjson1_deserializeOpListContents) ID() string { +func (*awsRestjson1_deserializeOpGetRecommendations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -2580,9 +2594,9 @@ func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListContents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetRecommendations(response, &metadata) } - output := &ListContentsOutput{} + output := &GetRecommendationsOutput{} out.Result = output var buff [1024]byte @@ -2603,7 +2617,7 @@ func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListContentsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2616,7 +2630,7 @@ func (m *awsRestjson1_deserializeOpListContents) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListContents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -2676,7 +2690,7 @@ func awsRestjson1_deserializeOpErrorListContents(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetRecommendationsOutput(v **GetRecommendationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2689,27 +2703,23 @@ func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListContentsOutput + var sv *GetRecommendationsOutput if *v == nil { - sv = &ListContentsOutput{} + sv = &GetRecommendationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "contentSummaries": - if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, value); err != nil { + case "recommendations": + if err := awsRestjson1_deserializeDocumentRecommendationList(&sv.Recommendations, 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) + case "triggers": + if err := awsRestjson1_deserializeDocumentRecommendationTriggerList(&sv.Triggers, value); err != nil { + return err } default: @@ -2721,14 +2731,14 @@ func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput return nil } -type awsRestjson1_deserializeOpListKnowledgeBases struct { +type awsRestjson1_deserializeOpGetSession struct { } -func (*awsRestjson1_deserializeOpListKnowledgeBases) ID() string { +func (*awsRestjson1_deserializeOpGetSession) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -2742,9 +2752,9 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListKnowledgeBases(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetSession(response, &metadata) } - output := &ListKnowledgeBasesOutput{} + output := &GetSessionOutput{} out.Result = output var buff [1024]byte @@ -2765,7 +2775,7 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetSessionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2778,7 +2788,7 @@ func (m *awsRestjson1_deserializeOpListKnowledgeBases) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -2822,6 +2832,9 @@ func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Resp 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) @@ -2835,7 +2848,7 @@ func awsRestjson1_deserializeOpErrorListKnowledgeBases(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledgeBasesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2848,29 +2861,20 @@ func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListKnowledgeBasesOutput + var sv *GetSessionOutput if *v == nil { - sv = &ListKnowledgeBasesOutput{} + sv = &GetSessionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBaseSummaries": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseList(&sv.KnowledgeBaseSummaries, value); err != nil { + case "session": + if err := awsRestjson1_deserializeDocumentSessionData(&sv.Session, 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 @@ -2880,14 +2884,14 @@ func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledg return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListAssistantAssociations struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListAssistantAssociations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -2901,9 +2905,9 @@ 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_deserializeOpErrorListAssistantAssociations(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListAssistantAssociationsOutput{} out.Result = output var buff [1024]byte @@ -2924,7 +2928,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2937,7 +2941,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -2978,9 +2982,15 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } 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, @@ -2991,7 +3001,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssistantAssociationsOutput(v **ListAssistantAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3004,20 +3014,29 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListAssistantAssociationsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListAssistantAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + 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 @@ -3027,14 +3046,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpNotifyRecommendationsReceived struct { +type awsRestjson1_deserializeOpListAssistants struct { } -func (*awsRestjson1_deserializeOpNotifyRecommendationsReceived) ID() string { +func (*awsRestjson1_deserializeOpListAssistants) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -3048,9 +3067,9 @@ func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssistants(response, &metadata) } - output := &NotifyRecommendationsReceivedOutput{} + output := &ListAssistantsOutput{} out.Result = output var buff [1024]byte @@ -3071,7 +3090,7 @@ func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserial return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssistantsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3084,7 +3103,7 @@ func (m *awsRestjson1_deserializeOpNotifyRecommendationsReceived) HandleDeserial return out, metadata, err } -func awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -3128,9 +3147,6 @@ func awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response *smit 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) @@ -3144,7 +3160,7 @@ func awsRestjson1_deserializeOpErrorNotifyRecommendationsReceived(response *smit } } -func awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **NotifyRecommendationsReceivedOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssistantsOutput(v **ListAssistantsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3157,23 +3173,27 @@ func awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **N return fmt.Errorf("unexpected JSON type %v", value) } - var sv *NotifyRecommendationsReceivedOutput + var sv *ListAssistantsOutput if *v == nil { - sv = &NotifyRecommendationsReceivedOutput{} + sv = &ListAssistantsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "errors": - if err := awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(&sv.Errors, value); err != nil { + case "assistantSummaries": + if err := awsRestjson1_deserializeDocumentAssistantList(&sv.AssistantSummaries, value); err != nil { return err } - case "recommendationIds": - if err := awsRestjson1_deserializeDocumentRecommendationIdList(&sv.RecommendationIds, 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: @@ -3185,14 +3205,14 @@ func awsRestjson1_deserializeOpDocumentNotifyRecommendationsReceivedOutput(v **N return nil } -type awsRestjson1_deserializeOpQueryAssistant struct { +type awsRestjson1_deserializeOpListContents struct { } -func (*awsRestjson1_deserializeOpQueryAssistant) ID() string { +func (*awsRestjson1_deserializeOpListContents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -3206,9 +3226,9 @@ func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorQueryAssistant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListContents(response, &metadata) } - output := &QueryAssistantOutput{} + output := &ListContentsOutput{} out.Result = output var buff [1024]byte @@ -3229,7 +3249,7 @@ func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentQueryAssistantOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListContentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3242,7 +3262,7 @@ func (m *awsRestjson1_deserializeOpQueryAssistant) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorQueryAssistant(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -3302,7 +3322,7 @@ func awsRestjson1_deserializeOpErrorQueryAssistant(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListContentsOutput(v **ListContentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3315,15 +3335,20 @@ func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *QueryAssistantOutput + var sv *ListContentsOutput if *v == nil { - sv = &QueryAssistantOutput{} + 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) @@ -3333,11 +3358,6 @@ func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOu sv.NextToken = ptr.String(jtv) } - case "results": - if err := awsRestjson1_deserializeDocumentQueryResultsList(&sv.Results, value); err != nil { - return err - } - default: _, _ = key, value @@ -3347,14 +3367,14 @@ func awsRestjson1_deserializeOpDocumentQueryAssistantOutput(v **QueryAssistantOu return nil } -type awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri struct { +type awsRestjson1_deserializeOpListImportJobs struct { } -func (*awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) ID() string { +func (*awsRestjson1_deserializeOpListImportJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3368,15 +3388,43 @@ func (m *awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImportJobs(response, &metadata) } - output := &RemoveKnowledgeBaseTemplateUriOutput{} + output := &ListImportJobsOutput{} 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_deserializeOpDocumentListImportJobsOutput(&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_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3420,9 +3468,6 @@ func awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response *smi 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) @@ -3436,40 +3481,85 @@ func awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response *smi } } -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 +func awsRestjson1_deserializeOpDocumentListImportJobsOutput(v **ListImportJobsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - response, ok := out.RawResponse.(*smithyhttp.Response) + shape, ok := value.(map[string]interface{}) if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + return fmt.Errorf("unexpected JSON type %v", value) } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchContent(response, &metadata) + var sv *ListImportJobsOutput + if *v == nil { + sv = &ListImportJobsOutput{} + } else { + sv = *v } - output := &SearchContentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) + for key, value := range shape { + switch key { + case "importJobSummaries": + if err := awsRestjson1_deserializeDocumentImportJobList(&sv.ImportJobSummaries, value); err != nil { + return err + } - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} + 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_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) @@ -3480,7 +3570,7 @@ func (m *awsRestjson1_deserializeOpSearchContent) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchContentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3493,7 +3583,7 @@ func (m *awsRestjson1_deserializeOpSearchContent) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -3537,9 +3627,6 @@ func awsRestjson1_deserializeOpErrorSearchContent(response *smithyhttp.Response, 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) @@ -3553,7 +3640,7 @@ func awsRestjson1_deserializeOpErrorSearchContent(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListKnowledgeBasesOutput(v **ListKnowledgeBasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3566,17 +3653,17 @@ func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchContentOutput + var sv *ListKnowledgeBasesOutput if *v == nil { - sv = &SearchContentOutput{} + sv = &ListKnowledgeBasesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "contentSummaries": - if err := awsRestjson1_deserializeDocumentContentSummaryList(&sv.ContentSummaries, value); err != nil { + case "knowledgeBaseSummaries": + if err := awsRestjson1_deserializeDocumentKnowledgeBaseList(&sv.KnowledgeBaseSummaries, value); err != nil { return err } @@ -3584,7 +3671,7 @@ func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutp if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -3598,14 +3685,14 @@ func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutp return nil } -type awsRestjson1_deserializeOpSearchSessions struct { +type awsRestjson1_deserializeOpListQuickResponses struct { } -func (*awsRestjson1_deserializeOpSearchSessions) ID() string { +func (*awsRestjson1_deserializeOpListQuickResponses) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListQuickResponses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3619,9 +3706,9 @@ func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchSessions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListQuickResponses(response, &metadata) } - output := &SearchSessionsOutput{} + output := &ListQuickResponsesOutput{} out.Result = output var buff [1024]byte @@ -3642,7 +3729,7 @@ func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchSessionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3655,7 +3742,7 @@ func (m *awsRestjson1_deserializeOpSearchSessions) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchSessions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListQuickResponses(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3715,7 +3802,7 @@ func awsRestjson1_deserializeOpErrorSearchSessions(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListQuickResponsesOutput(v **ListQuickResponsesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3728,9 +3815,9 @@ func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchSessionsOutput + var sv *ListQuickResponsesOutput if *v == nil { - sv = &SearchSessionsOutput{} + sv = &ListQuickResponsesOutput{} } else { sv = *v } @@ -3741,13 +3828,13 @@ func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOu if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString 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 { + case "quickResponseSummaries": + if err := awsRestjson1_deserializeDocumentQuickResponseSummaryList(&sv.QuickResponseSummaries, value); err != nil { return err } @@ -3760,14 +3847,14 @@ func awsRestjson1_deserializeOpDocumentSearchSessionsOutput(v **SearchSessionsOu return nil } -type awsRestjson1_deserializeOpStartContentUpload struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpStartContentUpload) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -3781,9 +3868,9 @@ func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartContentUpload(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &StartContentUploadOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -3804,7 +3891,7 @@ func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartContentUploadOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3817,7 +3904,7 @@ func (m *awsRestjson1_deserializeOpStartContentUpload) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartContentUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -3858,15 +3945,9 @@ func awsRestjson1_deserializeOpErrorStartContentUpload(response *smithyhttp.Resp } 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, @@ -3877,7 +3958,7 @@ func awsRestjson1_deserializeOpErrorStartContentUpload(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentStartContentUploadOutput(v **StartContentUploadOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3890,54 +3971,20 @@ func awsRestjson1_deserializeOpDocumentStartContentUploadOutput(v **StartContent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartContentUploadOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &StartContentUploadOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "headersToInclude": - if err := awsRestjson1_deserializeDocumentHeaders(&sv.HeadersToInclude, value); err != nil { + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } - case "uploadId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UploadId 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 @@ -3947,14 +3994,14 @@ func awsRestjson1_deserializeOpDocumentStartContentUploadOutput(v **StartContent return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpNotifyRecommendationsReceived struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpNotifyRecommendationsReceived) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -3968,15 +4015,43 @@ 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_deserializeOpErrorNotifyRecommendationsReceived(response, &metadata) } - output := &TagResourceOutput{} + 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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -4017,11 +4092,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("TooManyTagsException", errorCode): - return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4033,14 +4111,55 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +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 } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpQueryAssistant struct { +} + +func (*awsRestjson1_deserializeOpQueryAssistant) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -4054,19 +4173,47 @@ 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_deserializeOpErrorQueryAssistant(response, &metadata) } - output := &UntagResourceOutput{} + output := &QueryAssistantOutput{} out.Result = output - return out, metadata, err -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -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)} - } + 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" @@ -4103,9 +4250,18 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("RequestTimeoutException", errorCode): + return awsRestjson1_deserializeErrorRequestTimeoutException(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, @@ -4116,14 +4272,59 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateContent struct { +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 } -func (*awsRestjson1_deserializeOpUpdateContent) ID() string { +type awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri struct { +} + +func (*awsRestjson1_deserializeOpRemoveKnowledgeBaseTemplateUri) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -4137,9 +4338,98 @@ func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRemoveKnowledgeBaseTemplateUri(response, &metadata) } - output := &UpdateContentOutput{} + 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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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 @@ -4160,7 +4450,7 @@ func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateContentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchContentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4173,7 +4463,7 @@ func (m *awsRestjson1_deserializeOpUpdateContent) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -4217,9 +4507,6 @@ func awsRestjson1_deserializeOpErrorUpdateContent(response *smithyhttp.Response, 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) @@ -4236,7 +4523,7 @@ func awsRestjson1_deserializeOpErrorUpdateContent(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchContentOutput(v **SearchContentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4249,20 +4536,29 @@ func awsRestjson1_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateContentOutput + var sv *SearchContentOutput if *v == nil { - sv = &UpdateContentOutput{} + sv = &SearchContentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "content": - if err := awsRestjson1_deserializeDocumentContentData(&sv.Content, value); err != nil { + 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 @@ -4272,14 +4568,14 @@ func awsRestjson1_deserializeOpDocumentUpdateContentOutput(v **UpdateContentOutp return nil } -type awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri struct { +type awsRestjson1_deserializeOpSearchQuickResponses struct { } -func (*awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) ID() string { +func (*awsRestjson1_deserializeOpSearchQuickResponses) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchQuickResponses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4293,9 +4589,9 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchQuickResponses(response, &metadata) } - output := &UpdateKnowledgeBaseTemplateUriOutput{} + output := &SearchQuickResponsesOutput{} out.Result = output var buff [1024]byte @@ -4316,7 +4612,7 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchQuickResponsesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4329,7 +4625,7 @@ func (m *awsRestjson1_deserializeOpUpdateKnowledgeBaseTemplateUri) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchQuickResponses(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4373,6 +4669,9 @@ func awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response *smi case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("RequestTimeoutException", errorCode): + return awsRestjson1_deserializeErrorRequestTimeoutException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4389,7 +4688,7 @@ func awsRestjson1_deserializeOpErrorUpdateKnowledgeBaseTemplateUri(response *smi } } -func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v **UpdateKnowledgeBaseTemplateUriOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchQuickResponsesOutput(v **SearchQuickResponsesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4402,17 +4701,26 @@ func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateKnowledgeBaseTemplateUriOutput + var sv *SearchQuickResponsesOutput if *v == nil { - sv = &UpdateKnowledgeBaseTemplateUriOutput{} + sv = &SearchQuickResponsesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "knowledgeBase": - if err := awsRestjson1_deserializeDocumentKnowledgeBaseData(&sv.KnowledgeBase, value); err != nil { + 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) + } + + case "results": + if err := awsRestjson1_deserializeDocumentQuickResponseSearchResultsList(&sv.Results, value); err != nil { return err } @@ -4425,48 +4733,37 @@ func awsRestjson1_deserializeOpDocumentUpdateKnowledgeBaseTemplateUriOutput(v ** return nil } -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +type awsRestjson1_deserializeOpSearchSessions struct { +} - 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) +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 { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchSessions(response, &metadata) + } + output := &SearchSessionsOutput{} + out.Result = 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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4477,36 +4774,45 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentConflictException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentSearchSessionsOutput(&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), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorPreconditionFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PreconditionFailedException{} +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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -4516,65 +4822,110 @@ func awsRestjson1_deserializeErrorPreconditionFailedException(response *smithyht return err } - err := awsRestjson1_deserializeDocumentPreconditionFailedException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("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 err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +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 + } - return output -} + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + 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 - 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 } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) +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 { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartContentUpload(response, &metadata) + } + output := &StartContentUploadOutput{} + out.Result = 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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4585,47 +4936,44 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentStartContentUploadOutput(&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), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTagsException{} +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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentTooManyTagsException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4637,19 +4985,137 @@ func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) -func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ValidationException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} + 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 UploadId 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_deserializeOpStartImportJob struct { +} + +func (*awsRestjson1_deserializeOpStartImportJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartImportJob) HandleDeserialize(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_deserializeOpErrorStartImportJob(response, &metadata) + } + output := &StartImportJobOutput{} + 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) @@ -4657,27 +5123,2262 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentStartImportJobOutput(&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_deserializeOpErrorStartImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentStartImportJobOutput(v **StartImportJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartImportJobOutput + if *v == nil { + sv = &StartImportJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "importJob": + if err := awsRestjson1_deserializeDocumentImportJobData(&sv.ImportJob, 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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return 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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return 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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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 +} + +type awsRestjson1_deserializeOpUpdateQuickResponse struct { +} + +func (*awsRestjson1_deserializeOpUpdateQuickResponse) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateQuickResponse) HandleDeserialize(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_deserializeOpErrorUpdateQuickResponse(response, &metadata) + } + output := &UpdateQuickResponseOutput{} + 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_deserializeOpDocumentUpdateQuickResponseOutput(&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_deserializeOpErrorUpdateQuickResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentUpdateQuickResponseOutput(v **UpdateQuickResponseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateQuickResponseOutput + if *v == nil { + sv = &UpdateQuickResponseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "quickResponse": + if err := awsRestjson1_deserializeDocumentQuickResponseData(&sv.QuickResponse, 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_deserializeErrorRequestTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RequestTimeoutException{} + 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_deserializeDocumentRequestTimeoutException(&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 "integrationConfiguration": + if err := awsRestjson1_deserializeDocumentAssistantIntegrationConfiguration(&sv.IntegrationConfiguration, 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 "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_deserializeDocumentAssistantIntegrationConfiguration(v **types.AssistantIntegrationConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AssistantIntegrationConfiguration + if *v == nil { + sv = &types.AssistantIntegrationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "topicIntegrationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) + } + sv.TopicIntegrationArn = ptr.String(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 "integrationConfiguration": + if err := awsRestjson1_deserializeDocumentAssistantIntegrationConfiguration(&sv.IntegrationConfiguration, 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 "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_deserializeDocumentChannels(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 Channel to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConfiguration(v *types.Configuration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Configuration +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "connectConfiguration": + var mv types.ConnectConfiguration + destAddr := &mv + if err := awsRestjson1_deserializeDocumentConnectConfiguration(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ConfigurationMemberConnectConfiguration{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + 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_deserializeDocumentConnectConfiguration(v **types.ConnectConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ConnectConfiguration + if *v == nil { + sv = &types.ConnectConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContactAttributeKeys(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 ContactAttributeKey to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + 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 +} - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) +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 + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) + var cv []types.ContentSummary + if *v == nil { + cv = []types.ContentSummary{} + } else { + cv = *v + } - return output + 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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentDocument(v **types.Document, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4690,22 +7391,28 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.Document if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.Document{} } 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 "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: @@ -4717,7 +7424,7 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsRestjson1_deserializeDocumentAppIntegrationsConfiguration(v **types.AppIntegrationsConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentDocumentText(v **types.DocumentText, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4730,27 +7437,27 @@ func awsRestjson1_deserializeDocumentAppIntegrationsConfiguration(v **types.AppI return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AppIntegrationsConfiguration + var sv *types.DocumentText if *v == nil { - sv = &types.AppIntegrationsConfiguration{} + sv = &types.DocumentText{} } else { sv = *v } for key, value := range shape { switch key { - case "appIntegrationArn": + 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 GenericArn to be of type string, got %T instead", value) + return fmt.Errorf("expected SensitiveString 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 + sv.Text = ptr.String(jtv) } default: @@ -4762,7 +7469,7 @@ func awsRestjson1_deserializeDocumentAppIntegrationsConfiguration(v **types.AppI return nil } -func awsRestjson1_deserializeDocumentAssistantAssociationData(v **types.AssistantAssociationData, value interface{}) error { +func awsRestjson1_deserializeDocumentExternalSourceConfiguration(v **types.ExternalSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4775,67 +7482,71 @@ func awsRestjson1_deserializeDocumentAssistantAssociationData(v **types.Assistan return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssistantAssociationData + var sv *types.ExternalSourceConfiguration if *v == nil { - sv = &types.AssistantAssociationData{} + sv = &types.ExternalSourceConfiguration{} } 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 "configuration": + if err := awsRestjson1_deserializeDocumentConfiguration(&sv.Configuration, value); err != nil { + return err } - case "assistantAssociationArn": + case "source": 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 ExternalSource to be of type string, got %T instead", value) } - sv.AssistantAssociationArn = ptr.String(jtv) + sv.Source = types.ExternalSource(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) - } + default: + _, _ = key, value - 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) - } + } + } + *v = sv + return nil +} - case "associationData": - if err := awsRestjson1_deserializeDocumentAssistantAssociationOutputData(&sv.AssociationData, value); err != nil { - return err - } +func awsRestjson1_deserializeDocumentGroupingConfiguration(v **types.GroupingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "associationType": + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GroupingConfiguration + if *v == nil { + sv = &types.GroupingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "criteria": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssociationType to be of type string, got %T instead", value) + return fmt.Errorf("expected GroupingCriteria to be of type string, got %T instead", value) } - sv.AssociationType = types.AssociationType(jtv) + sv.Criteria = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + case "values": + if err := awsRestjson1_deserializeDocumentGroupingValues(&sv.Values, value); err != nil { return err } @@ -4848,7 +7559,7 @@ func awsRestjson1_deserializeDocumentAssistantAssociationData(v **types.Assistan return nil } -func awsRestjson1_deserializeDocumentAssistantAssociationOutputData(v *types.AssistantAssociationOutputData, value interface{}) error { +func awsRestjson1_deserializeDocumentGroupingValues(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4856,39 +7567,35 @@ func awsRestjson1_deserializeDocumentAssistantAssociationOutputData(v *types.Ass return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]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 + 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 GroupingValue to be of type string, got %T instead", value) + } + col = jtv } + cv = append(cv, col) + } - *v = uv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAssistantAssociationSummary(v **types.AssistantAssociationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentHeaders(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4901,68 +7608,75 @@ func awsRestjson1_deserializeDocumentAssistantAssociationSummary(v **types.Assis return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssistantAssociationSummary + var mv map[string]string if *v == nil { - sv = &types.AssistantAssociationSummary{} + mv = map[string]string{} } else { - sv = *v + mv = *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) + 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 - 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) - } + } + *v = mv + return nil +} - 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) - } +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 + } - case "assistantId": + for key, value := range shape { + switch key { + case "beginOffsetInclusive": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + return fmt.Errorf("expected HighlightOffset to be json.Number, got %T instead", value) } - sv.AssistantId = ptr.String(jtv) - } - - case "associationData": - if err := awsRestjson1_deserializeDocumentAssistantAssociationOutputData(&sv.AssociationData, value); err != nil { - return err + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BeginOffsetInclusive = int32(i64) } - case "associationType": + case "endOffsetExclusive": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected AssociationType to be of type string, got %T instead", value) + return fmt.Errorf("expected HighlightOffset to be json.Number, got %T instead", value) } - sv.AssociationType = types.AssociationType(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { - return err + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndOffsetExclusive = int32(i64) } default: @@ -4974,7 +7688,7 @@ func awsRestjson1_deserializeDocumentAssistantAssociationSummary(v **types.Assis return nil } -func awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(v *[]types.AssistantAssociationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentHighlights(v *[]types.Highlight, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4987,17 +7701,17 @@ func awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(v *[]types. return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssistantAssociationSummary + var cv []types.Highlight if *v == nil { - cv = []types.AssistantAssociationSummary{} + cv = []types.Highlight{} } else { cv = *v } for _, value := range shape { - var col types.AssistantAssociationSummary + var col types.Highlight destAddr := &col - if err := awsRestjson1_deserializeDocumentAssistantAssociationSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentHighlight(&destAddr, value); err != nil { return err } col = *destAddr @@ -5008,7 +7722,7 @@ func awsRestjson1_deserializeDocumentAssistantAssociationSummaryList(v *[]types. return nil } -func awsRestjson1_deserializeDocumentAssistantData(v **types.AssistantData, value interface{}) error { +func awsRestjson1_deserializeDocumentImportJobData(v **types.ImportJobData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5021,58 +7735,99 @@ func awsRestjson1_deserializeDocumentAssistantData(v **types.AssistantData, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssistantData + var sv *types.ImportJobData if *v == nil { - sv = &types.AssistantData{} + sv = &types.ImportJobData{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantArn": + case "createdTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "externalSourceConfiguration": + if err := awsRestjson1_deserializeDocumentExternalSourceConfiguration(&sv.ExternalSourceConfiguration, value); err != nil { + return err + } + + case "failedRecordReport": 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 Url to be of type string, got %T instead", value) } - sv.AssistantArn = ptr.String(jtv) + sv.FailedRecordReport = ptr.String(jtv) } - case "assistantId": + case "importJobId": 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) + sv.ImportJobId = ptr.String(jtv) } - case "description": + case "importJobType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected ImportJobType to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.ImportJobType = types.ImportJobType(jtv) } - case "integrationConfiguration": - if err := awsRestjson1_deserializeDocumentAssistantIntegrationConfiguration(&sv.IntegrationConfiguration, value); err != nil { - return err + 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 "name": + case "knowledgeBaseId": 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 Uuid to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.KnowledgeBaseId = ptr.String(jtv) } - case "serverSideEncryptionConfiguration": - if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + case "lastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentContentMetadata(&sv.Metadata, value); err != nil { return err } @@ -5080,63 +7835,43 @@ func awsRestjson1_deserializeDocumentAssistantData(v **types.AssistantData, valu if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssistantStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected ImportJobStatus to be of type string, got %T instead", value) } - sv.Status = types.AssistantStatus(jtv) + sv.Status = types.ImportJobStatus(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { - return err + case "uploadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UploadId to be of type string, got %T instead", value) + } + sv.UploadId = ptr.String(jtv) } - case "type": + case "url": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssistantType to be of type string, got %T instead", value) + return fmt.Errorf("expected Url to be of type string, got %T instead", value) } - sv.Type = types.AssistantType(jtv) + sv.Url = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAssistantIntegrationConfiguration(v **types.AssistantIntegrationConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "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)) - var sv *types.AssistantIntegrationConfiguration - if *v == nil { - sv = &types.AssistantIntegrationConfiguration{} - } else { - sv = *v - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - for key, value := range shape { - switch key { - case "topicIntegrationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) } - sv.TopicIntegrationArn = ptr.String(jtv) } default: @@ -5148,7 +7883,7 @@ func awsRestjson1_deserializeDocumentAssistantIntegrationConfiguration(v **types return nil } -func awsRestjson1_deserializeDocumentAssistantList(v *[]types.AssistantSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentImportJobList(v *[]types.ImportJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5161,17 +7896,17 @@ func awsRestjson1_deserializeDocumentAssistantList(v *[]types.AssistantSummary, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssistantSummary + var cv []types.ImportJobSummary if *v == nil { - cv = []types.AssistantSummary{} + cv = []types.ImportJobSummary{} } else { cv = *v } for _, value := range shape { - var col types.AssistantSummary + var col types.ImportJobSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAssistantSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentImportJobSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -5182,7 +7917,7 @@ func awsRestjson1_deserializeDocumentAssistantList(v *[]types.AssistantSummary, return nil } -func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentImportJobSummary(v **types.ImportJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5195,58 +7930,90 @@ func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssistantSummary + var sv *types.ImportJobSummary if *v == nil { - sv = &types.AssistantSummary{} + sv = &types.ImportJobSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "assistantArn": + case "createdTime": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.AssistantArn = ptr.String(jtv) } - case "assistantId": + case "externalSourceConfiguration": + if err := awsRestjson1_deserializeDocumentExternalSourceConfiguration(&sv.ExternalSourceConfiguration, value); err != nil { + return err + } + + case "importJobId": 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) + sv.ImportJobId = ptr.String(jtv) } - case "description": + case "importJobType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected ImportJobType to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.ImportJobType = types.ImportJobType(jtv) } - case "integrationConfiguration": - if err := awsRestjson1_deserializeDocumentAssistantIntegrationConfiguration(&sv.IntegrationConfiguration, value); err != nil { - return err + 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 "name": + case "knowledgeBaseId": 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 Uuid to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.KnowledgeBaseId = ptr.String(jtv) } - case "serverSideEncryptionConfiguration": - if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { + case "lastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "metadata": + if err := awsRestjson1_deserializeDocumentContentMetadata(&sv.Metadata, value); err != nil { return err } @@ -5254,23 +8021,18 @@ func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssistantStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected ImportJobStatus 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 + sv.Status = types.ImportJobStatus(jtv) } - case "type": + case "uploadId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssistantType to be of type string, got %T instead", value) + return fmt.Errorf("expected UploadId to be of type string, got %T instead", value) } - sv.Type = types.AssistantType(jtv) + sv.UploadId = ptr.String(jtv) } default: @@ -5282,7 +8044,7 @@ func awsRestjson1_deserializeDocumentAssistantSummary(v **types.AssistantSummary return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseAssociationData(v **types.KnowledgeBaseAssociationData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5295,22 +8057,31 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.KnowledgeBaseAssociationData if *v == nil { - sv = &types.ConflictException{} + sv = &types.KnowledgeBaseAssociationData{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "knowledgeBaseArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + 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: @@ -5322,7 +8093,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsRestjson1_deserializeDocumentContentData(v **types.ContentData, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5335,40 +8106,22 @@ func awsRestjson1_deserializeDocumentContentData(v **types.ContentData, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ContentData + var sv *types.KnowledgeBaseData if *v == nil { - sv = &types.ContentData{} + sv = &types.KnowledgeBaseData{} } 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": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.ContentType = ptr.String(jtv) + sv.Description = ptr.String(jtv) } case "knowledgeBaseArn": @@ -5389,18 +8142,29 @@ func awsRestjson1_deserializeDocumentContentData(v **types.ContentData, value in sv.KnowledgeBaseId = ptr.String(jtv) } - case "linkOutUri": + case "knowledgeBaseType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Uri to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseType to be of type string, got %T instead", value) } - sv.LinkOutUri = ptr.String(jtv) + sv.KnowledgeBaseType = types.KnowledgeBaseType(jtv) } - case "metadata": - if err := awsRestjson1_deserializeDocumentContentMetadata(&sv.Metadata, value); err != nil { - return err + 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": @@ -5412,61 +8176,33 @@ func awsRestjson1_deserializeDocumentContentData(v **types.ContentData, value in 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 "renderingConfiguration": + if err := awsRestjson1_deserializeDocumentRenderingConfiguration(&sv.RenderingConfiguration, value); err != nil { + return err } - case "tags": - if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + case "serverSideEncryptionConfiguration": + if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, 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 "sourceConfiguration": + if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err } - case "url": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Url to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) } - sv.Url = ptr.String(jtv) + sv.Status = types.KnowledgeBaseStatus(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) - - } + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err } default: @@ -5478,7 +8214,7 @@ func awsRestjson1_deserializeDocumentContentData(v **types.ContentData, value in return nil } -func awsRestjson1_deserializeDocumentContentMetadata(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseList(v *[]types.KnowledgeBaseSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5486,102 +8222,33 @@ func awsRestjson1_deserializeDocumentContentMetadata(v *map[string]string, value return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var cv []types.KnowledgeBaseSummary if *v == nil { - mv = map[string]string{} + cv = []types.KnowledgeBaseSummary{} } else { - mv = *v + cv = *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 + for _, value := range shape { + var col types.KnowledgeBaseSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentKnowledgeBaseSummary(&destAddr, value); err != nil { + return err } - 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 + col = *destAddr + cv = append(cv, col) - } } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentContentSummary(v **types.ContentSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBaseSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5592,42 +8259,24 @@ func awsRestjson1_deserializeDocumentContentSummary(v **types.ContentSummary, va 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": + 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 ContentType to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.ContentType = ptr.String(jtv) + sv.Description = ptr.String(jtv) } case "knowledgeBaseArn": @@ -5648,9 +8297,13 @@ func awsRestjson1_deserializeDocumentContentSummary(v **types.ContentSummary, va sv.KnowledgeBaseId = ptr.String(jtv) } - case "metadata": - if err := awsRestjson1_deserializeDocumentContentMetadata(&sv.Metadata, value); err != nil { - return err + 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": @@ -5662,22 +8315,28 @@ func awsRestjson1_deserializeDocumentContentSummary(v **types.ContentSummary, va 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 "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 ContentStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected KnowledgeBaseStatus to be of type string, got %T instead", value) } - sv.Status = types.ContentStatus(jtv) + sv.Status = types.KnowledgeBaseStatus(jtv) } case "tags": @@ -5685,13 +8344,53 @@ func awsRestjson1_deserializeDocumentContentSummary(v **types.ContentSummary, va return err } - case "title": + 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 ContentTitle to be of type string, got %T instead", value) + return fmt.Errorf("expected NotifyRecommendationsReceivedErrorMessage to be of type string, got %T instead", value) } - sv.Title = ptr.String(jtv) + 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: @@ -5703,7 +8402,7 @@ func awsRestjson1_deserializeDocumentContentSummary(v **types.ContentSummary, va return nil } -func awsRestjson1_deserializeDocumentContentSummaryList(v *[]types.ContentSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(v *[]types.NotifyRecommendationsReceivedError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5716,17 +8415,17 @@ func awsRestjson1_deserializeDocumentContentSummaryList(v *[]types.ContentSummar return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ContentSummary + var cv []types.NotifyRecommendationsReceivedError if *v == nil { - cv = []types.ContentSummary{} + cv = []types.NotifyRecommendationsReceivedError{} } else { cv = *v } for _, value := range shape { - var col types.ContentSummary + var col types.NotifyRecommendationsReceivedError destAddr := &col - if err := awsRestjson1_deserializeDocumentContentSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedError(&destAddr, value); err != nil { return err } col = *destAddr @@ -5737,7 +8436,7 @@ func awsRestjson1_deserializeDocumentContentSummaryList(v *[]types.ContentSummar return nil } -func awsRestjson1_deserializeDocumentDocument(v **types.Document, value interface{}) error { +func awsRestjson1_deserializeDocumentObjectFieldsList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5745,45 +8444,35 @@ func awsRestjson1_deserializeDocumentDocument(v **types.Document, value interfac return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Document + var cv []string if *v == nil { - sv = &types.Document{} + cv = []string{} } else { - sv = *v + cv = *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 + 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) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentDocumentText(v **types.DocumentText, value interface{}) error { +func awsRestjson1_deserializeDocumentPreconditionFailedException(v **types.PreconditionFailedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5796,27 +8485,22 @@ func awsRestjson1_deserializeDocumentDocumentText(v **types.DocumentText, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DocumentText + var sv *types.PreconditionFailedException if *v == nil { - sv = &types.DocumentText{} + sv = &types.PreconditionFailedException{} } 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": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -5828,7 +8512,7 @@ func awsRestjson1_deserializeDocumentDocumentText(v **types.DocumentText, value return nil } -func awsRestjson1_deserializeDocumentHeaders(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentQueryRecommendationTriggerData(v **types.QueryRecommendationTriggerData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5841,30 +8525,34 @@ func awsRestjson1_deserializeDocumentHeaders(v *map[string]string, value interfa return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var sv *types.QueryRecommendationTriggerData if *v == nil { - mv = map[string]string{} + sv = &types.QueryRecommendationTriggerData{} } else { - mv = *v + sv = *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) + switch key { + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryText to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) } - parsedVal = jtv - } - mv[key] = parsedVal + default: + _, _ = key, value + + } } - *v = mv + *v = sv return nil } -func awsRestjson1_deserializeDocumentHighlight(v **types.Highlight, value interface{}) error { +func awsRestjson1_deserializeDocumentQueryResultsList(v *[]types.ResultData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5872,56 +8560,33 @@ func awsRestjson1_deserializeDocumentHighlight(v **types.Highlight, value interf return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Highlight + var cv []types.ResultData if *v == nil { - sv = &types.Highlight{} + cv = []types.ResultData{} } else { - sv = *v + cv = *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 - + 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 = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentHighlights(v *[]types.Highlight, value interface{}) error { +func awsRestjson1_deserializeDocumentQuickResponseContentProvider(v *types.QuickResponseContentProvider, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5929,33 +8594,41 @@ func awsRestjson1_deserializeDocumentHighlights(v *[]types.Highlight, value inte return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Highlight - if *v == nil { - cv = []types.Highlight{} - } else { - cv = *v - } + var uv types.QuickResponseContentProvider +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "content": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickResponseContent to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.QuickResponseContentProviderMemberContent{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop - 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 + *v = uv return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseAssociationData(v **types.KnowledgeBaseAssociationData, value interface{}) error { +func awsRestjson1_deserializeDocumentQuickResponseContents(v **types.QuickResponseContents, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5968,31 +8641,23 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseAssociationData(v **types.Know return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KnowledgeBaseAssociationData + var sv *types.QuickResponseContents if *v == nil { - sv = &types.KnowledgeBaseAssociationData{} + sv = &types.QuickResponseContents{} } 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 "markdown": + if err := awsRestjson1_deserializeDocumentQuickResponseContentProvider(&sv.Markdown, value); err != nil { + return err } - 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 "plainText": + if err := awsRestjson1_deserializeDocumentQuickResponseContentProvider(&sv.PlainText, value); err != nil { + return err } default: @@ -6004,7 +8669,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseAssociationData(v **types.Know return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseData, value interface{}) error { +func awsRestjson1_deserializeDocumentQuickResponseData(v **types.QuickResponseData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6017,24 +8682,73 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseDa return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KnowledgeBaseData + var sv *types.QuickResponseData if *v == nil { - sv = &types.KnowledgeBaseData{} + sv = &types.QuickResponseData{} } else { sv = *v } for key, value := range shape { switch key { + case "channels": + if err := awsRestjson1_deserializeDocumentChannels(&sv.Channels, value); err != nil { + return err + } + + case "contents": + if err := awsRestjson1_deserializeDocumentQuickResponseContents(&sv.Contents, value); err != nil { + return err + } + + case "contentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickResponseType to be of type string, got %T instead", value) + } + sv.ContentType = ptr.String(jtv) + } + + case "createdTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = 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) + return fmt.Errorf("expected QuickResponseDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } + case "groupingConfiguration": + if err := awsRestjson1_deserializeDocumentGroupingConfiguration(&sv.GroupingConfiguration, value); err != nil { + return err + } + + case "isActive": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsActive = ptr.Bool(jtv) + } + case "knowledgeBaseArn": if value != nil { jtv, ok := value.(string) @@ -6053,16 +8767,25 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseDa sv.KnowledgeBaseId = ptr.String(jtv) } - case "knowledgeBaseType": + case "language": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseType to be of type string, got %T instead", value) + return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) } - sv.KnowledgeBaseType = types.KnowledgeBaseType(jtv) + sv.Language = ptr.String(jtv) } - case "lastContentModificationTime": + case "lastModifiedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) + } + sv.LastModifiedBy = ptr.String(jtv) + } + + case "lastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: @@ -6070,7 +8793,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseDa if err != nil { return err } - sv.LastContentModificationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -6082,33 +8805,45 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseDa 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 QuickResponseName 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 "quickResponseArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.QuickResponseArn = ptr.String(jtv) } - case "serverSideEncryptionConfiguration": - if err := awsRestjson1_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { - return err + case "quickResponseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.QuickResponseId = ptr.String(jtv) } - case "sourceConfiguration": - if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { - return err + case "shortcutKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShortCutKey to be of type string, got %T instead", value) + } + sv.ShortcutKey = ptr.String(jtv) } 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) + return fmt.Errorf("expected QuickResponseStatus to be of type string, got %T instead", value) } - sv.Status = types.KnowledgeBaseStatus(jtv) + sv.Status = types.QuickResponseStatus(jtv) } case "tags": @@ -6125,7 +8860,7 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseData(v **types.KnowledgeBaseDa return nil } -func awsRestjson1_deserializeDocumentKnowledgeBaseList(v *[]types.KnowledgeBaseSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentQuickResponseSearchResultData(v **types.QuickResponseSearchResultData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6133,63 +8868,88 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseList(v *[]types.KnowledgeBaseS return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.KnowledgeBaseSummary + var sv *types.QuickResponseSearchResultData if *v == nil { - cv = []types.KnowledgeBaseSummary{} + sv = &types.QuickResponseSearchResultData{} } else { - cv = *v + sv = *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) + for key, value := range shape { + switch key { + case "attributesInterpolated": + if err := awsRestjson1_deserializeDocumentContactAttributeKeys(&sv.AttributesInterpolated, value); err != nil { + return err + } - } - *v = cv - return nil -} + case "attributesNotInterpolated": + if err := awsRestjson1_deserializeDocumentContactAttributeKeys(&sv.AttributesNotInterpolated, value); err != nil { + return err + } -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 - } + case "channels": + if err := awsRestjson1_deserializeDocumentChannels(&sv.Channels, value); err != nil { + return err + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "contents": + if err := awsRestjson1_deserializeDocumentQuickResponseContents(&sv.Contents, value); err != nil { + return err + } - var sv *types.KnowledgeBaseSummary - if *v == nil { - sv = &types.KnowledgeBaseSummary{} - } else { - sv = *v - } + case "contentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickResponseType to be of type string, got %T instead", value) + } + sv.ContentType = ptr.String(jtv) + } + + case "createdTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } - 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) + return fmt.Errorf("expected QuickResponseDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } + case "groupingConfiguration": + if err := awsRestjson1_deserializeDocumentGroupingConfiguration(&sv.GroupingConfiguration, value); err != nil { + return err + } + + case "isActive": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsActive = ptr.Bool(jtv) + } + case "knowledgeBaseArn": if value != nil { jtv, ok := value.(string) @@ -6208,100 +8968,88 @@ func awsRestjson1_deserializeDocumentKnowledgeBaseSummary(v **types.KnowledgeBas sv.KnowledgeBaseId = ptr.String(jtv) } - case "knowledgeBaseType": + case "language": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KnowledgeBaseType to be of type string, got %T instead", value) + return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) } - sv.KnowledgeBaseType = types.KnowledgeBaseType(jtv) + sv.Language = ptr.String(jtv) } - case "name": + case "lastModifiedBy": 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 GenericArn 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 + sv.LastModifiedBy = ptr.String(jtv) } - case "sourceConfiguration": - if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { - return err - } - - case "status": + case "lastModifiedTime": 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 -} + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) -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 - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - 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 - } + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickResponseName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "message": + case "quickResponseArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NotifyRecommendationsReceivedErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.QuickResponseArn = ptr.String(jtv) } - case "recommendationId": + case "quickResponseId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) } - sv.RecommendationId = ptr.String(jtv) + sv.QuickResponseId = ptr.String(jtv) + } + + case "shortcutKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShortCutKey to be of type string, got %T instead", value) + } + sv.ShortcutKey = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickResponseStatus to be of type string, got %T instead", value) + } + sv.Status = types.QuickResponseStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err } default: @@ -6313,7 +9061,7 @@ func awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedError(v **type return nil } -func awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(v *[]types.NotifyRecommendationsReceivedError, value interface{}) error { +func awsRestjson1_deserializeDocumentQuickResponseSearchResultsList(v *[]types.QuickResponseSearchResultData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6326,17 +9074,17 @@ func awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(v *[ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.NotifyRecommendationsReceivedError + var cv []types.QuickResponseSearchResultData if *v == nil { - cv = []types.NotifyRecommendationsReceivedError{} + cv = []types.QuickResponseSearchResultData{} } else { cv = *v } for _, value := range shape { - var col types.NotifyRecommendationsReceivedError + var col types.QuickResponseSearchResultData destAddr := &col - if err := awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedError(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentQuickResponseSearchResultData(&destAddr, value); err != nil { return err } col = *destAddr @@ -6347,7 +9095,7 @@ func awsRestjson1_deserializeDocumentNotifyRecommendationsReceivedErrorList(v *[ return nil } -func awsRestjson1_deserializeDocumentObjectFieldsList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentQuickResponseSummary(v **types.QuickResponseSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6355,103 +9103,150 @@ func awsRestjson1_deserializeDocumentObjectFieldsList(v *[]string, value interfa return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.QuickResponseSummary if *v == nil { - cv = []string{} + sv = &types.QuickResponseSummary{} } else { - cv = *v + sv = *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) + for key, value := range shape { + switch key { + case "channels": + if err := awsRestjson1_deserializeDocumentChannels(&sv.Channels, value); err != nil { + return err } - col = jtv - } - cv = append(cv, col) - } - *v = cv - return nil -} + case "contentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickResponseType to be of type string, got %T instead", value) + } + sv.ContentType = ptr.String(jtv) + } -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 - } + case "createdTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - var sv *types.PreconditionFailedException - if *v == nil { - sv = &types.PreconditionFailedException{} - } else { - sv = *v - } + } + } - for key, value := range shape { - switch key { - case "message": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected QuickResponseDescription to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - default: - _, _ = key, value + case "isActive": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsActive = ptr.Bool(jtv) + } - } - } - *v = sv - return nil -} + 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) + } -func awsRestjson1_deserializeDocumentQueryRecommendationTriggerData(v **types.QueryRecommendationTriggerData, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + 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) + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "lastModifiedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) + } + sv.LastModifiedBy = ptr.String(jtv) + } - var sv *types.QueryRecommendationTriggerData - if *v == nil { - sv = &types.QueryRecommendationTriggerData{} - } else { - sv = *v - } + case "lastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - for key, value := range shape { - switch key { - case "text": + 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 QueryText to be of type string, got %T instead", value) + return fmt.Errorf("expected QuickResponseName to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.Name = ptr.String(jtv) + } + + case "quickResponseArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.QuickResponseArn = ptr.String(jtv) + } + + case "quickResponseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.QuickResponseId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickResponseStatus to be of type string, got %T instead", value) + } + sv.Status = types.QuickResponseStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err } default: @@ -6463,7 +9258,7 @@ func awsRestjson1_deserializeDocumentQueryRecommendationTriggerData(v **types.Qu return nil } -func awsRestjson1_deserializeDocumentQueryResultsList(v *[]types.ResultData, value interface{}) error { +func awsRestjson1_deserializeDocumentQuickResponseSummaryList(v *[]types.QuickResponseSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6476,17 +9271,17 @@ func awsRestjson1_deserializeDocumentQueryResultsList(v *[]types.ResultData, val return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ResultData + var cv []types.QuickResponseSummary if *v == nil { - cv = []types.ResultData{} + cv = []types.QuickResponseSummary{} } else { cv = *v } for _, value := range shape { - var col types.ResultData + var col types.QuickResponseSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentResultData(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentQuickResponseSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -6846,6 +9641,46 @@ func awsRestjson1_deserializeDocumentRenderingConfiguration(v **types.RenderingC return nil } +func awsRestjson1_deserializeDocumentRequestTimeoutException(v **types.RequestTimeoutException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RequestTimeoutException + if *v == nil { + sv = &types.RequestTimeoutException{} + } 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) diff --git a/service/wisdom/generated.json b/service/wisdom/generated.json index a06d455103e..9d99ddd9308 100644 --- a/service/wisdom/generated.json +++ b/service/wisdom/generated.json @@ -13,33 +13,43 @@ "api_op_CreateAssistantAssociation.go", "api_op_CreateContent.go", "api_op_CreateKnowledgeBase.go", + "api_op_CreateQuickResponse.go", "api_op_CreateSession.go", "api_op_DeleteAssistant.go", "api_op_DeleteAssistantAssociation.go", "api_op_DeleteContent.go", + "api_op_DeleteImportJob.go", "api_op_DeleteKnowledgeBase.go", + "api_op_DeleteQuickResponse.go", "api_op_GetAssistant.go", "api_op_GetAssistantAssociation.go", "api_op_GetContent.go", "api_op_GetContentSummary.go", + "api_op_GetImportJob.go", "api_op_GetKnowledgeBase.go", + "api_op_GetQuickResponse.go", "api_op_GetRecommendations.go", "api_op_GetSession.go", "api_op_ListAssistantAssociations.go", "api_op_ListAssistants.go", "api_op_ListContents.go", + "api_op_ListImportJobs.go", "api_op_ListKnowledgeBases.go", + "api_op_ListQuickResponses.go", "api_op_ListTagsForResource.go", "api_op_NotifyRecommendationsReceived.go", "api_op_QueryAssistant.go", "api_op_RemoveKnowledgeBaseTemplateUri.go", "api_op_SearchContent.go", + "api_op_SearchQuickResponses.go", "api_op_SearchSessions.go", "api_op_StartContentUpload.go", + "api_op_StartImportJob.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateContent.go", "api_op_UpdateKnowledgeBaseTemplateUri.go", + "api_op_UpdateQuickResponse.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/wisdom/serializers.go b/service/wisdom/serializers.go index 1e812ddb5d9..73ed2307097 100644 --- a/service/wisdom/serializers.go +++ b/service/wisdom/serializers.go @@ -465,6 +465,152 @@ func awsRestjson1_serializeOpDocumentCreateKnowledgeBaseInput(v *CreateKnowledge return nil } +type awsRestjson1_serializeOpCreateQuickResponse struct { +} + +func (*awsRestjson1_serializeOpCreateQuickResponse) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateQuickResponse) 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.(*CreateQuickResponseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateQuickResponseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateQuickResponseInput(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_serializeOpHttpBindingsCreateQuickResponseInput(v *CreateQuickResponseInput, 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_serializeOpDocumentCreateQuickResponseInput(v *CreateQuickResponseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Channels != nil { + ok := object.Key("channels") + if err := awsRestjson1_serializeDocumentChannels(v.Channels, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentQuickResponseDataProvider(v.Content, ok); err != nil { + return err + } + } + + if v.ContentType != nil { + ok := object.Key("contentType") + ok.String(*v.ContentType) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.GroupingConfiguration != nil { + ok := object.Key("groupingConfiguration") + if err := awsRestjson1_serializeDocumentGroupingConfiguration(v.GroupingConfiguration, ok); err != nil { + return err + } + } + + if v.IsActive != nil { + ok := object.Key("isActive") + ok.Boolean(*v.IsActive) + } + + if v.Language != nil { + ok := object.Key("language") + ok.String(*v.Language) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.ShortcutKey != nil { + ok := object.Key("shortcutKey") + ok.String(*v.ShortcutKey) + } + + 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 { } @@ -783,6 +929,80 @@ func awsRestjson1_serializeOpHttpBindingsDeleteContentInput(v *DeleteContentInpu return nil } +type awsRestjson1_serializeOpDeleteImportJob struct { +} + +func (*awsRestjson1_serializeOpDeleteImportJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteImportJob) 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.(*DeleteImportJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteImportJobInput(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_serializeOpHttpBindingsDeleteImportJobInput(v *DeleteImportJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ImportJobId == nil || len(*v.ImportJobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member importJobId must not be empty")} + } + if v.ImportJobId != nil { + if err := encoder.SetURI("importJobId").String(*v.ImportJobId); 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 { } @@ -848,6 +1068,80 @@ func awsRestjson1_serializeOpHttpBindingsDeleteKnowledgeBaseInput(v *DeleteKnowl return nil } +type awsRestjson1_serializeOpDeleteQuickResponse struct { +} + +func (*awsRestjson1_serializeOpDeleteQuickResponse) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteQuickResponse) 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.(*DeleteQuickResponseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteQuickResponseInput(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_serializeOpHttpBindingsDeleteQuickResponseInput(v *DeleteQuickResponseInput, 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.QuickResponseId == nil || len(*v.QuickResponseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member quickResponseId must not be empty")} + } + if v.QuickResponseId != nil { + if err := encoder.SetURI("quickResponseId").String(*v.QuickResponseId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetAssistant struct { } @@ -1135,14 +1429,14 @@ func awsRestjson1_serializeOpHttpBindingsGetContentSummaryInput(v *GetContentSum return nil } -type awsRestjson1_serializeOpGetKnowledgeBase struct { +type awsRestjson1_serializeOpGetImportJob struct { } -func (*awsRestjson1_serializeOpGetKnowledgeBase) ID() string { +func (*awsRestjson1_serializeOpGetImportJob) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1150,13 +1444,13 @@ func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetKnowledgeBaseInput) + input, ok := in.Parameters.(*GetImportJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1172,7 +1466,7 @@ func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetImportJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1183,16 +1477,164 @@ func (m *awsRestjson1_serializeOpGetKnowledgeBase) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetKnowledgeBaseInput(v *GetKnowledgeBaseInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetImportJobInput(v *GetImportJobInput, 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.ImportJobId == nil || len(*v.ImportJobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member importJobId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + if v.ImportJobId != nil { + if err := encoder.SetURI("importJobId").String(*v.ImportJobId); 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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_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_serializeOpGetQuickResponse struct { +} + +func (*awsRestjson1_serializeOpGetQuickResponse) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetQuickResponse) 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.(*GetQuickResponseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetQuickResponseInput(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_serializeOpHttpBindingsGetQuickResponseInput(v *GetQuickResponseInput, 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.QuickResponseId == nil || len(*v.QuickResponseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member quickResponseId must not be empty")} + } + if v.QuickResponseId != nil { + if err := encoder.SetURI("quickResponseId").String(*v.QuickResponseId); err != nil { return err } } @@ -1566,14 +2008,14 @@ func awsRestjson1_serializeOpHttpBindingsListContentsInput(v *ListContentsInput, return nil } -type awsRestjson1_serializeOpListKnowledgeBases struct { +type awsRestjson1_serializeOpListImportJobs struct { } -func (*awsRestjson1_serializeOpListKnowledgeBases) ID() string { +func (*awsRestjson1_serializeOpListImportJobs) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListImportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1581,13 +2023,13 @@ func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListKnowledgeBasesInput) + input, ok := in.Parameters.(*ListImportJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/knowledgeBases") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1603,7 +2045,7 @@ func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListImportJobsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1614,11 +2056,20 @@ func (m *awsRestjson1_serializeOpListKnowledgeBases) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledgeBasesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListImportJobsInput(v *ListImportJobsInput, 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) } @@ -1630,14 +2081,14 @@ func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledg return nil } -type awsRestjson1_serializeOpListTagsForResource struct { +type awsRestjson1_serializeOpListKnowledgeBases struct { } -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { +func (*awsRestjson1_serializeOpListKnowledgeBases) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -1645,13 +2096,13 @@ 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.(*ListKnowledgeBasesInput) _ = 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("/knowledgeBases") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -1667,7 +2118,7 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1678,31 +2129,30 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListKnowledgeBasesInput(v *ListKnowledgeBasesInput, 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.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpNotifyRecommendationsReceived struct { +type awsRestjson1_serializeOpListQuickResponses struct { } -func (*awsRestjson1_serializeOpNotifyRecommendationsReceived) ID() string { +func (*awsRestjson1_serializeOpListQuickResponses) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListQuickResponses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1710,16 +2160,16 @@ func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*NotifyRecommendationsReceivedInput) + input, ok := in.Parameters.(*ListQuickResponsesInput) _ = 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") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1732,18 +2182,7 @@ func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize( 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 { + if err := awsRestjson1_serializeOpHttpBindingsListQuickResponsesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1754,54 +2193,39 @@ func (m *awsRestjson1_serializeOpNotifyRecommendationsReceived) HandleSerialize( return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsNotifyRecommendationsReceivedInput(v *NotifyRecommendationsReceivedInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListQuickResponsesInput(v *ListQuickResponsesInput, 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.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} } - if v.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); 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 - } + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - 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 - } + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } -type awsRestjson1_serializeOpQueryAssistant struct { +type awsRestjson1_serializeOpListTagsForResource struct { } -func (*awsRestjson1_serializeOpQueryAssistant) ID() string { +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -1809,16 +2233,16 @@ func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*QueryAssistantInput) + 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("/assistants/{assistantId}/query") + 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" + request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -1831,18 +2255,7 @@ func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Con 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 { + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1853,7 +2266,182 @@ func (m *awsRestjson1_serializeOpQueryAssistant) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsQueryAssistantInput(v *QueryAssistantInput, encoder *httpbinding.Encoder) error { +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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_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) } @@ -2055,14 +2643,14 @@ func awsRestjson1_serializeOpDocumentSearchContentInput(v *SearchContentInput, v return nil } -type awsRestjson1_serializeOpSearchSessions struct { +type awsRestjson1_serializeOpSearchQuickResponses struct { } -func (*awsRestjson1_serializeOpSearchSessions) ID() string { +func (*awsRestjson1_serializeOpSearchQuickResponses) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpSearchQuickResponses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2070,13 +2658,13 @@ func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*SearchSessionsInput) + input, ok := in.Parameters.(*SearchQuickResponsesInput) _ = 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") + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/search/quickResponses") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2092,14 +2680,14 @@ func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsSearchQuickResponsesInput(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 { + if err := awsRestjson1_serializeOpDocumentSearchQuickResponsesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2114,16 +2702,16 @@ func (m *awsRestjson1_serializeOpSearchSessions) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(v *SearchSessionsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSearchQuickResponsesInput(v *SearchQuickResponsesInput, 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.KnowledgeBaseId == nil || len(*v.KnowledgeBaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member knowledgeBaseId must not be empty")} } - if v.AssistantId != nil { - if err := encoder.SetURI("assistantId").String(*v.AssistantId); err != nil { + if v.KnowledgeBaseId != nil { + if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { return err } } @@ -2139,13 +2727,20 @@ func awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(v *SearchSessionsIn return nil } -func awsRestjson1_serializeOpDocumentSearchSessionsInput(v *SearchSessionsInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentSearchQuickResponsesInput(v *SearchQuickResponsesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.Attributes != nil { + ok := object.Key("attributes") + if err := awsRestjson1_serializeDocumentContactAttributes(v.Attributes, ok); err != nil { + return err + } + } + if v.SearchExpression != nil { ok := object.Key("searchExpression") - if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { + if err := awsRestjson1_serializeDocumentQuickResponseSearchExpression(v.SearchExpression, ok); err != nil { return err } } @@ -2153,14 +2748,14 @@ func awsRestjson1_serializeOpDocumentSearchSessionsInput(v *SearchSessionsInput, return nil } -type awsRestjson1_serializeOpStartContentUpload struct { +type awsRestjson1_serializeOpSearchSessions struct { } -func (*awsRestjson1_serializeOpStartContentUpload) ID() string { +func (*awsRestjson1_serializeOpSearchSessions) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -2168,13 +2763,13 @@ func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartContentUploadInput) + 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("/knowledgeBases/{knowledgeBaseId}/upload") + 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" @@ -2190,14 +2785,14 @@ func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(input, restEncoder); err != nil { + 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_serializeOpDocumentStartContentUploadInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentSearchSessionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2212,43 +2807,53 @@ func (m *awsRestjson1_serializeOpStartContentUpload) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(v *StartContentUploadInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsSearchSessionsInput(v *SearchSessionsInput, 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.AssistantId == nil || len(*v.AssistantId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assistantId must not be empty")} } - if v.KnowledgeBaseId != nil { - if err := encoder.SetURI("knowledgeBaseId").String(*v.KnowledgeBaseId); err != nil { + 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_serializeOpDocumentStartContentUploadInput(v *StartContentUploadInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentSearchSessionsInput(v *SearchSessionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ContentType != nil { - ok := object.Key("contentType") - ok.String(*v.ContentType) + if v.SearchExpression != nil { + ok := object.Key("searchExpression") + if err := awsRestjson1_serializeDocumentSearchExpression(v.SearchExpression, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpTagResource struct { +type awsRestjson1_serializeOpStartContentUpload struct { } -func (*awsRestjson1_serializeOpTagResource) ID() string { +func (*awsRestjson1_serializeOpStartContentUpload) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +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) @@ -2256,13 +2861,13 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*TagResourceInput) + 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("/tags/{resourceArn}") + 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" @@ -2278,14 +2883,14 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + 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_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentStartContentUploadInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2300,12 +2905,217 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsStartContentUploadInput(v *StartContentUploadInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + 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) + } + + if v.PresignedUrlTimeToLive != nil { + ok := object.Key("presignedUrlTimeToLive") + ok.Integer(*v.PresignedUrlTimeToLive) + } + + return nil +} + +type awsRestjson1_serializeOpStartImportJob struct { +} + +func (*awsRestjson1_serializeOpStartImportJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartImportJob) 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.(*StartImportJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/importJobs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartImportJobInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartImportJobInput(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_serializeOpHttpBindingsStartImportJobInput(v *StartImportJobInput, 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_serializeOpDocumentStartImportJobInput(v *StartImportJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.ExternalSourceConfiguration != nil { + ok := object.Key("externalSourceConfiguration") + if err := awsRestjson1_serializeDocumentExternalSourceConfiguration(v.ExternalSourceConfiguration, ok); err != nil { + return err + } + } + + if len(v.ImportJobType) > 0 { + ok := object.Key("importJobType") + ok.String(string(v.ImportJobType)) + } + + if v.Metadata != nil { + ok := object.Key("metadata") + if err := awsRestjson1_serializeDocumentContentMetadata(v.Metadata, ok); err != nil { + return err + } + } + + if v.UploadId != nil { + ok := object.Key("uploadId") + ok.String(*v.UploadId) + } + + 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" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + 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 { @@ -2614,51 +3424,280 @@ func awsRestjson1_serializeOpDocumentUpdateKnowledgeBaseTemplateUriInput(v *Upda return nil } -func awsRestjson1_serializeDocumentAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() +type awsRestjson1_serializeOpUpdateQuickResponse struct { +} - if v.AppIntegrationArn != nil { - ok := object.Key("appIntegrationArn") - ok.String(*v.AppIntegrationArn) +func (*awsRestjson1_serializeOpUpdateQuickResponse) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateQuickResponse) 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.ObjectFields != nil { - ok := object.Key("objectFields") - if err := awsRestjson1_serializeDocumentObjectFieldsList(v.ObjectFields, ok); err != nil { - return err - } + input, ok := in.Parameters.(*UpdateQuickResponseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - return nil -} + opPath, opQuery := httpbinding.SplitURI("/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } -func awsRestjson1_serializeDocumentAssistantAssociationInputData(v types.AssistantAssociationInputData, value smithyjson.Value) error { - object := value.Object() - defer object.Close() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } - switch uv := v.(type) { - case *types.AssistantAssociationInputDataMemberKnowledgeBaseId: - av := object.Key("knowledgeBaseId") - av.String(uv.Value) + if err := awsRestjson1_serializeOpHttpBindingsUpdateQuickResponseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + restEncoder.SetHeader("Content-Type").String("application/json") + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateQuickResponseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} } - return nil -} -func awsRestjson1_serializeDocumentContentMetadata(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } - for key := range v { - om := object.Key(key) - om.String(v[key]) + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} } - return nil -} + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateQuickResponseInput(v *UpdateQuickResponseInput, 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.QuickResponseId == nil || len(*v.QuickResponseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member quickResponseId must not be empty")} + } + if v.QuickResponseId != nil { + if err := encoder.SetURI("quickResponseId").String(*v.QuickResponseId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateQuickResponseInput(v *UpdateQuickResponseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Channels != nil { + ok := object.Key("channels") + if err := awsRestjson1_serializeDocumentChannels(v.Channels, ok); err != nil { + return err + } + } + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentQuickResponseDataProvider(v.Content, ok); err != nil { + return err + } + } + + if v.ContentType != nil { + ok := object.Key("contentType") + ok.String(*v.ContentType) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.GroupingConfiguration != nil { + ok := object.Key("groupingConfiguration") + if err := awsRestjson1_serializeDocumentGroupingConfiguration(v.GroupingConfiguration, ok); err != nil { + return err + } + } + + if v.IsActive != nil { + ok := object.Key("isActive") + ok.Boolean(*v.IsActive) + } + + if v.Language != nil { + ok := object.Key("language") + ok.String(*v.Language) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RemoveDescription != nil { + ok := object.Key("removeDescription") + ok.Boolean(*v.RemoveDescription) + } + + if v.RemoveGroupingConfiguration != nil { + ok := object.Key("removeGroupingConfiguration") + ok.Boolean(*v.RemoveGroupingConfiguration) + } + + if v.RemoveShortcutKey != nil { + ok := object.Key("removeShortcutKey") + ok.Boolean(*v.RemoveShortcutKey) + } + + if v.ShortcutKey != nil { + ok := object.Key("shortcutKey") + ok.String(*v.ShortcutKey) + } + + 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_serializeDocumentChannels(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_serializeDocumentConfiguration(v types.Configuration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ConfigurationMemberConnectConfiguration: + av := object.Key("connectConfiguration") + if err := awsRestjson1_serializeDocumentConnectConfiguration(&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_serializeDocumentConnectConfiguration(v *types.ConnectConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InstanceId != nil { + ok := object.Key("instanceId") + ok.String(*v.InstanceId) + } + + return nil +} + +func awsRestjson1_serializeDocumentContactAttributes(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_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_serializeDocumentExternalSourceConfiguration(v *types.ExternalSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Configuration != nil { + ok := object.Key("configuration") + if err := awsRestjson1_serializeDocumentConfiguration(v.Configuration, ok); err != nil { + return err + } + } + + if len(v.Source) > 0 { + ok := object.Key("source") + ok.String(string(v.Source)) + } + + return nil +} func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { object := value.Object() @@ -2695,6 +3734,36 @@ func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson return nil } +func awsRestjson1_serializeDocumentGroupingConfiguration(v *types.GroupingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Criteria != nil { + ok := object.Key("criteria") + ok.String(*v.Criteria) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentGroupingValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentGroupingValues(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_serializeDocumentObjectFieldsList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2706,6 +3775,178 @@ func awsRestjson1_serializeDocumentObjectFieldsList(v []string, value smithyjson return nil } +func awsRestjson1_serializeDocumentQuickResponseDataProvider(v types.QuickResponseDataProvider, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.QuickResponseDataProviderMemberContent: + av := object.Key("content") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentQuickResponseFilterField(v *types.QuickResponseFilterField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IncludeNoExistence != nil { + ok := object.Key("includeNoExistence") + ok.Boolean(*v.IncludeNoExistence) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.Operator) > 0 { + ok := object.Key("operator") + ok.String(string(v.Operator)) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentQuickResponseFilterValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentQuickResponseFilterFieldList(v []types.QuickResponseFilterField, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentQuickResponseFilterField(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentQuickResponseFilterValueList(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_serializeDocumentQuickResponseOrderField(v *types.QuickResponseOrderField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.Order) > 0 { + ok := object.Key("order") + ok.String(string(v.Order)) + } + + return nil +} + +func awsRestjson1_serializeDocumentQuickResponseQueryField(v *types.QuickResponseQueryField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AllowFuzziness != nil { + ok := object.Key("allowFuzziness") + ok.Boolean(*v.AllowFuzziness) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.Operator) > 0 { + ok := object.Key("operator") + ok.String(string(v.Operator)) + } + + if len(v.Priority) > 0 { + ok := object.Key("priority") + ok.String(string(v.Priority)) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentQuickResponseQueryValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentQuickResponseQueryFieldList(v []types.QuickResponseQueryField, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentQuickResponseQueryField(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentQuickResponseQueryValueList(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_serializeDocumentQuickResponseSearchExpression(v *types.QuickResponseSearchExpression, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentQuickResponseFilterFieldList(v.Filters, ok); err != nil { + return err + } + } + + if v.OrderOnField != nil { + ok := object.Key("orderOnField") + if err := awsRestjson1_serializeDocumentQuickResponseOrderField(v.OrderOnField, ok); err != nil { + return err + } + } + + if v.Queries != nil { + ok := object.Key("queries") + if err := awsRestjson1_serializeDocumentQuickResponseQueryFieldList(v.Queries, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentRecommendationIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/wisdom/types/enums.go b/service/wisdom/types/enums.go index 30af06a6bae..02f507cdb60 100644 --- a/service/wisdom/types/enums.go +++ b/service/wisdom/types/enums.go @@ -88,6 +88,22 @@ func (ContentStatus) Values() []ContentStatus { } } +type ExternalSource string + +// Enum values for ExternalSource +const ( + ExternalSourceAmazonConnect ExternalSource = "AMAZON_CONNECT" +) + +// Values returns all known values for ExternalSource. 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 (ExternalSource) Values() []ExternalSource { + return []ExternalSource{ + "AMAZON_CONNECT", + } +} + type FilterField string // Enum values for FilterField @@ -120,6 +136,48 @@ func (FilterOperator) Values() []FilterOperator { } } +type ImportJobStatus string + +// Enum values for ImportJobStatus +const ( + ImportJobStatusStartInProgress ImportJobStatus = "START_IN_PROGRESS" + ImportJobStatusFailed ImportJobStatus = "FAILED" + ImportJobStatusComplete ImportJobStatus = "COMPLETE" + ImportJobStatusDeleteInProgress ImportJobStatus = "DELETE_IN_PROGRESS" + ImportJobStatusDeleteFailed ImportJobStatus = "DELETE_FAILED" + ImportJobStatusDeleted ImportJobStatus = "DELETED" +) + +// Values returns all known values for ImportJobStatus. 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 (ImportJobStatus) Values() []ImportJobStatus { + return []ImportJobStatus{ + "START_IN_PROGRESS", + "FAILED", + "COMPLETE", + "DELETE_IN_PROGRESS", + "DELETE_FAILED", + "DELETED", + } +} + +type ImportJobType string + +// Enum values for ImportJobType +const ( + ImportJobTypeQuickResponses ImportJobType = "QUICK_RESPONSES" +) + +// Values returns all known values for ImportJobType. 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 (ImportJobType) Values() []ImportJobType { + return []ImportJobType{ + "QUICK_RESPONSES", + } +} + type KnowledgeBaseStatus string // Enum values for KnowledgeBaseStatus @@ -150,8 +208,9 @@ type KnowledgeBaseType string // Enum values for KnowledgeBaseType const ( - KnowledgeBaseTypeExternal KnowledgeBaseType = "EXTERNAL" - KnowledgeBaseTypeCustom KnowledgeBaseType = "CUSTOM" + KnowledgeBaseTypeExternal KnowledgeBaseType = "EXTERNAL" + KnowledgeBaseTypeCustom KnowledgeBaseType = "CUSTOM" + KnowledgeBaseTypeQuickResponses KnowledgeBaseType = "QUICK_RESPONSES" ) // Values returns all known values for KnowledgeBaseType. Note that this can be @@ -161,6 +220,111 @@ func (KnowledgeBaseType) Values() []KnowledgeBaseType { return []KnowledgeBaseType{ "EXTERNAL", "CUSTOM", + "QUICK_RESPONSES", + } +} + +type Order string + +// Enum values for Order +const ( + OrderAsc Order = "ASC" + OrderDesc Order = "DESC" +) + +// Values returns all known values for Order. 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 (Order) Values() []Order { + return []Order{ + "ASC", + "DESC", + } +} + +type Priority string + +// Enum values for Priority +const ( + PriorityHigh Priority = "HIGH" + PriorityMedium Priority = "MEDIUM" + PriorityLow Priority = "LOW" +) + +// Values returns all known values for Priority. 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 (Priority) Values() []Priority { + return []Priority{ + "HIGH", + "MEDIUM", + "LOW", + } +} + +type QuickResponseFilterOperator string + +// Enum values for QuickResponseFilterOperator +const ( + QuickResponseFilterOperatorEquals QuickResponseFilterOperator = "EQUALS" + QuickResponseFilterOperatorPrefix QuickResponseFilterOperator = "PREFIX" +) + +// Values returns all known values for QuickResponseFilterOperator. 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 (QuickResponseFilterOperator) Values() []QuickResponseFilterOperator { + return []QuickResponseFilterOperator{ + "EQUALS", + "PREFIX", + } +} + +type QuickResponseQueryOperator string + +// Enum values for QuickResponseQueryOperator +const ( + QuickResponseQueryOperatorContains QuickResponseQueryOperator = "CONTAINS" + QuickResponseQueryOperatorContainsAndPrefix QuickResponseQueryOperator = "CONTAINS_AND_PREFIX" +) + +// Values returns all known values for QuickResponseQueryOperator. 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 (QuickResponseQueryOperator) Values() []QuickResponseQueryOperator { + return []QuickResponseQueryOperator{ + "CONTAINS", + "CONTAINS_AND_PREFIX", + } +} + +type QuickResponseStatus string + +// Enum values for QuickResponseStatus +const ( + QuickResponseStatusCreateInProgress QuickResponseStatus = "CREATE_IN_PROGRESS" + QuickResponseStatusCreateFailed QuickResponseStatus = "CREATE_FAILED" + QuickResponseStatusCreated QuickResponseStatus = "CREATED" + QuickResponseStatusDeleteInProgress QuickResponseStatus = "DELETE_IN_PROGRESS" + QuickResponseStatusDeleteFailed QuickResponseStatus = "DELETE_FAILED" + QuickResponseStatusDeleted QuickResponseStatus = "DELETED" + QuickResponseStatusUpdateInProgress QuickResponseStatus = "UPDATE_IN_PROGRESS" + QuickResponseStatusUpdateFailed QuickResponseStatus = "UPDATE_FAILED" +) + +// Values returns all known values for QuickResponseStatus. 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 (QuickResponseStatus) Values() []QuickResponseStatus { + return []QuickResponseStatus{ + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "CREATED", + "DELETE_IN_PROGRESS", + "DELETE_FAILED", + "DELETED", + "UPDATE_IN_PROGRESS", + "UPDATE_FAILED", } } diff --git a/service/wisdom/types/errors.go b/service/wisdom/types/errors.go index 6f8e4a1ceb1..8973508804c 100644 --- a/service/wisdom/types/errors.go +++ b/service/wisdom/types/errors.go @@ -89,6 +89,35 @@ func (e *PreconditionFailedException) ErrorCode() string { } func (e *PreconditionFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The request reached the service more than 15 minutes after the date stamp on +// the request or more than 15 minutes after the request expiration date (such as +// for pre-signed URLs), or the date stamp on the request is more than 15 minutes +// in the future. +type RequestTimeoutException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RequestTimeoutException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RequestTimeoutException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RequestTimeoutException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RequestTimeoutException" + } + return *e.ErrorCodeOverride +} +func (e *RequestTimeoutException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified resource does not exist. type ResourceNotFoundException struct { Message *string diff --git a/service/wisdom/types/types.go b/service/wisdom/types/types.go index 18d9e6581e4..8c41207e03d 100644 --- a/service/wisdom/types/types.go +++ b/service/wisdom/types/types.go @@ -104,7 +104,8 @@ type AssistantAssociationInputData interface { isAssistantAssociationInputData() } -// The identifier of the knowledge base. +// The identifier of the knowledge base. This should not be a QUICK_RESPONSES type +// knowledge base if you're storing Wisdom Content resource to it. type AssistantAssociationInputDataMemberKnowledgeBaseId struct { Value string @@ -206,12 +207,13 @@ type AssistantData struct { IntegrationConfiguration *AssistantIntegrationConfiguration // The configuration information for the customer managed key used for encryption. - // This KMS key must have a policy that allows kms:CreateGrant and kms:DescribeKey - // permissions to the IAM identity using the key to invoke Wisdom. To use Wisdom - // with chat, the key policy must also allow kms:Decrypt , kms:GenerateDataKey* , - // and kms:DescribeKey permissions to the connect.amazonaws.com service principal. - // For more information about setting up a customer managed key for Wisdom, see - // Enable Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) + // This KMS key must have a policy that allows kms:CreateGrant , kms:DescribeKey , + // and kms:Decrypt/kms:GenerateDataKey permissions to the IAM identity using the + // key to invoke Wisdom. To use Wisdom with chat, the key policy must also allow + // kms:Decrypt , kms:GenerateDataKey* , and kms:DescribeKey permissions to the + // connect.amazonaws.com service principal. For more information about setting up a + // customer managed key for Wisdom, see Enable Amazon Connect Wisdom for your + // instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) // . ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration @@ -266,12 +268,13 @@ type AssistantSummary struct { IntegrationConfiguration *AssistantIntegrationConfiguration // The configuration information for the customer managed key used for encryption. - // This KMS key must have a policy that allows kms:CreateGrant and kms:DescribeKey - // permissions to the IAM identity using the key to invoke Wisdom. To use Wisdom - // with chat, the key policy must also allow kms:Decrypt , kms:GenerateDataKey* , - // and kms:DescribeKey permissions to the connect.amazonaws.com service principal. - // For more information about setting up a customer managed key for Wisdom, see - // Enable Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) + // This KMS key must have a policy that allows kms:CreateGrant , kms:DescribeKey , + // and kms:Decrypt/kms:GenerateDataKey permissions to the IAM identity using the + // key to invoke Wisdom. To use Wisdom with chat, the key policy must also allow + // kms:Decrypt , kms:GenerateDataKey* , and kms:DescribeKey permissions to the + // connect.amazonaws.com service principal. For more information about setting up a + // customer managed key for Wisdom, see Enable Amazon Connect Wisdom for your + // instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) // . ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration @@ -281,6 +284,34 @@ type AssistantSummary struct { noSmithyDocumentSerde } +// The configuration information of the external data source. +// +// The following types satisfy this interface: +// +// ConfigurationMemberConnectConfiguration +type Configuration interface { + isConfiguration() +} + +// The configuration information of the Amazon Connect data source. +type ConfigurationMemberConnectConfiguration struct { + Value ConnectConfiguration + + noSmithyDocumentSerde +} + +func (*ConfigurationMemberConnectConfiguration) isConfiguration() {} + +// The configuration information of the Amazon Connect data source. +type ConnectConfiguration struct { + + // The identifier of the Amazon Connect instance. You can find the instanceId in + // the ARN of the instance. + InstanceId *string + + noSmithyDocumentSerde +} + // Information about the content. type ContentData struct { @@ -304,7 +335,8 @@ type ContentData struct { // This member is required. KnowledgeBaseArn *string - // The identifier of the knowledge base. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. // // This member is required. KnowledgeBaseId *string @@ -368,7 +400,8 @@ type ContentReference struct { // The Amazon Resource Name (ARN) of the knowledge base. KnowledgeBaseArn *string - // The identifier of the knowledge base. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. KnowledgeBaseId *string noSmithyDocumentSerde @@ -397,7 +430,8 @@ type ContentSummary struct { // This member is required. KnowledgeBaseArn *string - // The identifier of the knowledge base. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. // // This member is required. KnowledgeBaseId *string @@ -465,6 +499,22 @@ type DocumentText struct { noSmithyDocumentSerde } +// The configuration information of the external data source. +type ExternalSourceConfiguration struct { + + // The configuration information of the external data source. + // + // This member is required. + Configuration Configuration + + // The type of the external data source. + // + // This member is required. + Source ExternalSource + + noSmithyDocumentSerde +} + // A search filter. type Filter struct { @@ -486,6 +536,27 @@ type Filter struct { noSmithyDocumentSerde } +// The configuration information of the grouping of Wisdom users. +type GroupingConfiguration struct { + + // The criteria used for grouping Wisdom users. The following is the list of + // supported criteria values. + // - RoutingProfileArn : Grouping the users by their Amazon Connect routing + // profile ARN (https://docs.aws.amazon.com/connect/latest/APIReference/API_RoutingProfile.html) + // . User should have SearchRoutingProfile (https://docs.aws.amazon.com/connect/latest/APIReference/API_SearchRoutingProfiles.html) + // and DescribeRoutingProfile (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeRoutingProfile.html) + // permissions when setting criteria to this value. + Criteria *string + + // The list of values that define different groups of Wisdom users. + // - When setting criteria to RoutingProfileArn , you need to provide a list of + // ARNs of Amazon Connect routing profiles (https://docs.aws.amazon.com/connect/latest/APIReference/API_RoutingProfile.html) + // as values of this parameter. + Values []string + + noSmithyDocumentSerde +} + // Offset specification to describe highlighting of document excerpts for // rendering search results and recommendations. type Highlight struct { @@ -499,13 +570,137 @@ type Highlight struct { noSmithyDocumentSerde } +// Summary information about the import job. +type ImportJobData struct { + + // The timestamp when the import job was created. + // + // This member is required. + CreatedTime *time.Time + + // The identifier of the import job. + // + // This member is required. + ImportJobId *string + + // The type of the import job. + // + // This member is required. + ImportJobType ImportJobType + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. + // + // This member is required. + KnowledgeBaseId *string + + // The timestamp when the import job data was last modified. + // + // This member is required. + LastModifiedTime *time.Time + + // The status of the import job. + // + // This member is required. + Status ImportJobStatus + + // 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 + + // The download link to the resource file that is uploaded to the import job. + // + // This member is required. + Url *string + + // The expiration time of the URL as an epoch timestamp. + // + // This member is required. + UrlExpiry *time.Time + + // The configuration information of the external data source. + ExternalSourceConfiguration *ExternalSourceConfiguration + + // The link to donwload the information of resource data that failed to be + // imported. + FailedRecordReport *string + + // The metadata fields of the imported Wisdom resources. + Metadata map[string]string + + noSmithyDocumentSerde +} + +// Summary information about the import job. +type ImportJobSummary struct { + + // The timestamp when the import job was created. + // + // This member is required. + CreatedTime *time.Time + + // The identifier of the import job. + // + // This member is required. + ImportJobId *string + + // The type of import job. + // + // This member is required. + ImportJobType ImportJobType + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. + // + // This member is required. + KnowledgeBaseId *string + + // The timestamp when the import job was last modified. + // + // This member is required. + LastModifiedTime *time.Time + + // The status of the import job. + // + // This member is required. + Status ImportJobStatus + + // 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 + + // The configuration information of the external source that the resource data are + // imported from. + ExternalSourceConfiguration *ExternalSourceConfiguration + + // The metadata fields of the imported Wisdom resources. + Metadata map[string]string + + noSmithyDocumentSerde +} + // Association information about the knowledge base. type KnowledgeBaseAssociationData struct { // The Amazon Resource Name (ARN) of the knowledge base. KnowledgeBaseArn *string - // The identifier of the knowledge base. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. KnowledgeBaseId *string noSmithyDocumentSerde @@ -519,7 +714,8 @@ type KnowledgeBaseData struct { // This member is required. KnowledgeBaseArn *string - // The identifier of the knowledge base. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. // // This member is required. KnowledgeBaseId *string @@ -550,10 +746,10 @@ type KnowledgeBaseData struct { RenderingConfiguration *RenderingConfiguration // The configuration information for the customer managed key used for encryption. - // This KMS key must have a policy that allows kms:CreateGrant and kms:DescribeKey - // permissions to the IAM identity using the key to invoke Wisdom. For more - // information about setting up a customer managed key for Wisdom, see Enable - // Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) + // This KMS key must have a policy that allows kms:CreateGrant , kms:DescribeKey , + // and kms:Decrypt/kms:GenerateDataKey permissions to the IAM identity using the + // key to invoke Wisdom. For more information about setting up a customer managed + // key for Wisdom, see Enable Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) // . ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration @@ -574,7 +770,8 @@ type KnowledgeBaseSummary struct { // This member is required. KnowledgeBaseArn *string - // The identifier of the knowledge base. + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. // // This member is required. KnowledgeBaseId *string @@ -601,10 +798,10 @@ type KnowledgeBaseSummary struct { RenderingConfiguration *RenderingConfiguration // The configuration information for the customer managed key used for encryption. - // This KMS key must have a policy that allows kms:CreateGrant and kms:DescribeKey - // permissions to the IAM identity using the key to invoke Wisdom. For more - // information about setting up a customer managed key for Wisdom, see Enable - // Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) + // This KMS key must have a policy that allows kms:CreateGrant , kms:DescribeKey , + // kms:Decrypt/kms:GenerateDataKey permissions to the IAM identity using the key to + // invoke Wisdom. For more information about setting up a customer managed key for + // Wisdom, see Enable Amazon Connect Wisdom for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) // . ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration @@ -638,6 +835,427 @@ type QueryRecommendationTriggerData struct { noSmithyDocumentSerde } +// The container quick response content. +// +// The following types satisfy this interface: +// +// QuickResponseContentProviderMemberContent +type QuickResponseContentProvider interface { + isQuickResponseContentProvider() +} + +// The content of the quick response. +type QuickResponseContentProviderMemberContent struct { + Value string + + noSmithyDocumentSerde +} + +func (*QuickResponseContentProviderMemberContent) isQuickResponseContentProvider() {} + +// The content of the quick response stored in different media types. +type QuickResponseContents struct { + + // The container quick response content. + Markdown QuickResponseContentProvider + + // The container quick response content. + PlainText QuickResponseContentProvider + + noSmithyDocumentSerde +} + +// Information about the quick response. +type QuickResponseData struct { + + // The media type of the quick response content. + // - Use application/x.quickresponse;format=plain for quick response written in + // plain text. + // - Use application/x.quickresponse;format=markdown for quick response written + // in richtext. + // + // This member is required. + ContentType *string + + // The timestamp when the quick response was created. + // + // This member is required. + CreatedTime *time.Time + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The timestamp when the quick response data was last modified. + // + // This member is required. + LastModifiedTime *time.Time + + // The name of the quick response. + // + // This member is required. + Name *string + + // The Amazon Resource Name (ARN) of the quick response. + // + // This member is required. + QuickResponseArn *string + + // The identifier of the quick response. + // + // This member is required. + QuickResponseId *string + + // The status of the quick response data. + // + // This member is required. + Status QuickResponseStatus + + // The Amazon Connect contact channels this quick response applies to. The + // supported contact channel types include Chat . + Channels []string + + // The contents of the quick response. + Contents *QuickResponseContents + + // The description of the quick response. + Description *string + + // The configuration information of the user groups that the quick response is + // accessible to. + GroupingConfiguration *GroupingConfiguration + + // Whether the quick response is active. + IsActive *bool + + // The language code value for the language in which the quick response is written. + Language *string + + // The Amazon Resource Name (ARN) of the user who last updated the quick response + // data. + LastModifiedBy *string + + // The shortcut key of the quick response. The value should be unique across the + // knowledge base. + ShortcutKey *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The container of quick response data. +// +// The following types satisfy this interface: +// +// QuickResponseDataProviderMemberContent +type QuickResponseDataProvider interface { + isQuickResponseDataProvider() +} + +// The content of the quick response. +type QuickResponseDataProviderMemberContent struct { + Value string + + noSmithyDocumentSerde +} + +func (*QuickResponseDataProviderMemberContent) isQuickResponseDataProvider() {} + +// The quick response fields to filter the quick response query results by. The +// following is the list of supported field names. +// - name +// - description +// - shortcutKey +// - isActive +// - channels +// - language +// - contentType +// - createdTime +// - lastModifiedTime +// - lastModifiedBy +// - groupingConfiguration.criteria +// - groupingConfiguration.values +type QuickResponseFilterField struct { + + // The name of the attribute field to filter the quick responses by. + // + // This member is required. + Name *string + + // The operator to use for filtering. + // + // This member is required. + Operator QuickResponseFilterOperator + + // Whether to treat null value as a match for the attribute field. + IncludeNoExistence *bool + + // The values of attribute field to filter the quick response by. + Values []string + + noSmithyDocumentSerde +} + +// The quick response fields to order the quick response query results by. The +// following is the list of supported field names. +// - name +// - description +// - shortcutKey +// - isActive +// - channels +// - language +// - contentType +// - createdTime +// - lastModifiedTime +// - lastModifiedBy +// - groupingConfiguration.criteria +// - groupingConfiguration.values +type QuickResponseOrderField struct { + + // The name of the attribute to order the quick response query results by. + // + // This member is required. + Name *string + + // The order at which the quick responses are sorted by. + Order Order + + noSmithyDocumentSerde +} + +// The quick response fields to query quick responses by. The following is the +// list of supported field names. +// - content +// - name +// - description +// - shortcutKey +type QuickResponseQueryField struct { + + // The name of the attribute to query the quick responses by. + // + // This member is required. + Name *string + + // The operator to use for matching attribute field values in the query. + // + // This member is required. + Operator QuickResponseQueryOperator + + // The values of the attribute to query the quick responses by. + // + // This member is required. + Values []string + + // Whether the query expects only exact matches on the attribute field values. The + // results of the query will only include exact matches if this parameter is set to + // false. + AllowFuzziness *bool + + // The importance of the attribute field when calculating query result relevancy + // scores. The value set for this parameter affects the ordering of search results. + Priority Priority + + noSmithyDocumentSerde +} + +// Information about the import job. +type QuickResponseSearchExpression struct { + + // The configuration of filtering rules applied to quick response query results. + Filters []QuickResponseFilterField + + // The quick response attribute fields on which the query results are ordered. + OrderOnField *QuickResponseOrderField + + // The quick response query expressions. + Queries []QuickResponseQueryField + + noSmithyDocumentSerde +} + +// The result of quick response search. +type QuickResponseSearchResultData struct { + + // The media type of the quick response content. + // - Use application/x.quickresponse;format=plain for quick response written in + // plain text. + // - Use application/x.quickresponse;format=markdown for quick response written + // in richtext. + // + // This member is required. + ContentType *string + + // The contents of the quick response. + // + // This member is required. + Contents *QuickResponseContents + + // The timestamp when the quick response was created. + // + // This member is required. + CreatedTime *time.Time + + // Whether the quick response is active. + // + // This member is required. + IsActive *bool + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. Can be either + // the ID or the ARN. URLs cannot contain the ARN. + // + // This member is required. + KnowledgeBaseId *string + + // The timestamp when the quick response search result data was last modified. + // + // This member is required. + LastModifiedTime *time.Time + + // The name of the quick response. + // + // This member is required. + Name *string + + // The Amazon Resource Name (ARN) of the quick response. + // + // This member is required. + QuickResponseArn *string + + // The identifier of the quick response. + // + // This member is required. + QuickResponseId *string + + // The resource status of the quick response. + // + // This member is required. + Status QuickResponseStatus + + // The user defined contact attributes that are resolved when the search result is + // returned. + AttributesInterpolated []string + + // The user defined contact attributes that are not resolved when the search + // result is returned. + AttributesNotInterpolated []string + + // The Amazon Connect contact channels this quick response applies to. The + // supported contact channel types include Chat . + Channels []string + + // The description of the quick response. + Description *string + + // The configuration information of the user groups that the quick response is + // accessible to. + GroupingConfiguration *GroupingConfiguration + + // The language code value for the language in which the quick response is written. + Language *string + + // The Amazon Resource Name (ARN) of the user who last updated the quick response + // search result data. + LastModifiedBy *string + + // The shortcut key of the quick response. The value should be unique across the + // knowledge base. + ShortcutKey *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + +// The summary information about the quick response. +type QuickResponseSummary struct { + + // The media type of the quick response content. + // - Use application/x.quickresponse;format=plain for quick response written in + // plain text. + // - Use application/x.quickresponse;format=markdown for quick response written + // in richtext. + // + // This member is required. + ContentType *string + + // The timestamp when the quick response was created. + // + // This member is required. + CreatedTime *time.Time + + // The Amazon Resource Name (ARN) of the knowledge base. + // + // This member is required. + KnowledgeBaseArn *string + + // The identifier of the knowledge base. This should not be a QUICK_RESPONSES type + // knowledge base if you're storing Wisdom Content resource to it. + // + // This member is required. + KnowledgeBaseId *string + + // The timestamp when the quick response summary was last modified. + // + // This member is required. + LastModifiedTime *time.Time + + // The name of the quick response. + // + // This member is required. + Name *string + + // The Amazon Resource Name (ARN) of the quick response. + // + // This member is required. + QuickResponseArn *string + + // The identifier of the quick response. + // + // This member is required. + QuickResponseId *string + + // The resource status of the quick response. + // + // This member is required. + Status QuickResponseStatus + + // The Amazon Connect contact channels this quick response applies to. The + // supported contact channel types include Chat . + Channels []string + + // The description of the quick response. + Description *string + + // Whether the quick response is active. + IsActive *bool + + // The Amazon Resource Name (ARN) of the user who last updated the quick response + // data. + LastModifiedBy *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + noSmithyDocumentSerde +} + // Information about the recommendation. type RecommendationData struct { @@ -878,5 +1496,8 @@ type UnknownUnionMember struct { func (*UnknownUnionMember) isAssistantAssociationInputData() {} func (*UnknownUnionMember) isAssistantAssociationOutputData() {} +func (*UnknownUnionMember) isConfiguration() {} +func (*UnknownUnionMember) isQuickResponseContentProvider() {} +func (*UnknownUnionMember) isQuickResponseDataProvider() {} func (*UnknownUnionMember) isRecommendationTriggerData() {} func (*UnknownUnionMember) isSourceConfiguration() {} diff --git a/service/wisdom/types/types_exported_test.go b/service/wisdom/types/types_exported_test.go index fa4480571a2..30657fd2e86 100644 --- a/service/wisdom/types/types_exported_test.go +++ b/service/wisdom/types/types_exported_test.go @@ -43,6 +43,60 @@ func ExampleAssistantAssociationOutputData_outputUsage() { var _ *types.KnowledgeBaseAssociationData +func ExampleConfiguration_outputUsage() { + var union types.Configuration + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ConfigurationMemberConnectConfiguration: + _ = v.Value // Value is types.ConnectConfiguration + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ConnectConfiguration + +func ExampleQuickResponseContentProvider_outputUsage() { + var union types.QuickResponseContentProvider + // type switches can be used to check the union value + switch v := union.(type) { + case *types.QuickResponseContentProviderMemberContent: + _ = 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 ExampleQuickResponseDataProvider_outputUsage() { + var union types.QuickResponseDataProvider + // type switches can be used to check the union value + switch v := union.(type) { + case *types.QuickResponseDataProviderMemberContent: + _ = 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 ExampleRecommendationTriggerData_outputUsage() { var union types.RecommendationTriggerData // type switches can be used to check the union value diff --git a/service/wisdom/validators.go b/service/wisdom/validators.go index abd512f7265..9c55e861c67 100644 --- a/service/wisdom/validators.go +++ b/service/wisdom/validators.go @@ -90,6 +90,26 @@ func (m *validateOpCreateKnowledgeBase) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpCreateQuickResponse struct { +} + +func (*validateOpCreateQuickResponse) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateQuickResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateQuickResponseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateQuickResponseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateSession struct { } @@ -170,6 +190,26 @@ func (m *validateOpDeleteContent) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteImportJob struct { +} + +func (*validateOpDeleteImportJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteImportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteImportJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteImportJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteKnowledgeBase struct { } @@ -190,6 +230,26 @@ func (m *validateOpDeleteKnowledgeBase) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDeleteQuickResponse struct { +} + +func (*validateOpDeleteQuickResponse) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteQuickResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteQuickResponseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteQuickResponseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetAssistantAssociation struct { } @@ -270,6 +330,26 @@ func (m *validateOpGetContentSummary) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpGetImportJob struct { +} + +func (*validateOpGetImportJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetImportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetImportJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetImportJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetKnowledgeBase struct { } @@ -290,6 +370,26 @@ func (m *validateOpGetKnowledgeBase) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetQuickResponse struct { +} + +func (*validateOpGetQuickResponse) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetQuickResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetQuickResponseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetQuickResponseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetRecommendations struct { } @@ -370,6 +470,46 @@ func (m *validateOpListContents) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpListImportJobs struct { +} + +func (*validateOpListImportJobs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListImportJobs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListImportJobsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListImportJobsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListQuickResponses struct { +} + +func (*validateOpListQuickResponses) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListQuickResponses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListQuickResponsesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListQuickResponsesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -470,6 +610,26 @@ func (m *validateOpSearchContent) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpSearchQuickResponses struct { +} + +func (*validateOpSearchQuickResponses) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchQuickResponses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchQuickResponsesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchQuickResponsesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSearchSessions struct { } @@ -510,6 +670,26 @@ func (m *validateOpStartContentUpload) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpStartImportJob struct { +} + +func (*validateOpStartImportJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartImportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartImportJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartImportJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -590,6 +770,26 @@ func (m *validateOpUpdateKnowledgeBaseTemplateUri) HandleInitialize(ctx context. return next.HandleInitialize(ctx, in) } +type validateOpUpdateQuickResponse struct { +} + +func (*validateOpUpdateQuickResponse) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateQuickResponse) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateQuickResponseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateQuickResponseInput(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) } @@ -606,6 +806,10 @@ func addOpCreateKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpCreateKnowledgeBase{}, middleware.After) } +func addOpCreateQuickResponseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateQuickResponse{}, middleware.After) +} + func addOpCreateSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSession{}, middleware.After) } @@ -622,10 +826,18 @@ func addOpDeleteContentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteContent{}, middleware.After) } +func addOpDeleteImportJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteImportJob{}, middleware.After) +} + func addOpDeleteKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteKnowledgeBase{}, middleware.After) } +func addOpDeleteQuickResponseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteQuickResponse{}, middleware.After) +} + func addOpGetAssistantAssociationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAssistantAssociation{}, middleware.After) } @@ -642,10 +854,18 @@ func addOpGetContentSummaryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetContentSummary{}, middleware.After) } +func addOpGetImportJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetImportJob{}, middleware.After) +} + func addOpGetKnowledgeBaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetKnowledgeBase{}, middleware.After) } +func addOpGetQuickResponseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetQuickResponse{}, middleware.After) +} + func addOpGetRecommendationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetRecommendations{}, middleware.After) } @@ -662,6 +882,14 @@ func addOpListContentsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListContents{}, middleware.After) } +func addOpListImportJobsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListImportJobs{}, middleware.After) +} + +func addOpListQuickResponsesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListQuickResponses{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -682,6 +910,10 @@ func addOpSearchContentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchContent{}, middleware.After) } +func addOpSearchQuickResponsesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchQuickResponses{}, middleware.After) +} + func addOpSearchSessionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchSessions{}, middleware.After) } @@ -690,6 +922,10 @@ func addOpStartContentUploadValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpStartContentUpload{}, middleware.After) } +func addOpStartImportJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartImportJob{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -706,6 +942,10 @@ func addOpUpdateKnowledgeBaseTemplateUriValidationMiddleware(stack *middleware.S return stack.Initialize.Add(&validateOpUpdateKnowledgeBaseTemplateUri{}, middleware.After) } +func addOpUpdateQuickResponseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateQuickResponse{}, middleware.After) +} + func validateAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration) error { if v == nil { return nil @@ -721,6 +961,24 @@ func validateAppIntegrationsConfiguration(v *types.AppIntegrationsConfiguration) } } +func validateExternalSourceConfiguration(v *types.ExternalSourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExternalSourceConfiguration"} + if len(v.Source) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Configuration == nil { + invalidParams.Add(smithy.NewErrParamRequired("Configuration")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFilter(v *types.Filter) error { if v == nil { return nil @@ -759,6 +1017,121 @@ func validateFilterList(v []types.Filter) error { } } +func validateQuickResponseFilterField(v *types.QuickResponseFilterField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseFilterField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseFilterFieldList(v []types.QuickResponseFilterField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseFilterFieldList"} + for i := range v { + if err := validateQuickResponseFilterField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseOrderField(v *types.QuickResponseOrderField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseOrderField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseQueryField(v *types.QuickResponseQueryField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseQueryField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseQueryFieldList(v []types.QuickResponseQueryField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseQueryFieldList"} + for i := range v { + if err := validateQuickResponseQueryField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickResponseSearchExpression(v *types.QuickResponseSearchExpression) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickResponseSearchExpression"} + if v.Queries != nil { + if err := validateQuickResponseQueryFieldList(v.Queries); err != nil { + invalidParams.AddNested("Queries", err.(smithy.InvalidParamsError)) + } + } + if v.Filters != nil { + if err := validateQuickResponseFilterFieldList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if v.OrderOnField != nil { + if err := validateQuickResponseOrderField(v.OrderOnField); err != nil { + invalidParams.AddNested("OrderOnField", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSearchExpression(v *types.SearchExpression) error { if v == nil { return nil @@ -880,6 +1253,27 @@ func validateOpCreateKnowledgeBaseInput(v *CreateKnowledgeBaseInput) error { } } +func validateOpCreateQuickResponseInput(v *CreateQuickResponseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateQuickResponseInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Content == nil { + invalidParams.Add(smithy.NewErrParamRequired("Content")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateSessionInput(v *CreateSessionInput) error { if v == nil { return nil @@ -949,6 +1343,24 @@ func validateOpDeleteContentInput(v *DeleteContentInput) error { } } +func validateOpDeleteImportJobInput(v *DeleteImportJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteImportJobInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.ImportJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImportJobId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput) error { if v == nil { return nil @@ -964,6 +1376,24 @@ func validateOpDeleteKnowledgeBaseInput(v *DeleteKnowledgeBaseInput) error { } } +func validateOpDeleteQuickResponseInput(v *DeleteQuickResponseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteQuickResponseInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.QuickResponseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickResponseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetAssistantAssociationInput(v *GetAssistantAssociationInput) error { if v == nil { return nil @@ -1033,6 +1463,24 @@ func validateOpGetContentSummaryInput(v *GetContentSummaryInput) error { } } +func validateOpGetImportJobInput(v *GetImportJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetImportJobInput"} + if v.ImportJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImportJobId")) + } + 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 @@ -1048,6 +1496,24 @@ func validateOpGetKnowledgeBaseInput(v *GetKnowledgeBaseInput) error { } } +func validateOpGetQuickResponseInput(v *GetQuickResponseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetQuickResponseInput"} + if v.QuickResponseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickResponseId")) + } + 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 @@ -1114,6 +1580,36 @@ func validateOpListContentsInput(v *ListContentsInput) error { } } +func validateOpListImportJobsInput(v *ListImportJobsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListImportJobsInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListQuickResponsesInput(v *ListQuickResponsesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListQuickResponsesInput"} + 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 @@ -1205,6 +1701,28 @@ func validateOpSearchContentInput(v *SearchContentInput) error { } } +func validateOpSearchQuickResponsesInput(v *SearchQuickResponsesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchQuickResponsesInput"} + 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 := validateQuickResponseSearchExpression(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 @@ -1245,6 +1763,32 @@ func validateOpStartContentUploadInput(v *StartContentUploadInput) error { } } +func validateOpStartImportJobInput(v *StartImportJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartImportJobInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if len(v.ImportJobType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ImportJobType")) + } + if v.UploadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UploadId")) + } + if v.ExternalSourceConfiguration != nil { + if err := validateExternalSourceConfiguration(v.ExternalSourceConfiguration); err != nil { + invalidParams.AddNested("ExternalSourceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil @@ -1316,3 +1860,21 @@ func validateOpUpdateKnowledgeBaseTemplateUriInput(v *UpdateKnowledgeBaseTemplat return nil } } + +func validateOpUpdateQuickResponseInput(v *UpdateQuickResponseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateQuickResponseInput"} + if v.KnowledgeBaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KnowledgeBaseId")) + } + if v.QuickResponseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickResponseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +}